Skip to main content

No project description provided

Project description

vayu

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

Docs: vayu.aloktripathy.com

pip install vayulib             # base: cache, time, retry, aio, log, parallel
pip install 'vayulib[data]'     # adds pandas / numpy / plotly helpers

Core names are importable from the top level: from vayu import mem_cached, retry, TimeWindow, L, Interval, FileCache.

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_utils TimeWindow, timeit, to_human_readable_time, timezone-aware datetime helpers
common @retry with exponential backoff, add_jitter, group, camel_or_space_to_snake
interval Interval dataclass with union / intersection / containment algebra
parallel ParallelRunner over thread/process pools with progress tracking, thread-safe collections
pandas_utils (data) slice_frame, select_frame, split_frame, concat_frame_from_dir
plotly_utils (data) Plotly chart helpers
statistics (data) quantile aggregation helper
log Named logger L ("vayu") with L.i, L.d, L.e, L.w, L.c shorthands; opt-in configure_logging() for stdout with timezone-aware timestamps

Modules marked (data) require the vayulib[data] extra.

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 import TimeWindow

window = TimeWindow.behind(hours=6)  # last 6 hours
print(window.duration, window.start_ms, window.end_ms)
# Opt-in pandas monkey-patch (requires vayulib[data])
import vayu

vayu.install_pandas_extensions()  # enables df.select(...) and series.select(...)
# Opt-in logging setup (stdout, timezone-aware timestamps).
# Library imports add no handlers to the root logger.
import vayu

vayu.configure_logging(level="INFO", tz="Asia/Kolkata")

Command-line tool

Base install ships vayu-dir-to-text for concatenating a directory/Git repo into one text file (handy for pasting into LLMs):

vayu-dir-to-text --dir . --extensions .py .md
vayu-dir-to-text --git_url https://github.com/user/repo.git

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.6.1.tar.gz (21.2 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.6.1-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vayulib-0.6.1.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.6.1.tar.gz
Algorithm Hash digest
SHA256 3beaf3f4695e989a3dbbd45f4ba149a07264282b96b97a49c67ba5d023d96f18
MD5 577dccc4933c0655d359c25dc2eb9379
BLAKE2b-256 c26d2f4ef3993b2a3ba78efdd0439cec850b051a111f423c453b4c94c719d5d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vayulib-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a8d43e74dec352b6e905ec69b186606f9087c2e8e3e3fac6ae179be8567485a2
MD5 4c4d84b4e367bd422712081150a9734c
BLAKE2b-256 e7e2ef00bf0d15b74b3891a1d9825fefe8ddd9a79adf6eb4a928b277514ed363

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