## common-util-py
Common utilities in Python
## How to install
The following commands show how to install `common-util-py` using pip within a Python virtual environment. To see which versions of Python are supported by `common-util-py`, see (here)[#tested-installation-via-pypi-on-the-following-python-versions].
```sh
$ python3 -m venv py313_env
$ source py313_env/bin/activate
$ pip install .[dev]
$ # or
$ virtualenv --python=/usr/bin/python3 py39_env
$ source env_py39/bin/activate
$ pip install .
$ # or
$ python3.8 -m venv env_py38
$ source env_py38/bin/activate
$ pip install .
```
## How to build
To create a source distribution, run the following commands:
```sh
$ source py313_env/bin/activate
$ python3 setup.py --help-commands
$ python3 setup.py sdist
```
## How to test
Initially we were using `nosetests` and have since migrated to `pytest`.
```sh
$ # deprecated
$ # python setup.py test
$ # python setup.py nosetests
$ # nose is replace by pytest since python3.13
$ pytest
```
read more [here](https://nose.readthedocs.io/en/latest/setuptools_integration.html)
* https://www.codingforentrepreneurs.com/blog/pipenv-virtual-environments-for-python/
* https://packaging.python.org/
* https://betterscientificsoftware.github.io/python-for-hpc/tutorials/python-pypi-packaging/
## How to upload to PyPI (Python Package Index)
First, build a source distribution and then install the `twine` package.
```sh
$ python setup.py sdist
$ pip install twine
```
Then, use twine to upload the package to PyPI.
```sh
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
```
or
```sh
$ twine upload --config-file ~/.pypirc -r testpypi dist/common_util_py-0.0.1.tar.gz
```
## Test install
Install from Test PyPI
```sh
$ pip install --index-url https://test.pypi.org/simple/ common-util-py
```
Install from Local Distribution.
```sh
$ pip install dist/common_util_py-<version>.tar.gz
```
## Legacy
To generate `requirements.txt` and `requirements-dev.txt` from `pyproject.toml`, run the following command.
```
pip install pip-tools
pip-compile --extra dev pyproject.toml -o requirements-dev.txt
pip-compile pyproject.toml -o requirements.txt
```
## Tested installation via PyPI on the following Python versions:
| Python Version | tested installed |
| --------------- |:-----------------:|
| 3.9 | Yes |
| 3.10 | Yes |
| 3.11 | Yes |
| 3.12 | Yes |
| 3.13 | Yes |
| 3.14 | Upcoming |
Raw data
{
"_id": null,
"home_page": "https://github.com/jasonwee/common-util-py",
"name": "common-util-py",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Jason Wee <jason@weetech.ch>, Jason Wee <peichieh@gmail.com>",
"keywords": "utilities, common, python, sql, weetech",
"author": "Jason Wee",
"author_email": "Jason Wee <jason@weetech.ch>, Jason Wee <peichieh@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/cb/9f/4a50945c457459e6e5c173200072701c9083a9c97bdf5fae6cf7a857e1cd/common_util_py-0.0.28.tar.gz",
"platform": null,
"description": "## common-util-py\nCommon utilities in Python\n\n## How to install\nThe following commands show how to install `common-util-py` using pip within a Python virtual environment. To see which versions of Python are supported by `common-util-py`, see (here)[#tested-installation-via-pypi-on-the-following-python-versions].\n```sh\n$ python3 -m venv py313_env\n$ source py313_env/bin/activate\n$ pip install .[dev]\n$ # or\n$ virtualenv --python=/usr/bin/python3 py39_env\n$ source env_py39/bin/activate\n$ pip install .\n$ # or\n$ python3.8 -m venv env_py38\n$ source env_py38/bin/activate\n$ pip install .\n```\n\n## How to build\nTo create a source distribution, run the following commands:\n```sh\n$ source py313_env/bin/activate\n$ python3 setup.py --help-commands\n$ python3 setup.py sdist\n```\n\n## How to test\nInitially we were using `nosetests` and have since migrated to `pytest`.\n```sh\n$ # deprecated\n$ # python setup.py test\n$ # python setup.py nosetests\n$ # nose is replace by pytest since python3.13\n$ pytest\n```\n\nread more [here](https://nose.readthedocs.io/en/latest/setuptools_integration.html)\n\n\n* https://www.codingforentrepreneurs.com/blog/pipenv-virtual-environments-for-python/\n* https://packaging.python.org/\n* https://betterscientificsoftware.github.io/python-for-hpc/tutorials/python-pypi-packaging/\n\n## How to upload to PyPI (Python Package Index)\nFirst, build a source distribution and then install the `twine` package.\n```sh\n$ python setup.py sdist\n$ pip install twine\n```\nThen, use twine to upload the package to PyPI.\n```sh\n$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*\n```\nor\n```sh\n$ twine upload --config-file ~/.pypirc -r testpypi dist/common_util_py-0.0.1.tar.gz\n```\n\n## Test install\nInstall from Test PyPI\n```sh\n$ pip install --index-url https://test.pypi.org/simple/ common-util-py\n```\nInstall from Local Distribution.\n```sh\n$ pip install dist/common_util_py-<version>.tar.gz\n```\n\n## Legacy\nTo generate `requirements.txt` and `requirements-dev.txt` from `pyproject.toml`, run the following command.\n```\npip install pip-tools\npip-compile --extra dev pyproject.toml -o requirements-dev.txt\npip-compile pyproject.toml -o requirements.txt\n```\n\n## Tested installation via PyPI on the following Python versions:\n| Python Version | tested installed |\n| --------------- |:-----------------:|\n| 3.9 | Yes |\n| 3.10 | Yes |\n| 3.11 | Yes |\n| 3.12 | Yes |\n| 3.13 | Yes |\n| 3.14 | Upcoming |\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Common Python utility modules",
"version": "0.0.28",
"project_urls": {
"Documentation": "https://github.com/jasonwee/common-util-py",
"Homepage": "https://www.weetech.ch",
"Source": "https://github.com/jasonwee/common-util-py",
"Tracker": "https://github.com/jasonwee/common-util-py/issues"
},
"split_keywords": [
"utilities",
" common",
" python",
" sql",
" weetech"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "51b4e641c839dad8382f362204b69146c97ffe932a8494d42cacd1ea6ca65576",
"md5": "5dc82d74fabb14de36623b871c6caf48",
"sha256": "1f32b43850b28070137fda5753c0660664c3c1db876e4f36b5e7b940aae0760c"
},
"downloads": -1,
"filename": "common_util_py-0.0.28-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5dc82d74fabb14de36623b871c6caf48",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 26856,
"upload_time": "2025-08-08T13:39:54",
"upload_time_iso_8601": "2025-08-08T13:39:54.523695Z",
"url": "https://files.pythonhosted.org/packages/51/b4/e641c839dad8382f362204b69146c97ffe932a8494d42cacd1ea6ca65576/common_util_py-0.0.28-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "cb9f4a50945c457459e6e5c173200072701c9083a9c97bdf5fae6cf7a857e1cd",
"md5": "5abc66687fa9f1c2712b57badd39a8fc",
"sha256": "cee4c02b73d031e19d20ca2ee82da4de53b3c6cc8ca64266ebaccdafe2b97eab"
},
"downloads": -1,
"filename": "common_util_py-0.0.28.tar.gz",
"has_sig": false,
"md5_digest": "5abc66687fa9f1c2712b57badd39a8fc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 22108,
"upload_time": "2025-08-08T13:39:55",
"upload_time_iso_8601": "2025-08-08T13:39:55.635412Z",
"url": "https://files.pythonhosted.org/packages/cb/9f/4a50945c457459e6e5c173200072701c9083a9c97bdf5fae6cf7a857e1cd/common_util_py-0.0.28.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-08 13:39:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jasonwee",
"github_project": "common-util-py",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "setuptools",
"specs": []
},
{
"name": "twine",
"specs": []
},
{
"name": "SQLAlchemy",
"specs": []
},
{
"name": "PyMySQL",
"specs": []
},
{
"name": "mysql-connector",
"specs": []
}
],
"lcname": "common-util-py"
}