Terminal buddies to store and run python snippets
Project description
pypals
Turn python snippets into command line buddies!
Keeps track of python scripts and snippets as command line pals.
installation
Get the package from PyPI i.e.
$ python3.7 -m pip install pypals
usage
Sometimes you write code maybe to do some random job or snippet, scrape something, send a tweet, whatever.
It's useful to keep those bits of odd code somewhere. pypals are easy to remember ages later.
$ python3.7 -m pypals sportsfan
$ sportsfan doesn't exist, create them now? yes or no
$ > yes
$ your name?
$ > mike
$ Hi my name is sportsfan, Thankyou for creating me!
$ I am listening...
sportsfan has been created, you can see him in /pypals directory. He can gather data about sports using any python commands you write and put in that folder
now try running this command...
$ hello
look in pypals/sportsfan/hello/hello.py file to see an example of a command. Add as many commands as you like for your project.
Next try typing a command like 'scrape somesite for images'...
You see it creates it for you. you can then just fill it in.
Next try typing 'quit'
If you're editing a python command you don't need to restart pypal. It will reload the command. so just type 'r' to rerun it.
- TODO - explain passing paramaters
- TODO - explain commands between bots / sharing commands
more
cron notes
put in sometask.sh file chmod +x the file.
echo "do some job batch 1" | nohup python3.7 -m pypals jobs >/dev/null 2>&1 &
- you may want those to self terminate *see 'quit'
makefile notes
something like this in your makefile to boot one or more faster
pypal:
cd /home/ubuntu/Desktop/someapp/automate/; \
python3.7 -m pypals myscraper server.py
If you run several pypals simoultaneously you can trash them all easy by putting this in your makefile:
killall:
pkill -9 python
documentation
- note : you can't use package names for commands. i.e. builtins, test
- note : use task manager to montior bots
the base path to a command is available if loading writing files to same folder:
o.context.COMMAND_PATH
shortcuts
- r - re-run previous command
- h - history
Notes
https://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pypals-0.0.8.tar.gz
.
File metadata
- Download URL: pypals-0.0.8.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c1001842aa0109e080bd9c8ea6dc10846ebc2fe30b59f3dd06769a05f3de930 |
|
MD5 | 50ac6a1420bf3119b0e8b892baad4ee6 |
|
BLAKE2b-256 | 909cc3e885ff25045727bf8c5de5c7272d677ba77a3be473fc7af5586c7e3065 |