tcrutils


Nametcrutils JSON
Version 13.0.9 PyPI version JSON
download
home_pagehttps://github.com/anamoyee/TCRUtils
SummaryUseful stuff for TCR projects!
upload_time2024-12-03 21:31:59
maintainerNone
docs_urlNone
authoranamoyee
requires_python>=3.11.0
licenseGPL-3.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TCRUtils - Utility Package for TCR Projects

`TCRUtils` is a collection of utility functions, classes, and helpers designed to streamline various tasks in TCR projects. Below is a brief overview of some of the key features.

## Installation and Importing

Importing '''convention''' (it's just me using it...)
```python
import tcrutils as tcr
```

Star-importng is supported (overriden) but you'd be a lot better off by just importng by name or the module itself not to litter your global scope with all this garbage
```python
from tcrutils import timestr
```

## Featured Features (yipee :3)

- **`fmt_iterable(x: LITERALLY_ANY_OBJECT_TYPE)`**: Pretty-formats any python object that i have thought of for easier readability, even some third-party-library ones.
- **`console`, or just `tcr.c`**: Provides [hikari](https://pypi.org/project/hikari/)-styled logging combined with the above fmt_iterable to pretty-print your debugging! Yay!
- **`TStr`**: Convert between seconds and readable timestrs. Now with timezones! for example `str("1h")` -> `int(3600)`.
- **`ShelveDB`**: Quickly and easily set up a dict-based, python built-in shelve module's shelf - a python dictionary able to contain arbitrary python types that persists on restart.

### Iterable Helpers
- **`Or`**: Returns the first element of the tuple (arg, *args) that does not equal the supplied (`none`) variable, by default None. This is different from just doing `x or y or y` because it does not fail on falsey values, just the ones that are specified to be equal to the noney value
- **`batched`**: py3.12 itertools.batched() in py3.11 with some extra features!
- **`cut_at`**: Cut a string (or an iterable) with a specified suffix for example i'm running out of space on this markdown line so i will use th...
- **`shuffled`**: Returns a shuffled version of an iterable. So you dont have to do `random.shuffle(x)` which does not return the shuffled

### String and Formatting Utilities
- **`commafy`**: Adds commas to numbers for better readability.
- **`apostrophe_s`**: Handles the correct placement of apostrophes if the word ends with s for example `"peoples'"` and `"mike's"` (not `"peoples's"`).

### Error Handling
- **`extract_error` and `extract_traceback`**: Extracts the error object's name and the error message (or the traceback's contents).

### Decorators
- **`@autorun`**: Automatically runs the the function whenever its definition is completed.
- **`@timeit`**: Measures the execution time of a function and prints it to the screen.

### Miscellaneous
- **`insist`**: Prompts user input with a customizable insistence until a valid answer is provided, for example you can keep input()ing the user if they provided invalid value for an integer field.

This package includes many other useful utilities, go look for yourself if you want...

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/anamoyee/TCRUtils",
    "name": "tcrutils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11.0",
    "maintainer_email": null,
    "keywords": null,
    "author": "anamoyee",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/f1/8a/20e0f1233e456c5b564c9e177ba07516f7a7cd88b39a81587e8ddd3b883d/tcrutils-13.0.9.tar.gz",
    "platform": null,
    "description": "# TCRUtils - Utility Package for TCR Projects\n\n`TCRUtils` is a collection of utility functions, classes, and helpers designed to streamline various tasks in TCR projects. Below is a brief overview of some of the key features.\n\n## Installation and Importing\n\nImporting '''convention''' (it's just me using it...)\n```python\nimport tcrutils as tcr\n```\n\nStar-importng is supported (overriden) but you'd be a lot better off by just importng by name or the module itself not to litter your global scope with all this garbage\n```python\nfrom tcrutils import timestr\n```\n\n## Featured Features (yipee :3)\n\n- **`fmt_iterable(x: LITERALLY_ANY_OBJECT_TYPE)`**: Pretty-formats any python object that i have thought of for easier readability, even some third-party-library ones.\n- **`console`, or just `tcr.c`**: Provides [hikari](https://pypi.org/project/hikari/)-styled logging combined with the above fmt_iterable to pretty-print your debugging! Yay!\n- **`TStr`**: Convert between seconds and readable timestrs. Now with timezones! for example `str(\"1h\")` -> `int(3600)`.\n- **`ShelveDB`**: Quickly and easily set up a dict-based, python built-in shelve module's shelf - a python dictionary able to contain arbitrary python types that persists on restart.\n\n### Iterable Helpers\n- **`Or`**: Returns the first element of the tuple (arg, *args) that does not equal the supplied (`none`) variable, by default None. This is different from just doing `x or y or y` because it does not fail on falsey values, just the ones that are specified to be equal to the noney value\n- **`batched`**: py3.12 itertools.batched() in py3.11 with some extra features!\n- **`cut_at`**: Cut a string (or an iterable) with a specified suffix for example i'm running out of space on this markdown line so i will use th...\n- **`shuffled`**: Returns a shuffled version of an iterable. So you dont have to do `random.shuffle(x)` which does not return the shuffled\n\n### String and Formatting Utilities\n- **`commafy`**: Adds commas to numbers for better readability.\n- **`apostrophe_s`**: Handles the correct placement of apostrophes if the word ends with s for example `\"peoples'\"` and `\"mike's\"` (not `\"peoples's\"`).\n\n### Error Handling\n- **`extract_error` and `extract_traceback`**: Extracts the error object's name and the error message (or the traceback's contents).\n\n### Decorators\n- **`@autorun`**: Automatically runs the the function whenever its definition is completed.\n- **`@timeit`**: Measures the execution time of a function and prints it to the screen.\n\n### Miscellaneous\n- **`insist`**: Prompts user input with a customizable insistence until a valid answer is provided, for example you can keep input()ing the user if they provided invalid value for an integer field.\n\nThis package includes many other useful utilities, go look for yourself if you want...\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "Useful stuff for TCR projects!",
    "version": "13.0.9",
    "project_urls": {
        "Homepage": "https://github.com/anamoyee/TCRUtils",
        "Repository": "https://github.com/anamoyee/TCRUtils"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3201ccfe3bac89a32082dae066fae6d38981a1a59e0d2a0899935313f7e5d819",
                "md5": "a51e70edcd28a9c383ec5a5737dbe669",
                "sha256": "59ac2fae5b0bba88c7262b20f196b860eca45c898dffa529d8acebcb773f34c2"
            },
            "downloads": -1,
            "filename": "tcrutils-13.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a51e70edcd28a9c383ec5a5737dbe669",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11.0",
            "size": 130453,
            "upload_time": "2024-12-03T21:31:57",
            "upload_time_iso_8601": "2024-12-03T21:31:57.447695Z",
            "url": "https://files.pythonhosted.org/packages/32/01/ccfe3bac89a32082dae066fae6d38981a1a59e0d2a0899935313f7e5d819/tcrutils-13.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f18a20e0f1233e456c5b564c9e177ba07516f7a7cd88b39a81587e8ddd3b883d",
                "md5": "94efeb869b908e762c9fc9dda36f0eae",
                "sha256": "d25f36a167708856b769a7e944ff37462a50383cccce29abc893a3258ac31123"
            },
            "downloads": -1,
            "filename": "tcrutils-13.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "94efeb869b908e762c9fc9dda36f0eae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11.0",
            "size": 114393,
            "upload_time": "2024-12-03T21:31:59",
            "upload_time_iso_8601": "2024-12-03T21:31:59.623180Z",
            "url": "https://files.pythonhosted.org/packages/f1/8a/20e0f1233e456c5b564c9e177ba07516f7a7cd88b39a81587e8ddd3b883d/tcrutils-13.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-03 21:31:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "anamoyee",
    "github_project": "TCRUtils",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tcrutils"
}
        
Elapsed time: 0.72928s