katalytic


Namekatalytic JSON
Version 0.4.0 PyPI version JSON
download
home_page
SummaryWe'll take care of the boilerplate, so you can focus on your problems.
upload_time2023-11-10 12:55:36
maintainer
docs_urlNone
author
requires_python>=3.6
licenseCopyright 2023 - present, Valentin Neagu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords automation high-level metaprogramming
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # katalytic [![version](https://img.shields.io/pypi/v/katalytic)](https://pypi.org/project/katalytic/) [![tests](https://gitlab.com/katalytic/katalytic/badges/main/pipeline.svg?key_text=tests&key_width=38)](https://gitlab.com/katalytic/katalytic/-/commits/main) [![coverage](https://gitlab.com/katalytic/katalytic/badges/main/coverage.svg)](https://gitlab.com/katalytic/katalytic/-/commits/main) [![docs](https://img.shields.io/readthedocs/katalytic.svg)](https://katalytic.readthedocs.io/en/latest/) [![license: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)

**Don't use in production yet.**
I will likely tweak the function names and the default behaviour a few more times.

We'll take care of the boilerplate, so you can **focus on your problems.**

## Installation
```bash
pip install katalytic

# Include plugins with 3rd-party dependencies
pip install katalytic[all]
```

Plugins with 3rd-party dependencies:
- [katalytic-images](https://gitlab.com/katalytic/katalytic-images)

## Features
### data
- Checks for the structure or properties of data structures
- Convert between different data representations
- Sort or apply map recursively on nested data structures
- Positive and negative front detection
- TODO: Link to tocs

```python
>>> detect_fronts_positive('00101101')
[2, 4, 7]

>>> swap_keys_and_values({'a': 1, 'b': 2, 'c': 3})
{1: 'a', 2: 'b', 3: 'c'}

>>> as_list_of_dicts([['b', 'a'], [1, 2], [3, 4]])
[{'b': 1, 'a': 2}, {'b': 3, 'a': 4}]

>>> flatten_recursive([1, [2, [3, 4], 5], 6])
[1, 2, 3, 4, 5, 6]
```

### files
- Atomic operations
- Load and save files with a uniform interface
- Copy, move, and delete files without searching the docs for the right function
- The functions return the same type as the input (`Path` or `str`)
- TODO: Link to tocs

```python
>>> get_files('/home/user/*bash*', prefix=True)
['/home/user/.bash_history', '/home/user/.bash_logout', '/home/user/.bashrc']

>>> get_files('/home/user/*bash*', prefix=False)
['.bash_history', '.bash_logout', '.bashrc']

>>> get_unique_path('{}.csv')
'/tmp/tmp3s0_ltan/1.csv'
```

### maths
- Calculate the L1 and L2 distance between two vectors
- Clip a value to a minimum or maximum
- Convert bounding boxes between different formats
- Calculate the IoU (Intersection Over Union) between bounding boxes
- TODO: Link to tocs
```python
>>> clip(123, 0, 10)
10
>>> clip(-1, 0, 10)
0

>>> convert_bbox([100, 100, 300, 400], 'xyXY', 'xy_wh')
((100, 100), (200, 300))

>>> box_1 = [100, 100, 300, 400]
>>> box_2 = [50, 150, 250, 100]
>>> intersect_bboxes(box_1, 'xyXY', box_2, 'xywh')
(100, 150, 300, 250)

>>> calc_IoU(box_1, 'xyXY', box_2, 'xywh')
0.3076923076923077
```

### metaprogramming
- Access the functions at any depth of the call stack
- TODO: Link to tocs
```python
    >>> def foo():
    ...     caller = reference_caller_function()
    ...     print(f'{caller.__name__}() called foo()')
    ...
    >>> def bar():
    ...     foo()
    ...
    >>> bar()
    bar() called foo()
```

## Roadmap
- decorators
- regexes
- interactive exploration tools/utilities
- maths
- geometry
- data processing
	- images
	- text
	- tabular
	- structured (e.g. list of dicts <-> dict of lists)

# Similar projects
- [boltons](https://github.com/mahmoud/boltons)
  - Boltons is a set of over 230 BSD-licensed, pure-Python utilities in the same spirit as — and yet conspicuously missing from — the standard library
- [more-itertools](https://github.com/more-itertools/more-itertools)
  - Python's itertools library is a gem - you can compose elegant solutions for a variety of problems with the functions it provides. In more-itertools we collect additional building blocks, recipes, and routines for working with Python iterables.
- [dateutil](https://github.com/dateutil/dateutil/)
  - The dateutil module provides powerful extensions to the standard datetime module, available in Python.
- [toolz](https://github.com/pytoolz/toolz)
  - A functional standard library for Python.

## Contributing
We appreciate any form of contribution, including but not limited to:
- **Code contributions**: Enhance our repository with your code and tests.
- **Feature suggestions**: Your ideas can shape the future development of our package.
- **Architectural improvements**: Help us optimize our system's design and API.
- **Bug fixes**: Improve user experience by reporting or resolving issues.
- **Documentation**: Help us maintain clear and up-to-date instructions for users.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "katalytic",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "automation high-level metaprogramming",
    "author": "",
    "author_email": "Valentin Neagu <vali19th@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2d/64/4837b0768db309cd8f4a1f9eb6678914c937f975be7e35921a5acc427065/katalytic-0.4.0.tar.gz",
    "platform": null,
    "description": "# katalytic [![version](https://img.shields.io/pypi/v/katalytic)](https://pypi.org/project/katalytic/) [![tests](https://gitlab.com/katalytic/katalytic/badges/main/pipeline.svg?key_text=tests&key_width=38)](https://gitlab.com/katalytic/katalytic/-/commits/main) [![coverage](https://gitlab.com/katalytic/katalytic/badges/main/coverage.svg)](https://gitlab.com/katalytic/katalytic/-/commits/main) [![docs](https://img.shields.io/readthedocs/katalytic.svg)](https://katalytic.readthedocs.io/en/latest/) [![license: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\n**Don't use in production yet.**\nI will likely tweak the function names and the default behaviour a few more times.\n\nWe'll take care of the boilerplate, so you can **focus on your problems.**\n\n## Installation\n```bash\npip install katalytic\n\n# Include plugins with 3rd-party dependencies\npip install katalytic[all]\n```\n\nPlugins with 3rd-party dependencies:\n- [katalytic-images](https://gitlab.com/katalytic/katalytic-images)\n\n## Features\n### data\n- Checks for the structure or properties of data structures\n- Convert between different data representations\n- Sort or apply map recursively on nested data structures\n- Positive and negative front detection\n- TODO: Link to tocs\n\n```python\n>>> detect_fronts_positive('00101101')\n[2, 4, 7]\n\n>>> swap_keys_and_values({'a': 1, 'b': 2, 'c': 3})\n{1: 'a', 2: 'b', 3: 'c'}\n\n>>> as_list_of_dicts([['b', 'a'], [1, 2], [3, 4]])\n[{'b': 1, 'a': 2}, {'b': 3, 'a': 4}]\n\n>>> flatten_recursive([1, [2, [3, 4], 5], 6])\n[1, 2, 3, 4, 5, 6]\n```\n\n### files\n- Atomic operations\n- Load and save files with a uniform interface\n- Copy, move, and delete files without searching the docs for the right function\n- The functions return the same type as the input (`Path` or `str`)\n- TODO: Link to tocs\n\n```python\n>>> get_files('/home/user/*bash*', prefix=True)\n['/home/user/.bash_history', '/home/user/.bash_logout', '/home/user/.bashrc']\n\n>>> get_files('/home/user/*bash*', prefix=False)\n['.bash_history', '.bash_logout', '.bashrc']\n\n>>> get_unique_path('{}.csv')\n'/tmp/tmp3s0_ltan/1.csv'\n```\n\n### maths\n- Calculate the L1 and L2 distance between two vectors\n- Clip a value to a minimum or maximum\n- Convert bounding boxes between different formats\n- Calculate the IoU (Intersection Over Union) between bounding boxes\n- TODO: Link to tocs\n```python\n>>> clip(123, 0, 10)\n10\n>>> clip(-1, 0, 10)\n0\n\n>>> convert_bbox([100, 100, 300, 400], 'xyXY', 'xy_wh')\n((100, 100), (200, 300))\n\n>>> box_1 = [100, 100, 300, 400]\n>>> box_2 = [50, 150, 250, 100]\n>>> intersect_bboxes(box_1, 'xyXY', box_2, 'xywh')\n(100, 150, 300, 250)\n\n>>> calc_IoU(box_1, 'xyXY', box_2, 'xywh')\n0.3076923076923077\n```\n\n### metaprogramming\n- Access the functions at any depth of the call stack\n- TODO: Link to tocs\n```python\n    >>> def foo():\n    ...     caller = reference_caller_function()\n    ...     print(f'{caller.__name__}() called foo()')\n    ...\n    >>> def bar():\n    ...     foo()\n    ...\n    >>> bar()\n    bar() called foo()\n```\n\n## Roadmap\n- decorators\n- regexes\n- interactive exploration tools/utilities\n- maths\n- geometry\n- data processing\n\t- images\n\t- text\n\t- tabular\n\t- structured (e.g. list of dicts <-> dict of lists)\n\n# Similar projects\n- [boltons](https://github.com/mahmoud/boltons)\n  - Boltons is a set of over 230 BSD-licensed, pure-Python utilities in the same spirit as \u2014 and yet conspicuously missing from \u2014 the standard library\n- [more-itertools](https://github.com/more-itertools/more-itertools)\n  - Python's itertools library is a gem - you can compose elegant solutions for a variety of problems with the functions it provides. In more-itertools we collect additional building blocks, recipes, and routines for working with Python iterables.\n- [dateutil](https://github.com/dateutil/dateutil/)\n  - The dateutil module provides powerful extensions to the standard datetime module, available in Python.\n- [toolz](https://github.com/pytoolz/toolz)\n  - A functional standard library for Python.\n\n## Contributing\nWe appreciate any form of contribution, including but not limited to:\n- **Code contributions**: Enhance our repository with your code and tests.\n- **Feature suggestions**: Your ideas can shape the future development of our package.\n- **Architectural improvements**: Help us optimize our system's design and API.\n- **Bug fixes**: Improve user experience by reporting or resolving issues.\n- **Documentation**: Help us maintain clear and up-to-date instructions for users.\n",
    "bugtrack_url": null,
    "license": "Copyright 2023 - present, Valentin Neagu  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "We'll take care of the boilerplate, so you can focus on your problems.",
    "version": "0.4.0",
    "project_urls": {
        "Changelog": "https://gitlab.com/katalytic/katalytic/-/blob/main/CHANGELOG.md",
        "Homepage": "https://gitlab.com/katalytic/katalytic.git",
        "Repository": "https://gitlab.com/katalytic/katalytic.git"
    },
    "split_keywords": [
        "automation",
        "high-level",
        "metaprogramming"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9779fd15451414ed3922e5c218ca3db703a4ecb10bd6da2c63e8b95533d187f9",
                "md5": "3c67f0b82b4a6651dca5bcd40fb9b41f",
                "sha256": "f455100df9586b21af67983c3c124468865daa7c82c1c5755d3e6bfc6327b94a"
            },
            "downloads": -1,
            "filename": "katalytic-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3c67f0b82b4a6651dca5bcd40fb9b41f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 39980,
            "upload_time": "2023-11-10T12:55:34",
            "upload_time_iso_8601": "2023-11-10T12:55:34.482187Z",
            "url": "https://files.pythonhosted.org/packages/97/79/fd15451414ed3922e5c218ca3db703a4ecb10bd6da2c63e8b95533d187f9/katalytic-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2d644837b0768db309cd8f4a1f9eb6678914c937f975be7e35921a5acc427065",
                "md5": "4c28d36ab184e32e8dd8d2f9bd468f28",
                "sha256": "ff098114dfa8afe0d159631276e1fb51756c0f1a96623c72bac0e3f63de161fd"
            },
            "downloads": -1,
            "filename": "katalytic-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4c28d36ab184e32e8dd8d2f9bd468f28",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 55277,
            "upload_time": "2023-11-10T12:55:36",
            "upload_time_iso_8601": "2023-11-10T12:55:36.634913Z",
            "url": "https://files.pythonhosted.org/packages/2d/64/4837b0768db309cd8f4a1f9eb6678914c937f975be7e35921a5acc427065/katalytic-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-10 12:55:36",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "katalytic",
    "gitlab_project": "katalytic",
    "lcname": "katalytic"
}
        
Elapsed time: 0.13627s