This is a Python “util” submodule with code that I habitually use in so many projects that I decided to split it off into its own git archive.
This code is not a Python module. The idea is to add it as a submodule to your own Python code:
git submodule add git@github.com:smurfix/util-py.git src/your_module/util
and then relative-import:
from .util import attrdict
Feel free to extend and embrace. Patches welcome.
Features
A few. Read the code, I didn’t get around to documenting all of that yet.
times
This code implements calculating an offset to an under-specified future time. Like “how long until next Wednesday 8 am”?
The code also supports the inverse question, as in “how long until it’s no longer Wednesday 8 am”.
License
No restrictions. CC0 / public domain / MIT / GPLv3 / whatever, as long as you don’t want anybody (i.e. the author(s)) to pay for the effects of any bugs, features or “features” which this code might or might not have.
Please contribute any enhancements.
Dependencies
A few. Notable:
anyio, version 3. Required for ValueEvent, spawn (obviously) and as_service.
ruyaml. This is a fork of ruamel.yaml which is a fork of pyyaml. Fixes some bugs and has a more reasonable API. Required for yload/yprint/yformat.
msgpack, obviously required for pack/unpack and MsgReader/MsgWriter.
asyncclick, required for main_/wrap_main.
Release files for moat-util 0.24.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| moat-util-0.24.8.tar.gz | 32.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| moat_util-0.24.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 65.4 kB
Release files / moat-util-0.24.8.tar.gz
| Download URL | moat-util-0.24.8.tar.gz |
|---|---|
| Size | 32.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac9f629238701a4d86db845e71eb425b78b32ec3ac3f9c0737d77459300c7896
|
|
BLAKE2b-256 checksum How to use checksums |
b66f91b62bde806daabd4f84bb0f3f282625bf0b2488e95eed2c67d2172decee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/63.2.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.10.5
|
Release files / moat_util-0.24.8-py3-none-any.whl
| Download URL | moat_util-0.24.8-py3-none-any.whl |
|---|---|
| Size | 33.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85910c58968f4f4515db21795deb6eb7c0e20482ab24dbc3bf2fcb1380d94382
|
|
BLAKE2b-256 checksum How to use checksums |
0fd29302e51ce0afa68de8d02dde25bf5a693ea80e6057711f4e62645799bb63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/63.2.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.10.5
|