Convenience tool: wrapper around regular/gzip files, Logger, text colors
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.
xopen: a wrapper around
XFileobject, which is a wrapper around
writewith the same parameters as
Filemethods. It also implements
__next__to make it iterable and
__exit__to make it usable in
withstatements. Files whose names end with .gz are treated as gzip files, all other files are treated as uncompressed files.
Logger: a wrapper around
Loggerobject is intialized with a
verbosityparameter which is translated into a
DEBUG). It implements
errormethods. They all take a string as first argument argument.
errortakes an extra argument,
code. When called,
errorprint its first parameter then calls
header, blue, green, yellow, orange, red, bold, underline: apply decoration to string (see
A good example being worth a thousand words, please see example.py
pip install convenience
- 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.
Please make a pull request on gitlab. You can mail me at
first_name [dot] family_name [at] crans [dot] org
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for convenience-0.2-py3-none-any.whl