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.8
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.35.3
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.35.3.tar.gz | 83.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| packg-0.35.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 190.1 kB
Release files / packg-0.35.3.tar.gz
| Download URL | packg-0.35.3.tar.gz |
|---|---|
| Size | 83.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fc64045860eaffeb54ea3748039f97d3a8378432b57d2f06b83964b2a9a5c74
|
|
BLAKE2b-256 checksum How to use checksums |
6344f1ef6dbfedace466c5a89ce8496c6601ceeaeba63b6752b4c0138f3466bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.23
|
Release files / packg-0.35.3-py3-none-any.whl
| Download URL | packg-0.35.3-py3-none-any.whl |
|---|---|
| Size | 107.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
270f5962b77410781a6c8daa81c097aeb946df69cefa2a3c6e84c29710f0d98d
|
|
BLAKE2b-256 checksum How to use checksums |
0d6141c936faa2d42c948193771f6c2094331f1b3ec295232b0f29cba7e72404
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.23
|