A collection of Python utilities
Project description
zutilities
A collection of Python utilities
Table of Contents
Prerequisites
You'll need to have Python installed in order to use zutilities
. Start by downloading and installing Python.
Note: Python 3 is recommended, however
zutilities
will probably work just fine with most verions of Python 2
Installation
python -m pip install zutilities
Usage
zutilities
.jprint(list_or_dict, indent=2)
Prints a list or dictionary as formatted JSON.
>>> zutilities.jprint([{'key1':'value1','key2':'value2'}])
[
{
"key1": "value1",
"key2": "value2"
}
]
zutilities
.read_json_file(json_file)
Reads a JSON file from the filesystem and returns a list or dictionary.
>>> j = zutilities.read_json_file('file.json')
>>> j
[{'key1': 'value1', 'key2': 'value2'}]
zutilities
.get_logger(log_level=20, format=default_log_format, streams=[sys.stdout])
Returns a logging.RootLogger object with preferred defaults set. The default_log_format is '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s'
>>> logr = zutilities.get_logger()
>>> logr.info('Hello World')
[2021-10-08 21:08:40,353] {<stdin>:1} INFO - Hello world
License
This project is licensed under the MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file zutilities-0.1.2.tar.gz
.
File metadata
- Download URL: zutilities-0.1.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d36c8c30b296e9413edd6f2ca3720fc402859aa9efe46a47ad9f89f8aa6334 |
|
MD5 | 2d6c268bfcd4ac1dc163636f3abb26a7 |
|
BLAKE2b-256 | 0256100b9223d7d8d8594da05117d48f70973cc9e46aa03a4abf326184c92e42 |
File details
Details for the file zutilities-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: zutilities-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d71997dc8a943d452ee1b1ca99915126e251c22268f59e4fa06982c9227871d |
|
MD5 | 56d1814b7560f20ed86ae6eb46c19ba7 |
|
BLAKE2b-256 | f4b7bb1eebec0e39b945a4cdf79dfe06d73ed8526c0a3f136c707cd0bd6b21c0 |