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.Enumdebugging: Connect to PyCharm debug serverdtime: Wrappers and formatters fordatetimeand other timing utilitieslog: Wrapper forloguru, utilities for stdlibloggingiotools: Index paths, compress and read files, git utilities, wrappers to load json/yamlmagic: Wrapper aroundimportlibmaths: Various small mathematical utilitiesmisc:format_exception(e)outputs the exception as it appears in the stacktrace.suppress_stdout_stderrcontext 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-dotenvstats: Simple statistics utilitiesstrings: Base64, quote strings, create random strings, create hashes of objectssystem: Wrapper forsubprocess.Popentesting: Import all modules from a package and other utilitiestqdmext: Wrappertqdm_max_ncolsthat limits the width of atqdmprogressbar by defaulttypext: Type definitionsweb: Download file and resume a partial download, disable web access
Install
Requires python>=3.10
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
.envin 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
Metadata
Release files for packg 0.36.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| packg-0.36.1.tar.gz | 93.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| packg-0.36.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 213.9 kB
Release files / packg-0.36.1.tar.gz
| Download URL | packg-0.36.1.tar.gz |
|---|---|
| Size | 93.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfb4e8a56d64bb998d9d1021441b3f03c6685dc2220b555603391d57cf2669be
|
|
BLAKE2b-256 checksum How to use checksums |
8ba4e727f30e2db2c26b785638fa8cfd1fb0c893cd4c27559c209ed97efd5821
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / packg-0.36.1-py3-none-any.whl
| Download URL | packg-0.36.1-py3-none-any.whl |
|---|---|
| Size | 120.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e2bb3790aed183826d1a7502a40a6500bb398f24d65ddd956d1f600719ec0c1
|
|
BLAKE2b-256 checksum How to use checksums |
81c7835f3fced362c96144397dfedb5db9c70eac1ee6580513955d56e8cfbb2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|