# py-utls
_Utilities for Python_
![PyPI](https://img.shields.io/pypi/v/py-utls)
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/cyrildever/py-utls)
![GitHub last commit](https://img.shields.io/github/last-commit/cyrildever/py-utls)
![GitHub issues](https://img.shields.io/github/issues/cyrildever/py-utls)
![GitHub](https://img.shields.io/github/license/cyrildever/py-utls)
`py-utls` is a small Python repository where I put all the useful stuff I regularly need in my projects. \
Feel free to use at your discretion with the appropriate license mentions.
_NB: I've developed the same kind of libraries for both [Go](https://github.com/cyrildever/go-utls) and [TypeScript](https://www.npmjs.com/package/ts-utls)._
### Usage
```console
pip install py-utls
```
This repository contains the following modules:
* `hex`:
- `from_hex`: builds the byte array from a string;
- `to_hex`: creates the hexadecimal representation of a byte array;
* `list`:
- `chunk`: split a list into chunks of a maximum size;
- `flatten`: transforms a list of list of items to a list of items.
```python
from pyutls.hex import from_hex, to_hex
from pyutls.list import chunk, flatten
# Hex utilities
barray = from_hex('1234abcd')
hex_string = to_hex(barray)
assertEqual(hex_string == '1234abcd')
# Flatten a list of list
chunks = chunk(some_list, size)
flat_list = flatten(chunks)
assertListEqual(flat_list == some_list)
```
### Tests
```console
$ python3 -m unittest discover
```
### License
These modules are distributed under a MIT license. \
See the [LICENSE](LICENSE) file.
<hr />
© 2022-2023 Cyril Dever. All rights reserved.
Raw data
{
"_id": null,
"home_page": "https://github.com/cyrildever/py-utls",
"name": "py-utls",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "python,utils,chunks,flatten,hexadecimal",
"author": "Cyril Dever",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/6a/f0/446fcf241e5644e3f6eda162e96e7ab7b7ffd83f5afd06e27526b518036b/py-utls-0.1.6.tar.gz",
"platform": null,
"description": "# py-utls\n_Utilities for Python_\n\n![PyPI](https://img.shields.io/pypi/v/py-utls)\n![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/cyrildever/py-utls)\n![GitHub last commit](https://img.shields.io/github/last-commit/cyrildever/py-utls)\n![GitHub issues](https://img.shields.io/github/issues/cyrildever/py-utls)\n![GitHub](https://img.shields.io/github/license/cyrildever/py-utls)\n\n`py-utls` is a small Python repository where I put all the useful stuff I regularly need in my projects. \\\nFeel free to use at your discretion with the appropriate license mentions.\n\n_NB: I've developed the same kind of libraries for both [Go](https://github.com/cyrildever/go-utls) and [TypeScript](https://www.npmjs.com/package/ts-utls)._\n\n### Usage\n\n```console\npip install py-utls\n```\n\nThis repository contains the following modules:\n* `hex`:\n - `from_hex`: builds the byte array from a string;\n - `to_hex`: creates the hexadecimal representation of a byte array;\n* `list`:\n - `chunk`: split a list into chunks of a maximum size;\n - `flatten`: transforms a list of list of items to a list of items.\n\n\n```python\nfrom pyutls.hex import from_hex, to_hex\nfrom pyutls.list import chunk, flatten\n\n# Hex utilities\nbarray = from_hex('1234abcd')\nhex_string = to_hex(barray)\nassertEqual(hex_string == '1234abcd')\n\n# Flatten a list of list\nchunks = chunk(some_list, size)\nflat_list = flatten(chunks)\nassertListEqual(flat_list == some_list)\n```\n\n\n### Tests\n\n```console\n$ python3 -m unittest discover\n```\n\n\n### License\n\nThese modules are distributed under a MIT license. \\\nSee the [LICENSE](LICENSE) file.\n\n\n<hr />\n© 2022-2023 Cyril Dever. All rights reserved.\n",
"bugtrack_url": null,
"license": "",
"summary": "Utilities for Python",
"version": "0.1.6",
"project_urls": {
"Bug Tracker": "https://github.com/cyrildever/py-utls/issues",
"Homepage": "https://github.com/cyrildever/py-utls"
},
"split_keywords": [
"python",
"utils",
"chunks",
"flatten",
"hexadecimal"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a9b7e97bafbe39986c4286d4dcc65da3b2f1d0514a11536c0e88f8811ce6b8cd",
"md5": "98aa5c2e9bdeebba40b4b24c3671b0c2",
"sha256": "f11b266fbc72c0b16fefa0f762aba463decfd141b66e9b5d0dbda1dee3491f49"
},
"downloads": -1,
"filename": "py_utls-0.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "98aa5c2e9bdeebba40b4b24c3671b0c2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 3583,
"upload_time": "2023-09-29T08:05:20",
"upload_time_iso_8601": "2023-09-29T08:05:20.847399Z",
"url": "https://files.pythonhosted.org/packages/a9/b7/e97bafbe39986c4286d4dcc65da3b2f1d0514a11536c0e88f8811ce6b8cd/py_utls-0.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6af0446fcf241e5644e3f6eda162e96e7ab7b7ffd83f5afd06e27526b518036b",
"md5": "169320d0de8fb2563f1245e4b324a234",
"sha256": "a702db12ea70dbb9ef88d3fcac86ac4d7427929142038c6528cb0bd0773f1ab9"
},
"downloads": -1,
"filename": "py-utls-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "169320d0de8fb2563f1245e4b324a234",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3753,
"upload_time": "2023-09-29T08:05:22",
"upload_time_iso_8601": "2023-09-29T08:05:22.156972Z",
"url": "https://files.pythonhosted.org/packages/6a/f0/446fcf241e5644e3f6eda162e96e7ab7b7ffd83f5afd06e27526b518036b/py-utls-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-29 08:05:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cyrildever",
"github_project": "py-utls",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "py-utls"
}