# packg
<p align="center">
<a href="https://github.com/simon-ging/packg/actions/workflows/build-py38.yml">
<img alt="build 3.8 status" title="build 3.8 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py38.yml?branch=main&label=python%203.8" />
</a>
<a href="https://github.com/simon-ging/packg/actions/workflows/build-py39.yml">
<img alt="build 3.9 status" title="build 3.9 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py39.yml?branch=main&label=python%203.9" />
</a>
<a href="https://github.com/simon-ging/packg/actions/workflows/build-py310.yml">
<img alt="build 3.10 status" title="build 3.10 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py310.yml?branch=main&label=python%203.10" />
</a>
<a href="https://github.com/simon-ging/packg/actions/workflows/build-py311.yml">
<img alt="build 3.11 status" title="build 3.11 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py311.yml?branch=main&label=python%203.11" />
</a>
<a href="https://github.com/simon-ging/packg/actions/workflows/build-py312.yml">
<img alt="build 3.12 status" title="build 3.12 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py312.yml?branch=main&label=python%203.12" />
</a>
<a href="https://github.com/simon-ging/packg/actions/workflows/build-py313.yml">
<img alt="build 3.13 status" title="build 3.13 status" src="https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py313.yml?branch=main&label=python%203.13" />
</a>
<img alt="coverage" title="coverage" src="https://raw.githubusercontent.com/simon-ging/packg/main/docs/coverage.svg" />
<a href="https://pypi.org/project/packg/">
<img alt="version" title="version" src="https://img.shields.io/pypi/v/packg?color=success" />
</a>
</p>
Collection of utilities used in other python projects.
## Features
* `caching`: Cache objects to disk (using `joblib`) or to memory
* `constclass.Const`: Base class for defining constants, as alternative to `enum.Enum`
* `debugging`: Connect to PyCharm debug server
* `dtime`: Wrappers and formatters for `datetime` and other timing utilities
* `log`: Wrapper for `loguru`, utilities for stdlib `logging`
* `iotools`: Index paths, compress and read files, git utilities, wrappers to load json/yaml
* `magic`: Wrapper around `importlib`
* `maths`: Various small mathematical utilities
* `misc`:
* `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 utilities
* `packaging`: Code to handle creation and running of python packages
* `paths`: Load paths from the global environment or .env files using `python-dotenv`
* `stats`: Simple statistics utilities
* `strings`: Base64, quote strings, create random strings, create hashes of objects
* `system`: Wrapper for `subprocess.Popen`
* `testing`: Import all modules from a package and other utilities
* `tqdmext`: Wrapper `tqdm_max_ncols` that limits the width of a `tqdm` progressbar by default
* `typext`: Type definitions
* `web`: Download file and resume a partial download, disable web access
## Install
Requires `python>=3.8`
```bash
pip install packg
```
## Setup environment paths
```bash
# 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:
```bash
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:
```bash
pip install -e .
pip install pytest pytest-cov pylint
python -m pytest --cov
pylint packg
pylint tests
```
Raw data
{
"_id": null,
"home_page": null,
"name": "packg",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "attrs, typing, dict, attr",
"author": "simon-ging",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/98/f2/87cc455d25712955e29107c0b7e3d4125ae2f81e96c16a569067751b3e53/packg-0.32.1.tar.gz",
"platform": "any",
"description": "# packg\n\n<p align=\"center\">\n<a href=\"https://github.com/simon-ging/packg/actions/workflows/build-py38.yml\">\n <img alt=\"build 3.8 status\" title=\"build 3.8 status\" src=\"https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py38.yml?branch=main&label=python%203.8\" />\n</a>\n<a href=\"https://github.com/simon-ging/packg/actions/workflows/build-py39.yml\">\n <img alt=\"build 3.9 status\" title=\"build 3.9 status\" src=\"https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py39.yml?branch=main&label=python%203.9\" />\n</a>\n<a href=\"https://github.com/simon-ging/packg/actions/workflows/build-py310.yml\">\n <img alt=\"build 3.10 status\" title=\"build 3.10 status\" src=\"https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py310.yml?branch=main&label=python%203.10\" />\n</a>\n<a href=\"https://github.com/simon-ging/packg/actions/workflows/build-py311.yml\">\n <img alt=\"build 3.11 status\" title=\"build 3.11 status\" src=\"https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py311.yml?branch=main&label=python%203.11\" />\n</a>\n<a href=\"https://github.com/simon-ging/packg/actions/workflows/build-py312.yml\">\n <img alt=\"build 3.12 status\" title=\"build 3.12 status\" src=\"https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py312.yml?branch=main&label=python%203.12\" />\n</a>\n<a href=\"https://github.com/simon-ging/packg/actions/workflows/build-py313.yml\">\n <img alt=\"build 3.13 status\" title=\"build 3.13 status\" src=\"https://img.shields.io/github/actions/workflow/status/simon-ging/packg/build-py313.yml?branch=main&label=python%203.13\" />\n</a>\n<img alt=\"coverage\" title=\"coverage\" src=\"https://raw.githubusercontent.com/simon-ging/packg/main/docs/coverage.svg\" />\n<a href=\"https://pypi.org/project/packg/\">\n <img alt=\"version\" title=\"version\" src=\"https://img.shields.io/pypi/v/packg?color=success\" />\n</a>\n</p>\n\nCollection of utilities used in other python projects.\n\n## Features\n\n* `caching`: Cache objects to disk (using `joblib`) or to memory\n* `constclass.Const`: Base class for defining constants, as alternative to `enum.Enum`\n* `debugging`: Connect to PyCharm debug server\n* `dtime`: Wrappers and formatters for `datetime` and other timing utilities\n* `log`: Wrapper for `loguru`, utilities for stdlib `logging`\n* `iotools`: Index paths, compress and read files, git utilities, wrappers to load json/yaml\n* `magic`: Wrapper around `importlib`\n* `maths`: Various small mathematical utilities\n* `misc`:\n * `format_exception(e)` outputs the exception as it appears in the stacktrace.\n * `suppress_stdout_stderr` context manager to suppress all output of a block of code.\n* `multiproc`: Multiprocessing utilities\n* `packaging`: Code to handle creation and running of python packages\n* `paths`: Load paths from the global environment or .env files using `python-dotenv`\n* `stats`: Simple statistics utilities\n* `strings`: Base64, quote strings, create random strings, create hashes of objects\n* `system`: Wrapper for `subprocess.Popen`\n* `testing`: Import all modules from a package and other utilities\n* `tqdmext`: Wrapper `tqdm_max_ncols` that limits the width of a `tqdm` progressbar by default\n* `typext`: Type definitions\n* `web`: Download file and resume a partial download, disable web access\n\n## Install\n\nRequires `python>=3.8`\n\n```bash\npip install packg\n```\n\n## Setup environment paths\n\n```bash\n# show environment\npython -m packg.cli.show_env\n\n# or\npackg show_env\n\n```\n\nTo override the defaults with your own values:\n\n- Set the environment variables in your shell e.g. using .bashrc\n- Create a file named `.env` in the root of your project as follows:\n\n```bash\nENV_DATA_DIR=data\nENV_RESULT_DIR=results\nENV_ANNO_DIR=annotations\nENV_CODE_DIR=/home/${USER}/code\nENV_CACHE_DIR=/home/${USER}/.cache\n```\n\n## Dev install\n\nClone repository and cd into, then:\n\n```bash\npip install -e .\npip install pytest pytest-cov pylint\n\npython -m pytest --cov\n\npylint packg\npylint tests\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Collection of utilities used in other python projects.",
"version": "0.32.1",
"project_urls": {
"Project-URL": "https://github.com/simon-ging/packg"
},
"split_keywords": [
"attrs",
" typing",
" dict",
" attr"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "aa34a0bfae811b3e833d9a5a5cc8d05749e9ddf083a59afafd3ae9ab6eb3f847",
"md5": "d230beb0d00077158fd260205d707b27",
"sha256": "d70dada89cdbf868b44d5c15c4150b49e8dec724d87bd3d34854ca83984c7f60"
},
"downloads": -1,
"filename": "packg-0.32.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d230beb0d00077158fd260205d707b27",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 93187,
"upload_time": "2025-08-19T14:32:09",
"upload_time_iso_8601": "2025-08-19T14:32:09.066187Z",
"url": "https://files.pythonhosted.org/packages/aa/34/a0bfae811b3e833d9a5a5cc8d05749e9ddf083a59afafd3ae9ab6eb3f847/packg-0.32.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "98f287cc455d25712955e29107c0b7e3d4125ae2f81e96c16a569067751b3e53",
"md5": "2bf1815951bb51232439d3806be6ec44",
"sha256": "2991de82cfd3bb949bd786680789134b4874ff6752c1baded8c0158f402a8e7c"
},
"downloads": -1,
"filename": "packg-0.32.1.tar.gz",
"has_sig": false,
"md5_digest": "2bf1815951bb51232439d3806be6ec44",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 72412,
"upload_time": "2025-08-19T14:32:10",
"upload_time_iso_8601": "2025-08-19T14:32:10.657256Z",
"url": "https://files.pythonhosted.org/packages/98/f2/87cc455d25712955e29107c0b7e3d4125ae2f81e96c16a569067751b3e53/packg-0.32.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-19 14:32:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "simon-ging",
"github_project": "packg",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "typedparser",
"specs": []
},
{
"name": "attrs",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "joblib",
"specs": []
},
{
"name": "loguru",
"specs": []
},
{
"name": "natsort",
"specs": []
},
{
"name": "pyyaml",
"specs": []
},
{
"name": "python-dotenv",
"specs": []
},
{
"name": "pathspec",
"specs": []
},
{
"name": "zstandard",
"specs": []
},
{
"name": "tqdm",
"specs": []
},
{
"name": "requests",
"specs": []
},
{
"name": "deprecated",
"specs": []
},
{
"name": "tomlkit",
"specs": []
},
{
"name": "chardet",
"specs": []
}
],
"lcname": "packg"
}