Yet another python utilities, with the goal of collecting useful bicycles and crutches in one place ;).
Project description
pure-utils
Yet another python utilities, with the goal of collecting useful bicycles and crutches in one place ;).
Main principles:
- No third party dependencies (standart library only).
- Mostly pure functions without side effects.
- Interfaces with type annotations.
- Comprehensive documentation with examples of use.
- Full test coverage.
For detail information read the doc.
Available utilities
- common - Utilities for working with data containers (lists, dictionaries, tuples, sets, etc.).
- Singleton - A metaclass that implements the singleton pattern for inheritors.
- containers - The common purpose utilities.
- bisect - Bisect the list into two parts/halves based on the number of elements.
- first - Get the value of the first element from a homogeneous collection.
- flatten - Make the iterated collection a flat (single nesting level).
- get_or_else - Get value of element, and if it is missing, return the default value.
- omit - Omit key-value pairs from the source dictionary, by keys sequence.
- paginate - Split the collection into page(s) according to the specified limit.
- pick - Pick key-value pairs from the source dictionary, by keys sequence.
- symmdiff - Obtain the symmetric difference of two sequences.
- datetime - Utilities for working with datetime objects.
- apply_tz - Apply timezone context to datetime object.
- iso2format - Convert ISO-8601 datetime string into a string of specified format.
- iso2dmy - Convert ISO-8601 datetime string into a string of DMY (DD.MM.YYYY) format.
- iso2ymd - Convert ISO-8601 datetime string into a string of YMD (YYYY-MM-DD) format.
- round_by - Round datetime, discarding excessive precision.
- debug - Utilities for debugging and development.
- around - Add additional behavior before and after execution of decorated function.
- caller - Get the name of calling function/method (from current function/method context).
- deltatime - Measure execution time of decorated function and print it to log.
- profileit - Profile decorated function being with 'cProfile'.
- profiler - Helper classes for working with the cProfile.
- Profiler - A class provides a simple interface for profiling code.
- strings - Utilities for working with strings.
License
MIT License.
Copyright (c) 2024 Peter Bro <p3t3rbr0@gmail.com || peter@peterbro.su>
See LICENSE file for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pure_utils-0.5.0.tar.gz
(21.3 kB
view hashes)
Built Distribution
pure_utils-0.5.0-py3-none-any.whl
(14.2 kB
view hashes)
Close
Hashes for pure_utils-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57eaa388ed10cc070db863ce54e3ce7bba2d7c4a369fd3b6263c8c555597fe28 |
|
MD5 | 553ba2d23acd4582830cdab5d1d93b2c |
|
BLAKE2b-256 | 5cd716c61cbf62b13e0d0dc279bdf36625ee5792f2619c8f974b0eed00d865a2 |