Pygister
A Python tool to interact with GitHub Gists. This tool allows you to create, read, update, and sync Gists directly from the command line.
Features
- Create a new Gist from a local file.
- Read the content of a Gist by its ID.
- Update an existing Gist with the content of a local file.
- Synchronize a local file with a remote Gist, keeping them in sync at regular intervals.
- Print the version of the
pygisterlibrary.
Installation
Using pip
You can install pygister directly from the source:
pip install -e .
Using setup.py
To install using the setup.py script:
python setup.py install
Usage
Command Line Interface
Print the version
To print the version of the pygister library:
pygist version
Create a Gist
To create a new Gist from a local file and return the short URL of the new Gist:
pygist push <filename>
Read a Gist
To read the content of a Gist by its ID and print it to stdout:
pygist read <ID>
Update a Gist
To update an existing Gist with the content of a local file:
pygist push <filename> <ID>
Sync a Local File with a Gist
To synchronize a local file with a remote Gist every specified number of seconds:
pygist sync <ID> <Seconds>
- If the local file does not exist, it will be created.
- If the local file is newer, it will update the Gist.
- If the Gist is newer, it will update the local file.
- The process will run in a loop every
<Seconds>and will gracefully shut down on receivingCTRL-C.
Example Usage
-
Create a Gist:
pygist push example.txt
-
Read a Gist:
pygist read 1234567890abcdef1234567890abcdef
-
Update a Gist:
pygist push example.txt 1234567890abcdef1234567890abcdef
-
Sync a Local File with a Gist:
pygist sync 1234567890abcdef1234567890abcdef 60
This command will sync the local file associated with the Gist ID every 60 seconds.
Development
Running Tests
To run tests:
pytest
Linting and Formatting
To lint and format the code:
make lint
Type Checking
To perform type checking:
make type-check
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Author
Farshid Ashouri - farsheed.ashouri@gmail.com
Metadata
Release files for pygister 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygister-0.1.5.tar.gz | 8.8 kB | Without provenance | Details for pygister-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygister-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for pygister-0.1.5-py3-none-any.whl |
Total release size: 12.0 kB
Release files / pygister-0.1.5.tar.gz
| Download URL | pygister-0.1.5.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd9917e32aca431299ab0449f0c3e18eb56fcb941c1d04a11486fef998e73909
|
|
BLAKE2b-256 checksum How to use checksums |
c762688b727f58aecd55308477e5a0a7d33d2d5972eacf70a57817310003a53d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Release files / pygister-0.1.5-py3-none-any.whl
| Download URL | pygister-0.1.5-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c608fc495dc068b20d84ec00053af37b752279e654d5a565e4dbfa434c2f33c
|
|
BLAKE2b-256 checksum How to use checksums |
8a30428098ec9afdc386844f4269fc8eb974e1b1382fe84d28f9319d00109172
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Security for pygister 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.