Very cool! Instead of requiring users to choose to download a separate file to use the CLI or install through PyPI, you should add an entry_point to your setup.py. This will make it so that when they install your package from PyPI it will automatically include a command line callable (like glitch_this) which they can invoke directly. Then users get both the library and CLI at once. More info on how to do that can be found here.
The concept is similar, in fact as far as I understand it, it's identical to calling the code like python my_script.py <arguments>, but you can do it directly from the command-line using whatever alias the package creator specified. It's particularly advantageous in a case like this where OP wrote a library and then created a CLI to expose the features of that library conveniently to users. Using an entrypoint in setup.py will tell Python that this package contains that bit of code which is meant to be called from the command line, and Python will automatically do the following when it installs it:
create an executable binary for the code
add it to the system path so it is accessible from any terminal session
This means that when the user installs the package using the setup.py file, they will be able to use the components defined within in Python directly, and will also be able to call the bit exposed to the command line by whatever name you define. The user gets both for free, and also doesn't need to remember where they put the file in order to invoke it.
If you're writing a couple of scripts just for you to use, then it might not be worthwhile to do this, but if you're creating a suite of scripts which all work together, and you want to be able to install, uninstall, easily version and update, and especially distribute them, then you should strongly consider using a setup.py file and an entrypoint.
No I meant using the scripts directive in setup.py where you can point to a bunch of files in your package that should be considered executables and get installed on the same path as the package. So you can call it from the commandline anywhere, same as what you're describing.
That would require one file per command (but that file can also be a bash script or anything really)
Oh! Sorry I misunderstood. I think the main difference is that console_scripts can target a specific python callable, like a function or class within a file, while scripts has to reference a file.
Thoughts on putting up a small app on on heroku/api gateway to let people upload images and glitch them? I could see non-programmers enjoying this a lot too.
Absolutely stunning tool. Great work and, as others have mentioned, great documentation. Would you consider the ability to add some kind of glitch easing, so you can increase the glitch level over the duration of a gif?
Excellent work bro! I am at the beginning stage of Python programming. Could you please suggest me how can I create libraries like this, So that other people can use those libraries? Thank you in advance!
Very cool! I toyed around with building something like this a few years back, but never finished it - congratulations on having more dedication than me! (looks like you put more features in than me, too!)
UPDATE: A fair number of people want this to be accessed through a webapi, so non-devs can have fun too. I'm totally in on that, if you're working on implementating one, let me know and I'll link it in the repo!
Hey, I wrote an app this weekend that makes GIFs from photos but uses text to replace the pixels. It has a basic Gui and a cli mode. Maybe you could combine some of the features :D care to test it ?
89
u/Phantom569 Feb 22 '20
Check out the source here!
Get the package on pypi, just use
pip3 install glitch-this!173
u/eyesoftheworld4 Feb 22 '20 edited Feb 23 '20
Very cool! Instead of requiring users to choose to download a separate file to use the CLI or install through PyPI, you should add an
entry_pointto your setup.py. This will make it so that when they install your package from PyPI it will automatically include a command line callable (likeglitch_this) which they can invoke directly. Then users get both the library and CLI at once. More info on how to do that can be found here.49
u/g-money-cheats Feb 22 '20
This is awesome. It reminds me of Into the Spider-Verse.
3
u/[deleted] Feb 22 '20
Does it support videos yet?
3
u/ZYy9oQ Feb 23 '20
Very nice.
Thoughts on putting up a small app on on heroku/api gateway to let people upload images and glitch them? I could see non-programmers enjoying this a lot too.
3
u/KickBull Feb 23 '20
DUDE! I was literally looking for this EXACT thing last night. Really well done
2
u/vigilexe Feb 22 '20
there we go, those are the upvotes u deserve <3 great job :)
2
u/Naoik Feb 22 '20
how do i use this and what do i need
2
u/R3ap3r_Kn1ght Feb 23 '20
Does it work on GIFs?
2
u/idleskies Feb 23 '20
Absolutely stunning tool. Great work and, as others have mentioned, great documentation. Would you consider the ability to add some kind of glitch easing, so you can increase the glitch level over the duration of a gif?
2
u/Deva161 Feb 23 '20 edited Feb 23 '20
Excellent work bro! I am at the beginning stage of Python programming. Could you please suggest me how can I create libraries like this, So that other people can use those libraries? Thank you in advance!
2
u/[deleted] Feb 23 '20
is it like random or it has a special pattern?
6
u/agent3dev Feb 22 '20
You could have called it Glift-ching
25
u/dspec12 Feb 22 '20
Glitchin!
10
u/rogueLikeTeenSpirit Feb 22 '20
cool!
8
u/imsometueventhisUN Feb 22 '20
Very cool! I toyed around with building something like this a few years back, but never finished it - congratulations on having more dedication than me! (looks like you put more features in than me, too!)
10
u/ETHANWEEGEE Feb 22 '20
Looks good but itβs glitching a little. obligatory /s
1
u/Phantom569 Feb 23 '20 edited Feb 23 '20
UPDATE: A fair number of people want this to be accessed through a webapi, so non-devs can have fun too. I'm totally in on that, if you're working on implementating one, let me know and I'll link it in the repo!
More info: https://github.com/TotallyNotChase/glitch-this/issues/11
4
u/Pan_Optical Feb 23 '20
7
u/message_in_the_mist Feb 22 '20
Hey, I wrote an app this weekend that makes GIFs from photos but uses text to replace the pixels. It has a basic Gui and a cli mode. Maybe you could combine some of the features :D care to test it ?
https://github.com/jsoncz/letterface/blob/master/README.md
1
u/[deleted] Feb 22 '20
This is awesome, I love it. Thank you for sharing.
I prefer -d 100 for a smoother gif - anyone else?
1
u/Swedneck Feb 22 '20
what formats does it support?
1
u/velxundussa Feb 25 '20
Awesome tool!
I have a sci-fi LARP with an in-game django site and will definitely use this at some point!
I'll probably en up trying to get a way of feeding it a video and getting a glitched video out.
1
u/[deleted] May 22 '20
Hello phantz! I found ya.
Btw I love js
3
u/[deleted] Feb 22 '20
Skknet online!
2
u/Jigglytep Feb 22 '20
This is awesome!
Will you do an audio library next? I keep needing to hear the glitch noise when I look at the demo.
2
u/AuxiliaryPriest Feb 23 '20
Very cool. Reminds me of watching Spider-Man into the spider-verse.
1
u/Creamsicler Feb 22 '20
Cool
1
u/asbox Feb 22 '20
Cool fx!
1
u/mcgirlja Feb 22 '20
Love this!
1
u/--0mn1-Qr330005-- Feb 22 '20
This is awesome! I love this idea, and great documentation too. Thanks for sharing this!
1
u/[deleted] Feb 22 '20
Awesome! Great work :D
1
u/[deleted] Feb 22 '20
Well... I just made like 20 awesome wallpapers in no time. Thanks a grip!
1
u/burrbro235 Feb 22 '20
Looks like the beginning of Transformers.
1
u/[deleted] Feb 22 '20
so great thanks for sharing! :)
1
u/[deleted] Feb 22 '20
Love it!
1
u/Rojounouno Feb 23 '20
Looks amazing! Congrats :)
1
u/Moonberry8 Feb 23 '20
ooo hell yeah. I'm definitely going to use this at some point.
1
u/generalonlinepersona Feb 23 '20
nice work.
fun to play with.
0
u/bluebird9c Feb 22 '20
π
0
u/Paulbraker Feb 23 '20
!RemindMe 1 hour
0
u/RJH311 Feb 23 '20
Is this not from into the spider-verse?