Skip to main content

No project description provided

Project description

vayu

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

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.0.tar.gz (17.3 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.0-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vayulib-0.6.0.tar.gz
  • Upload date:
  • Size: 17.3 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.0.tar.gz
Algorithm Hash digest
SHA256 8de7e13a771bf4bba827f461b1b95fbb7e652a1801d588439193c48234deba0c
MD5 f13b72f51bf9714ca9d651de609e6845
BLAKE2b-256 01775cfa90e56df6805890f4e109b2f8fb16fe4c3ab5da060320bca323891c8c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vayulib-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 20.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 001a7fb7817807d183142dfc7ae2dfbec2584ac1aac35e748c638cf6a59054f9
MD5 b3329460270709276aa4ae8a9e842a1b
BLAKE2b-256 21f31a7766183742299eeefbf6cd60b9f405a2ed301a0a2f78226f97e6cd590a

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