# 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/97/8d/8cb13eedabd63a2cece014845ef295dd878833cc38047f2a8cc2fe05c51a/packg-0.22.12.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.22.12",
"project_urls": {
"Project-URL": "https://github.com/simon-ging/packg"
},
"split_keywords": [
"attrs",
" typing",
" dict",
" attr"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e997171b0723185c7556c0f69ece592370ea09a26ebb0c76a3c9c5627cf71156",
"md5": "069b7da0f7ed70fbe33512fa1f281947",
"sha256": "84774e876ac7ce14126e83f7f5c61da1c2adf4323f8739eccad64377d7e8928d"
},
"downloads": -1,
"filename": "packg-0.22.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "069b7da0f7ed70fbe33512fa1f281947",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 91119,
"upload_time": "2025-02-23T08:23:20",
"upload_time_iso_8601": "2025-02-23T08:23:20.303574Z",
"url": "https://files.pythonhosted.org/packages/e9/97/171b0723185c7556c0f69ece592370ea09a26ebb0c76a3c9c5627cf71156/packg-0.22.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "978d8cb13eedabd63a2cece014845ef295dd878833cc38047f2a8cc2fe05c51a",
"md5": "89455e6b17165e2a05bf9ff04fdeb16d",
"sha256": "21b998ce5c97b5b8ad427fa68784ad5a196502088081d3239d78670499a99320"
},
"downloads": -1,
"filename": "packg-0.22.12.tar.gz",
"has_sig": false,
"md5_digest": "89455e6b17165e2a05bf9ff04fdeb16d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 70749,
"upload_time": "2025-02-23T08:23:22",
"upload_time_iso_8601": "2025-02-23T08:23:22.610324Z",
"url": "https://files.pythonhosted.org/packages/97/8d/8cb13eedabd63a2cece014845ef295dd878833cc38047f2a8cc2fe05c51a/packg-0.22.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-23 08:23:22",
"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"
}