Skip to main content

beava — Python SDK

Python SDK for Beava, the single-binary real-time feature server. Author pipelines with @bv.event / @bv.table decorators; push events and read features against a running beava server over HTTP or TCP.

Install

# pip    (recommended) — installs SDK + bundled Rust server binary from PyPI
pip install beava

# brew   — Homebrew formula (macOS + Linuxbrew)
brew install beava-dev/beava/beava

# docker — zero deps on the host
docker run -p 8080:8080 -p 8081:8081 beavadev/beava:latest

The wheel ships the SDK and the Rust beava server binary (polars-style); after install, the beava shell command is on PATH and the SDK can run against it directly — including embed mode (bv.App() with no URL). Pin a specific version with pip install beava==0.0.0.

Quickstart

import beava as bv

@bv.event
class Click:
    user_id: str
    page: str

@bv.table(key="user_id")
def UserActivity(e: Click):
    return e.group_by("user_id").agg(
        clicks_1h=bv.count(window="1h"),
        unique_pages_1h=bv.n_unique("page", window="1h"),
    )

app = bv.App(url="http://localhost:8080")
app.register(Click, UserActivity)

app.push("Click", {"user_id": "alice", "page": "/home"})
app.push("Click", {"user_id": "alice", "page": "/products"})

app.get("UserActivity", "alice")
# => {"clicks_1h": 2, "unique_pages_1h": 2}

Transports

The same SDK speaks three transports — pick by the URL you pass to bv.App(...).

# HTTP/JSON (curl-compatible debugging path)
app = bv.App(url="http://localhost:8080")

# Framed TCP (sub-millisecond fast-path; JSON or msgpack content)
app = bv.App(url="tcp://localhost:8081")

# Embed mode (no separate server — auto-spawns a local `beava` binary)
app = bv.App()

Embed mode finds the beava binary that ships with the curl-installed wheel automatically. Override with BEAVA_BINARY=/path/to/beava if you want to point at a different build.

Surface

Method Wire Notes
app.register(*descriptors, force=False, dry_run=False) POST /register Returns {"registry_version": <n>}. Pass force=True for destructive schema changes; dry_run=True returns a categorized diff without applying.
app.push(event_name, fields) POST /push body {event, data} Fire-and-forget. Returns server ack.
app.get(table, key=None, features=None) POST /get body {table, key} Returns a flat dict of feature values. key=None routes to the global-aggregation sentinel (ADR-003). features=[...] narrows to a subset.
app.batch_get(requests) POST /batch_get body {requests: [...]} requests is a list of (table, key) or (table, key, features) tuples. Returns a list of dicts in input order.
app.reset() POST /reset (test_mode-only) Wipes server state. Pass test_mode=True to bv.App(...) to enable.
app.ping() POST /ping Liveness; returns {"pong": True, "registry_version": <n>}.
app.close() — Releases the transport connection.

Pipeline DSL

@bv.event declares an event schema. Fields are typed Python class attributes; the SDK serializes them to JSON on push.

@bv.table(key=...) declares a feature table. The decorated function takes one event-typed parameter and returns e.group_by(...).agg(...) over it. The runtime maintains the table incrementally — every event updates exactly the affected key's row.

The key= kwarg accepts a string (single-column key) or a list of strings (composite key).

bv.col("name") references an event field inside a where= filter or arithmetic expression. Strings in where= are rejected — pass an _Expr (e.g. bv.col("event_type") == "click").

bv.lit(value) wraps a Python literal so it can participate in the same expression grammar.

Operator catalogue

50+ aggregation primitives are exported flat at the bv.* namespace. Inspect the live surface from Python:

import beava as bv
print([x for x in dir(bv) if not x.startswith("_")])

Selection by family:

  • Core — count, sum, mean, min, max, var, std, n_unique, quantile
  • Sketch — top_k, bloom_member, entropy, histogram, hour_of_day_histogram, dow_hour_histogram
  • Recency — first, last, first_n, last_n, lag, first_seen, last_seen, age, time_since
  • Decay — ewma, ema, ewvar, ew_zscore, decayed_sum, decayed_count
  • Velocity — rate_of_change, inter_arrival_stats, burst_count, delta_from_prev, trend, z_score
  • Buffer / geo — most_recent_n, reservoir_sample, geo_velocity, geo_distance, geo_spread, distance_from_home

Deprecation aliases retained: avg → mean, variance → var, stddev → std, count_distinct → n_unique, percentile → quantile. Use the canonical form in new code.

Demo data

bv.demo exposes three pre-built pipelines + dataset loaders for trying the SDK without writing your own pipeline:

import beava as bv
adtech = bv.demo.adtech()      # ad-impression / click / conversion
fraud = bv.demo.fraud()        # transaction fraud
ecommerce = bv.demo.ecommerce()  # cart / view / purchase

Each returns a tuple of (events, tables, dataset) ready to register and push.

Errors

Top-level error types: bv.RegistrationError (raised on register failures with structured code + message), bv.ValidationError (raised by client-side input validators), bv.BinaryNotFoundError (raised in embed mode if the beava binary isn't on PATH).

Learn more

Metadata

Release files for beava 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beava 0.0.6
File Size Uploaded
beava-0.0.6.tar.gz 1.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for beava 0.0.6
File
beava-0.0.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
beava-0.0.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
beava-0.0.6-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
beava-0.0.6-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 11.7 MB

Release files / beava-0.0.6.tar.gz

Download URL beava-0.0.6.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
045af442f753ad36527f6daaff485f864f6ce4f463442ff2c79e656a3a050a36
BLAKE2b-256 checksum
How to use checksums
0bfa61a7ce55f187bffe5524a4b2c127b71e7e678f54239046991337d396fc6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Release files / beava-0.0.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL beava-0.0.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.7 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f4a90f60042772e2237f761bd30431ab070cfdbaeeea7a9883ca0b9b3491f0c3
BLAKE2b-256 checksum
How to use checksums
e4de02e02e70b181bcdf16ea8115260226aebd1773c6fab1ff68753dd2426533
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Release files / beava-0.0.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL beava-0.0.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.6 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
588a3c9e583f2b747a878f557a26ac25368322573c76dfe3d68c3fadc646a6e4
BLAKE2b-256 checksum
How to use checksums
5a1865407a42ee62574cfd25f466cd61226e39edcede7edf00db56fd0895a049
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Release files / beava-0.0.6-py3-none-macosx_11_0_arm64.whl

Download URL beava-0.0.6-py3-none-macosx_11_0_arm64.whl
Size 2.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1e03e4b4c2e181adda42a56e9b9d63206bba6af3a9a06a868d18838a618be79f
BLAKE2b-256 checksum
How to use checksums
bc7ea294e3e716836bc6eef6f79553af110efae4a2e36e3d8ca33362b1cb1b07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Release files / beava-0.0.6-py3-none-macosx_10_12_x86_64.whl

Download URL beava-0.0.6-py3-none-macosx_10_12_x86_64.whl
Size 2.6 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
eff05df93018f80f8817577cbf785ee083e8b17a8a1a1f1ecaaf8b6d18db9107
BLAKE2b-256 checksum
How to use checksums
633dd2b82134c23e9d0449ea280341914e176bcb206da58268345e5209b9ff6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.6 This release

5 release files

0.0.5

5 release files

0.0.4

5 release files

0.0.3

5 release files

0.0.2

5 release files

0.0.1

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page