kajihs_utils


Namekajihs_utils JSON
Version 0.4.2 PyPI version JSON
download
home_pageNone
SummaryFully typed, plausibly practical, and remarkably random utilities for me—and maybe for you too.
upload_time2024-12-20 17:03:50
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseMIT License Copyright (c) 2024, Kajih <itskajih@gmail.com> 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 loguru matplotlib numpy pyplot python tools utils
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Build][github-ci-image]][github-ci-link]
[![Coverage Status][codecov-image]][codecov-link]
[![PyPI Version][pypi-image]][pypi-link]
[![PyPI - Python Version][python-image]][pypi-link]
![License][license-image]

# Kajihs Utils

Fully typed, plausibly practical, and remarkably random utilities for me—and maybe for you too.

## ⬇️ Installation

You can install **kajihs_utils** via pip:

```bash
pip install kajihs-utils
```

## 🏃 Getting Started

```python:dev/readme_snippets/formatted/features_demo.py
from kajihs_utils import batch, get_first
from kajihs_utils.loguru import prompt, setup_logging
from kajihs_utils.numpy_utils import find_closest

# Get first key existing in a dict:
d = {"a": 1, "b": 2, "c": 3}
print(get_first(d, ["x", "a", "b"]))  # Output: 1

# Batch a sequence:
seq = list(range(10))
print(list(batch(seq, 3)))  # Output: [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]

# === Loguru features ===
# Better logged and formatted prompts
prompt("Enter a number")  

# Simply setup well formatted logging in files and console
setup_logging(prefix="app", log_dir="logs")

# === Numpy features ===
import numpy as np

x = np.array([[0, 0], [10, 10], [20, 20]])
print(find_closest(x, [[-1, 2], [15, 12]]))  # Output: [0 1]
```

## 🧾 License

[MIT license](LICENSE)

<!-- Links -->
[github-ci-image]: https://github.com/Kajiih/kajihs_utils/actions/workflows/build.yml/badge.svg?branch=main
[github-ci-link]: https://github.com/Kajiih/kajihs_utils/actions?query=workflow%3Abuild+branch%3Amain

[codecov-image]: https://img.shields.io/codecov/c/github/Kajiih/kajihs_utils/main.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333
[codecov-link]: https://codecov.io/github/Kajiih/kajihs_utils

[pypi-image]: https://img.shields.io/pypi/v/kajihs-utils.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333
[pypi-link]: https://pypi.python.org/pypi/kajihs-utils

