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 - The common purpose utilities.
- Singleton - A metaclass that implements the singleton pattern for inheritors.
- containers - Utilities for working with data containers (lists, dictionaries, tuples, sets, etc.).
- bisect(collection, /) - Bisect the list into two parts/halves based on the number of elements.
- first(collection, /) - Get the value of the first element from a homogeneous collection.
- flatten(collection, /) - Make the iterated collection a flat (single nesting level).
- get_or_else(collection, index[, default]) - Get value of element, and if it is missing, return the default value.
- omit(container, keys, /) - Omit key-value pairs from the source dictionary, by keys sequence.
- paginate(collection, /, *, size) - Split the collection into page(s) according to the specified limit.
- pick(container, keys, /) - Pick key-value pairs from the source dictionary, by keys sequence.
- symmdiff(s1, s2, /) - Obtain the symmetric difference of two sequences.
- unpack(container, attributes, /) - Unpack the values of container object into separate variables.
- debug - Utilities for debugging and development.
- around(*[, before, after]) - Add additional behavior before and after execution of decorated function.
- caller(*[, at_frame]) - Get the name of calling function/method (from current function/method context).
- deltatime(*[, logger]) - Measure execution time of decorated function and print it to log.
- profileit(*[, logger, stack_size]) - 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.
- times - Utilities for working with datetime objects.
- apply_tz(dt[, tz]) - Apply timezone context to datetime object.
- iso2format(isostr, fmt, /) - Convert ISO-8601 datetime string into a string of specified format.
- iso2dmy(isostr, /) - Convert ISO-8601 datetime string into a string of DMY (DD.MM.YYYY) format.
- iso2ymd(isostr, /) - Convert ISO-8601 datetime string into a string of YMD (YYYY-MM-DD) format.
- round_by(dt, /, *, boundary) - Round datetime, discarding excessive precision.
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.6.0.tar.gz
(22.1 kB
view hashes)
Built Distribution
pure_utils-0.6.0-py3-none-any.whl
(14.8 kB
view hashes)
Close
Hashes for pure_utils-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22a1a6b574cc483dbc6932cf3cbcddd584278dd4a2d1e17c8db1b5927bec29d0 |
|
MD5 | 52d260f1f563b908b629712d85fb3fc4 |
|
BLAKE2b-256 | fc19cefbbdacfb00b7cca32f191429e951e775d4622659118f9902cd72dc521d |