Skip to main content

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 around open and gzip.open returning an XFile object, which is a wrapper around File and gzip.GzipFile. XFile implements methods open, close, read, readline, readlines, write with the same parameters as File methods. It also implements __iter__ and __next__ to make it iterable and __enter__ and __exit__ to make it usable in with statements. Files whose names end with .gz are treated as gzip files, all other files are treated as uncompressed files.

  • Logger: a wrapper around logging module. A Logger object is intialized with a verbosity parameter which is translated into a logging value (WARNING, INFO or DEBUG). It implements debug, info, warning and error methods. They all take a string as first argument argument. error takes an extra argument, code. When called, error print its first parameter then calls exit(code).

  • header, blue, green, yellow, orange, red, bold, underline: apply decoration to string (see example.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)

Source distribution for convenience 0.2
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)

Table of built distributions (wheels) for convenience 0.2
File Interpreter ABI Platform Actions
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.

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page