Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

TCRUtils - yet another utilities package

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

  • 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-styled logging combined with the above fmt_iterable to pretty-print your debugging! Yay!
  • timestr2: Convert between seconds and readable timestrs. Now with timezones! for example "1h" -> 3600.
  • ShelveDB & sdb2: 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

  • @test: Prints a nice block separator containing formatted name of the function before executing
  • @timeit: Measures the execution time of a function and prints it afterwards.

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...

Metadata

Release files for tcrutils 13.1.39

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tcrutils 13.1.39
File Size Uploaded Provenance Actions
tcrutils-13.1.39.tar.gz 145.4 kB Without provenance Details for tcrutils-13.1.39.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tcrutils 13.1.39
File Interpreter ABI Platform Actions
tcrutils-13.1.39-py3-none-any.whl Python 3 none any Details for tcrutils-13.1.39-py3-none-any.whl

Total release size: 254.7 kB

Release files / tcrutils-13.1.39.tar.gz

Download URL tcrutils-13.1.39.tar.gz
Size 145.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6f0e2a18bb13121cf1cdd041dadbb59d0ffe32f5700c3ef053c0510c6482239d
BLAKE2b-256 checksum
How to use checksums
7c428fbd7c2a2ce61a4a1ba33ef4eef521d5666450ef63beed0b44721c7201b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.2

Release files / tcrutils-13.1.39-py3-none-any.whl

Download URL tcrutils-13.1.39-py3-none-any.whl
Size 109.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b9add0e0e3d13ef3aabe6cc267778e49e3cb14715e70ac8a7f8499740a096ba
BLAKE2b-256 checksum
How to use checksums
7ce2e70abe7f3ad4f04162339f81379c0a07c7729f8f9bf9b96a3e9e804ca2fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.2

Security for tcrutils 13.1.39

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page