Collection of utilities used in other python projects.
Project description
packg
Collection of utilities used in other python projects.
Features
caching
: Cache objects to disk (usingjoblib
) or to memoryconstclass.Const
: Base class for defining constants, as alternative toenum.Enum
debugging
: Connect to PyCharm debug serverdtime
: Wrappers and formatters fordatetime
and other timing utilitieslog
: Wrapper forloguru
, utilities for stdliblogging
iotools
: Index paths, compress and read files, git utilities, wrappers to load json/yamlmagic
: Wrapper aroundimportlib
maths
: Various small mathematical utilitiesmisc
:format_exception(e)
outputs the exception as it appears in the stacktrace.suppress_stdout_stderr
context manager to suppress all output of a block of code.
multiproc
: Multiprocessing utilitiespackaging
: Code to handle creation and running of python packagespaths
: Load paths from the global environment or .env files usingpython-dotenv
stats
: Simple statistics utilitiesstrings
: Base64, quote strings, create random strings, create hashes of objectssystem
: Wrapper forsubprocess.Popen
testing
: Import all modules from a package and other utilitiestqdmext
: Wrappertqdm_max_ncols
that limits the width of atqdm
progressbar by defaulttypext
: Type definitionsweb
: Download file and resume a partial download, disable web access
Install
Requires python>=3.7
pip install packg
Setup environment paths
# show environment
python -m packg.cli.show_env
# or
packg show_env
To override the defaults with your own values:
- Set the environment variables in your shell e.g. using .bashrc
- Create a file named
.env
in the root of your project as follows:
ENV_DATA_DIR=data
ENV_RESULT_DIR=results
ENV_ANNO_DIR=annotations
ENV_CODE_DIR=/home/${USER}/code
ENV_CACHE_DIR=/home/${USER}/.cache
Dev install
Clone repository and cd into, then:
pip install -e .
pip install pytest pytest-cov pylint
python -m pytest --cov
pylint packg
pylint tests
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
packg-0.18.8.tar.gz
(62.1 kB
view details)
Built Distribution
packg-0.18.8-py3-none-any.whl
(77.0 kB
view details)
File details
Details for the file packg-0.18.8.tar.gz
.
File metadata
- Download URL: packg-0.18.8.tar.gz
- Upload date:
- Size: 62.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d64529c3bfbd8780ce5d6c3d894d2e70aea21253c482f310b8aa786cc103975e |
|
MD5 | 0195f40ee7eb5879082f59e8fa6fbc0e |
|
BLAKE2b-256 | d70436b46fec912b4f27bca9579621d7f5ac130c4534ea976359c5f12f2d0e12 |
File details
Details for the file packg-0.18.8-py3-none-any.whl
.
File metadata
- Download URL: packg-0.18.8-py3-none-any.whl
- Upload date:
- Size: 77.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8a839180821c75f89b6da5a29a6d23d9886300612f675f8e5819c7d76b4e994 |
|
MD5 | 5db50b690faa7bc3b14f6c46b45b64af |
|
BLAKE2b-256 | b8cea06dd7db23e0cb48dd0156e8f96ecb190767b02f4692b30c0dedaa068751 |