{"id":28184436,"url":"https://github.com/byteface/pypals","last_synced_at":"2025-08-03T19:34:23.252Z","repository":{"id":62582390,"uuid":"191335695","full_name":"byteface/pypals","owner":"byteface","description":"command line python friends for storing and running scripts and snippets","archived":false,"fork":false,"pushed_at":"2023-07-20T11:09:26.000Z","size":401,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-12T04:52:28.901Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/byteface.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-11T09:13:26.000Z","updated_at":"2021-08-20T08:20:44.000Z","dependencies_parsed_at":"2022-11-03T21:22:13.044Z","dependency_job_id":null,"html_url":"https://github.com/byteface/pypals","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteface%2Fpypals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteface%2Fpypals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteface%2Fpypals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteface%2Fpypals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byteface","download_url":"https://codeload.github.com/byteface/pypals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254470932,"owners_count":22076588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-16T05:15:23.204Z","updated_at":"2025-05-16T05:15:23.798Z","avatar_url":"https://github.com/byteface.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    \u003cimg src=\"https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTe1LJtuvY4cuG7yN2ib3IYmFRU7nayGL3cDYSS8ckTrykpnRgJ\u0026usqp=CAU\"\n    style=\"background-color:rgba(0,0,0,0);\" height=230 alt=\"pypals: it really does nothing!\"\u003e\n    \u003cbr\u003e\n    pypals\n    \u003cbr\u003e\n    \u003csup\u003e\u003csub\u003e\u003csup\u003eTurn python snippets into command line buddies!\u003c/sup\u003e\u003c/sub\u003e\u003c/sup\u003e\n    \u003cbr\u003e\n\u003c/h1\u003e\n\nKeeps your python scripts and snippets as command line pals.\n\n[![PyPI version](https://badge.fury.io/py/pypals.svg)](https://badge.fury.io/py/pypals.svg)\n\n[![Downloads](https://pepy.tech/badge/pypals)](https://pepy.tech/project/pypals)\n\n\n## installation\nGet the package from pypi i.e.\n\n\t$ python3 -m pip install pypals --upgrade\n\n\nsee screen shot in archive folder for using pypal in vscode terminal\n\n\n## usage\nSometimes you write code maybe to do some random job or snippet, scrape something, send a tweet, whatever.\n\nIt's useful to keep those bits of odd code somewhere. pypals are easy to remember ages later.\n\n\t$ python3 -m pypals sportsfan\n\t$ sportsfan doesn't exist, create them now? yes or no\n\t$ \u003e yes\n\t$ your name?\n\t$ \u003e mike\n\t$ Hi my name is sportsfan, Thankyou for creating me!\n\t$ I am listening...\n\nsportsfan has been created for you in a /pypals directory. He can gather data about sports using any python commands you write and put in that folder\n\nnow try running this command...\n\n\t$ hello\n\nnow look in pypals/sportsfan/hello/hello.py file to see an example of a command.\n\nTo create commands try typing 'do something' at the prompt.\n\nYou will see it creates it for you. You can now just edit the file created and fill it in with your code.\n\nNext try typing 'quit'\n\nIf you're editing a command you don't need to restart pypal. It will reload the command. You can even type 'r' to rerun it at the prompt.\n\n\n### parameters\npass any words after your command it will pick them up as parameters.\n\nwhen creating a command it will ask you what to type as a response, you can put any string. \nhowever if you try instead typing: \n\n{args}\n\nNow run your command and type some extra words after it. cool huh.\n\n- TODO - explain commands between bots / sharing commands\nyou can import pypals into other pypals and share commands between them.\n\n\n### logging\n- todo - explain logging. now off by default.\n\nYou can also call or execute any commands you created directly from the command line. i.e.\n\npython3 -m pypals sportsfan hello\n\n\n### meta / vars\n\nAt the root of every pypal you create is a _meta file to store variables.\n\nIf you don't like json you can change the config type (see below)\n\nYou can access any variables stored in _meta from your commands by using the passed in 'o' which is a reference to self.\n\nprint(f\"Hello, to you { o.o['friend']}!\")\n\nYou can store more variables in there if required just add them manually.\n\n\n### shortcuts \n\nWhile a given pypal is running you can pass it the following single letter commands as shortcuts:\n\nr - re-run previous command. (i.e. after editing the python file)\n\nh - history\n\nq - quit\n\nc - list all the variables in the config file\n\nc=json - change the config file to be json\n\nc=ini - change the config file to be ini\n\nc=xml - change the config file to be xml\n\nc=txt - change the config file to be txt\n\nd - generate a docs file inside the given pypals folder that list out all the commands you have created. (once you create a docs file for a pypal, it will auto update every time you create a new command. so don't edit it manually or you will lose your changes.)\n\n\n## CLI\n\npypals has recently been updated to have a cli help system.\n\nthe following command might be useful...\n\nfor a list of all commands\n\n\t$ python3 -m pypals -h\n\nthe version of pypals you are using\n\n\t$ python3 -m pypals -v\n\nshow a list of all your pypals\n\n\t$ python3 -m pypals -l \n\ngenerate a top level docs file that lists out all your pypals in the root of the pypals folder.\n\n\t$ python3 -m pypals -d\n\n\n### API\n\nEvery command gets passed a reference to self 'o' which is a reference to the pypals object.\n\nThere are some commands you can use on this object. But mostly you can use pypal to create your own\n\nTODO - explain API\n\n\n## documentation\n- note : you can't use package names for commands. i.e. builtins, test\n- note : use task manager to montior bots\n\nthe base path to a command is available if loading writing files to same folder:\n\no.context.COMMAND_PATH\n\npypals uses includes rich and domonic libraries so your commands should be able to import and use them.\n\n\n## more\n###  cron notes\nput in sometask.sh file chmod +x the file.\n\n\techo \"do some job batch 1\" | nohup python3 -m pypals jobs \u003e/dev/null 2\u003e\u00261 \u0026\n\n- you may want those to self terminate *see 'quit'\n\n\n### makefile notes\nsomething like this in your makefile to boot one or more faster\n\n```\npypal:\n\tcd /home/ubuntu/Desktop/someapp/automate/; \\\n\tpython3 -m pypals myscraper somefunc\n```\n\nIf you run several pypals simoultaneously you can trash them all easy by putting this in your makefile:\n\n```\nkillall:\n\tpkill -9 python\n```\n\n## Notes\nhttps://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56\n\n\n## about\npypals was my first python project written in python2 in about 2012. It is a useful way to organise code snippets and do research. In 2019 I ported it to python 3 while learning to make pip packages.\n\nplease use it responsibly and if you want to contribute, fork it and send me a pull request.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteface%2Fpypals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyteface%2Fpypals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteface%2Fpypals/lists"}