pyglib provides a clean, consistent setup for writing commandline scripts and applications in Python. It makes use of python-gflags and python-glog, and adds an app startup helper that deals with initialization boilerplate so you don’t have to think about it.
Example usage:
#!/usr/bin/env python
from pyglib import app, gflags, log
gflags.DEFINE_integer('bananas', 7, 'Number of bananas.')
FLAGS = gflags.FLAGS
def main(args):
log.info('There are %s bananas.', FLAGS.bananas)
log.debug('This will only show up if you run with --verbosity=10')
if __name__ == __main__:
app.run()
The above module is usable as a commandline app, complete with argument parsing and validation. It automatically has a few flags like --help and --verbosity that come from gflags and glog. Any positional arguments left over after parsing flags are passed along to the main() function.
This example module can also be imported as a library for use in another app. When used that way, any script that imports this one will inherit the --bananas flag defined here.
Metadata
Release files for pyglib 0.1
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 | |
|---|---|---|---|---|
| pyglib-0.1.tar.gz | 4.0 kB | Without provenance | Details |
Release files / pyglib-0.1.tar.gz
| Download URL | pyglib-0.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a063c5a847f57b025fd6d569f375aaac284e4d75bc24019b818b14356254e539
|
|
BLAKE2b-256 checksum How to use checksums |
e8b21d8f675bf1fbb894b190315eb3aa3c4bfb164fb8417ca33028e11a3fceb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyglib 0.1
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.