CLI utility to post file(s) to a Gist. Posts are, by default, public however the CLI allows you to flag them as private (secret) if desired. A personal access token is required, see CLI Usage below.
- Python >= 3.8
Note: Replace v1.0.0 with the desired version number or main for lastest (unstable) version
Install via pip:
# Linux/MacOS
python3 -m pip install git+https://github.com/preocts/egggist@v1.0.0
# Windows
py -m pip install git+https://github.com/preocts/egggist@v1.0.0EggGist will prompt for your GitHub username and a user token. The token only needs gist permissions and can be created in Profile -> Settings -> Developer Settings -> Personal Access Tokens.
Note: Your personal access token is stored, in plain-text, in your user home directory as .egggist_conf. This file can be deleted at anytime and I strongly recommend restricting the token perimissions to only gist.
usage: prfiles [-h] [--set-username NAME] [--set-token TOKEN] [--private] [--debug] [filename [filename ...]]
Send a file to your GitHub Gist.
positional arguments:
filename One, or more, files to be added to the gist (utf-8 encoding)
optional arguments:
-h, --help show this help message and exit
--set-username NAME Store your username in '~/.egggist_conf
--set-token TOKEN Set your user token in `~/.egggist_conf
--private Make the gist private
--debug Turns internal logging level to DEBUG.Sample, posting three files to one private gist:
$ egggist file1.txt file2.txt file3.txt --privateIt is highly recommended to use a venv for installation. Leveraging a venv will ensure the installed dependency files will not impact other python projects.
Clone this repo and enter root directory of repo:
$ git clone https://github.com/[name]/[module_name]
$ cd [module_name]Create and activate venv:
# Linux/MacOS
python3 -m venv venv
. venv/bin/activate
# Windows
python -m venv venv
venv\Scripts\activate.bat
# or
py -m venv venv
venv\Scripts\activate.batYour command prompt should now have a (venv) prefix on it.
Install editable library and development requirements:
# Linux/MacOS
pip install -r requirements-dev.txt
pip install --editable .
# Windows
python -m pip install -r requirements-dev.txt
python -m pip install --editable .
# or
py -m pip install -r requirements-dev.txt
py -m pip install --editable .Install pre-commit hooks to local repo:
pre-commit install
pre-commit autoupdateRun tests
toxTo exit the venv:
deactivateThis repo has a Makefile with some quality of life scripts if your system supports make.
install: Clean all artifacts, update pip, install requirements with no updatesupdate: Clean all artifacts, update pip, update requirements, install everythingclean-pyc: Deletes python/mypy artifactsclean-tests: Deletes tox, coverage, and pytest artifactsbuild-dist: Build source distribution and wheel distributionstats: Shows line counts of*.pycode