Skip to main content

Utility code for the rest of MoaT

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moat-util-0.30.2.tar.gz (37.5 kB view details)

Uploaded Source

Built Distribution

moat_util-0.30.2-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

Details for the file moat-util-0.30.2.tar.gz.

File metadata

  • Download URL: moat-util-0.30.2.tar.gz
  • Upload date:
  • Size: 37.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for moat-util-0.30.2.tar.gz
Algorithm Hash digest
SHA256 6fed28c33354a4e999aa5ab2414111331eb43d0a90b09f60392c2eab45d633a7
MD5 cf96a98e2f833a8338965217a9cf05b4
BLAKE2b-256 9eaf81c606c0bbff649c593b8fc8da44b858bcad1d63ce1cf3b9bfa5cab2fa00

See more details on using hashes here.

File details

Details for the file moat_util-0.30.2-py3-none-any.whl.

File metadata

  • Download URL: moat_util-0.30.2-py3-none-any.whl
  • Upload date:
  • Size: 38.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for moat_util-0.30.2-py3-none-any.whl
Algorithm Hash digest
SHA256 88307f44f73cb8971ebaed400cbd97c792e92b5842c45825bc6de20e8fe0ca23
MD5 26ba48ea9434cc4abefa98a44b7d556a
BLAKE2b-256 fcb065cef93f1ae098b08fa7594561f548e4f20696ca48ea14b33173f9bad33f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page