Skip to main content

No project description provided

Project description

vayu

Async-first Python utility library for caching, time operations, parallel execution, distributed locks, and more.

pip install vayulib

What's inside

Module Highlights
cache @cached decorator with TTL, FileCache, MemoryCache, pluggable serializers
aio grab_all_urls() with rate limiting, sleep_until_signal(), shutdown signal helpers
time TimeWindow, timeit, to_human_readable_time, timezone-aware datetime helpers
common Interval with set operations, @retry with exponential backoff, add_jitter, group
parallel ParallelRunner over thread/process pools with progress tracking, thread-safe collections
lock Redis-based LongLivedLock (auto-renewing), RedisSemaphore
pandas_utils slice_frame, select_frame, split_frame, concat_frame_from_dir
log Global logger L with L.i, L.d, L.e, L.w, L.c shorthands

Quick examples

from vayu.cache import FileCache, Pickler
from datetime import timedelta

cache = FileCache("/tmp/my_cache", Pickler())

@cache.cached(ttl=timedelta(hours=1))
async def fetch_data(url):
    ...
from vayu.common import retry

@retry(ConnectionError, tries=3, delay=1, backoff=2)
async def call_api():
    ...
from vayu.time import TimeWindow

window = TimeWindow.behind(hours=6)  # last 6 hours
print(window.duration, window.start_ms, window.end_ms)

Development

uv sync                      # install dependencies
uv run pytest tests/         # run tests
uv run black vayu/ tests/    # format

Release process

  1. Bump version in pyproject.toml
  2. Merge to main
  3. The publish workflow automatically tags and publishes to PyPI if the version is new

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

vayulib-0.5.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vayulib-0.5.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file vayulib-0.5.0.tar.gz.

File metadata

  • Download URL: vayulib-0.5.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vayulib-0.5.0.tar.gz
Algorithm Hash digest
SHA256 38f79acf1215b7e94ede72785de82bb7e9e1d0f192ddfa27812c71067041ed99
MD5 7a7a5872256c9f3c9f52128978059f8d
BLAKE2b-256 57837598b175e9372738886e661c0d9d8009cb9d0a9a4a510dcbf040dcca7def

See more details on using hashes here.

File details

Details for the file vayulib-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: vayulib-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vayulib-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09e66f673a4c4ee2097fca08ecc943b36ea93ebc105adfd4ceb668aead3f9640
MD5 65f1940a77314e7043476c6561cdcefa
BLAKE2b-256 dce63565ccd5917218f21f21de7ef2f020a9cf74acc7aa458c42d6fe6e4d0e5e

See more details on using hashes here.

Supported by

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