Convenience
Tools for everyday use.
Source and install files are available under BSD License here: https://gitlab.com/sylvainraybaud/convenience
This package HAS NOT been tested with Python 2.
API
-
xopen: a wrapper aroundopenandgzip.openreturning anXFileobject, which is a wrapper aroundFileandgzip.GzipFile.XFileimplements methodsopen,close,read,readline,readlines,writewith the same parameters asFilemethods. It also implements__iter__and__next__to make it iterable and__enter__and__exit__to make it usable inwithstatements. Files whose names end with .gz are treated as gzip files, all other files are treated as uncompressed files. -
Logger: a wrapper aroundloggingmodule. ALoggerobject is intialized with averbosityparameter which is translated into aloggingvalue (WARNING,INFOorDEBUG). It implementsdebug,info,warninganderrormethods. They all take a string as first argument argument.errortakes an extra argument,code. When called,errorprint its first parameter then callsexit(code). -
header, blue, green, yellow, orange, red, bold, underline: apply decoration to string (seeexample.py)
Using
A good example being worth a thousand words, please see example.py
Installing
pip install convenience
TODO
- Use magic number instead of file extension to detected gzipped files, when applicable.
- Handle more compression format.
- Double check handling of various text encodings.
- Python 2 compatibility.
- Add more magic.
Contributing
Please make a pull request on gitlab. You can mail me at
first_name [dot] family_name [at] crans [dot] org
Metadata
Release files for convenience 0.2
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 |
|---|---|---|---|---|
| convenience-0.2.tar.gz | 3.8 kB | Without provenance | Details for convenience-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| convenience-0.2-py3-none-any.whl | Python 3 | none | any | Details for convenience-0.2-py3-none-any.whl |
Total release size: 8.3 kB
Release files / convenience-0.2.tar.gz
| Download URL | convenience-0.2.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7448f0ef2ccc8d19f5433389aca948bcb4f945c28ba666cb3da51bbac4715d6a
|
|
BLAKE2b-256 checksum How to use checksums |
59722c21786fb34ea2cd9143687c965480527bc13f56ce22c597695480ee5a4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / convenience-0.2-py3-none-any.whl
| Download URL | convenience-0.2-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ea89dd6d3034ca594a09f6a25da51c7fcc5d3d0c6756b5ff5be963eba281c45
|
|
BLAKE2b-256 checksum How to use checksums |
2a9f6bc4fc10ea93d4b4f36793bd3e925453361d7423b26866213ddeb0b77bf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for convenience 0.2
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.