[python-image]: https://img.shields.io/pypi/pyversions/kajihs-utils?logo=python&logoColor=aaaaaa&labelColor=333333
[license-image]: https://img.shields.io/badge/license-MIT_license-blue.svg?labelColor=333333

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "kajihs_utils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "loguru, matplotlib, numpy, pyplot, python, tools, utils",
    "author": null,
    "author_email": "Kajih <itskajih@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/85/23/5f33ae6e95cf84c142862fd6ca47b1825dba9dc690117b6f513ed188b077/kajihs_utils-0.4.2.tar.gz",
    "platform": null,
    "description": "[![Build][github-ci-image]][github-ci-link]\n[![Coverage Status][codecov-image]][codecov-link]\n[![PyPI Version][pypi-image]][pypi-link]\n[![PyPI - Python Version][python-image]][pypi-link]\n![License][license-image]\n\n# Kajihs Utils\n\nFully typed, plausibly practical, and remarkably random utilities for me\u2014and maybe for you too.\n\n## \u2b07\ufe0f Installation\n\nYou can install **kajihs_utils** via pip:\n\n```bash\npip install kajihs-utils\n```\n\n## \ud83c\udfc3 Getting Started\n\n```python:dev/readme_snippets/formatted/features_demo.py\nfrom kajihs_utils import batch, get_first\nfrom kajihs_utils.loguru import prompt, setup_logging\nfrom kajihs_utils.numpy_utils import find_closest\n\n# Get first key existing in a dict:\nd = {\"a\": 1, \"b\": 2, \"c\": 3}\nprint(get_first(d, [\"x\", \"a\", \"b\"]))  # Output: 1\n\n# Batch a sequence:\nseq = list(range(10))\nprint(list(batch(seq, 3)))  # Output: [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]\n\n# === Loguru features ===\n# Better logged and formatted prompts\nprompt(\"Enter a number\")  \n\n# Simply setup well formatted logging in files and console\nsetup_logging(prefix=\"app\", log_dir=\"logs\")\n\n# === Numpy features ===\nimport numpy as np\n\nx = np.array([[0, 0], [10, 10], [20, 20]])\nprint(find_closest(x, [[-1, 2], [15, 12]]))  # Output: [0 1]\n```\n\n## \ud83e\uddfe License\n\n[MIT license](LICENSE)\n\n<!-- Links -->\n[github-ci-image]: https://github.com/Kajiih/kajihs_utils/actions/workflows/build.yml/badge.svg?branch=main\n[github-ci-link]: https://github.com/Kajiih/kajihs_utils/actions?query=workflow%3Abuild+branch%3Amain\n\n[codecov-image]: https://img.shields.io/codecov/c/github/Kajiih/kajihs_utils/main.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333\n[codecov-link]: https://codecov.io/github/Kajiih/kajihs_utils\n\n[pypi-image]: https://img.shields.io/pypi/v/kajihs-utils.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333\n[pypi-link]: https://pypi.python.org/pypi/kajihs-utils\n\n[python-image]: https://img.shields.io/pypi/pyversions/kajihs-utils?logo=python&logoColor=aaaaaa&labelColor=333333\n[license-image]: https://img.shields.io/badge/license-MIT_license-blue.svg?labelColor=333333\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024, Kajih <itskajih@gmail.com>\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "Fully typed, plausibly practical, and remarkably random utilities for me\u2014and maybe for you too.",
    "version": "0.4.2",
    "project_urls": {
        "Issues": "https://github.com/Kajiih/kajihs_utils/issues",
        "Repository": "https://github.com/Kajiih/kajihs_utils"
    },
    "split_keywords": [
        "loguru",
        " matplotlib",
        " numpy",
        " pyplot",
        " python",
        " tools",
        " utils"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b04f7ccfabc5b9c32144464a21fbdbffe70bee1e66d29cd5301971219126b605",
                "md5": "c60806871f5bfbdd22f3de9b63c3f468",
                "sha256": "33253efd1f48c6cc9dc50fa2c63b8f38786cc8876ef470daf38d3364b6aad0eb"
            },
            "downloads": -1,
            "filename": "kajihs_utils-0.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c60806871f5bfbdd22f3de9b63c3f468",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 12160,
            "upload_time": "2024-12-20T17:03:52",
            "upload_time_iso_8601": "2024-12-20T17:03:52.425555Z",
            "url": "https://files.pythonhosted.org/packages/b0/4f/7ccfabc5b9c32144464a21fbdbffe70bee1e66d29cd5301971219126b605/kajihs_utils-0.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "85235f33ae6e95cf84c142862fd6ca47b1825dba9dc690117b6f513ed188b077",
                "md5": "507e59ec6b16960526b62508d9aca568",
                "sha256": "ae83e5e8142872ef578467525d546a758b3a1ac7af4725bc3a94ac35da782c96"
            },
            "downloads": -1,
            "filename": "kajihs_utils-0.4.2.tar.gz",
            "has_sig": false,
            "md5_digest": "507e59ec6b16960526b62508d9aca568",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 97202,
            "upload_time": "2024-12-20T17:03:50",
            "upload_time_iso_8601": "2024-12-20T17:03:50.261340Z",
            "url": "https://files.pythonhosted.org/packages/85/23/5f33ae6e95cf84c142862fd6ca47b1825dba9dc690117b6f513ed188b077/kajihs_utils-0.4.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-20 17:03:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Kajiih",
    "github_project": "kajihs_utils",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "kajihs_utils"
}
        
Elapsed time: 0.41303s