Skip to main content

Thin Python SDK for the mxDB bitemporal feature engine

Project description

mxDB Python SDK

mxdb is a thin Python SDK that shells out to featurectl.

For published wheels, featurectl is bundled inside the wheel and resolved automatically by MXDBClient. The wheel build pipeline targets macOS, Linux, and Windows.

Public SDK usage is entity-scoped: bind an entity with client.entity(tenant, entity_type, entity_id) and call reads/writes on the returned MXDBEntityClient.

Install

pip install mxdb

No local compiler/toolchain is required for standard wheel installs.

Basic Usage

from mxdb import MXDBClient

client = MXDBClient("featured.conf")

client.register_feature("prod", "instrument", "f_price", "price", "double")
client.register_feature("prod", "instrument", "f_vec", "vec", "double_vector")

# Bind the entity once, then use short calls.
aapl = client.entity("prod", "instrument", "AAPL")

aapl.ingest("f_price", 100, 101.5, "w1", system_time_us=100)
aapl.ingest("f_vec", 101, [1.0, 2.5, 3.25], "w2", system_time_us=101)

latest = aapl.latest("f_price")
print(latest.value_type, latest.value)  # double 101.5

latest_many = aapl.latest("f_price", count=5)
print([x.value for x in latest_many])  # latest 5 (or fewer) values

snapshot = aapl.get()
print(snapshot["f_price"].value)  # 101.5

asof = aapl.asof("f_vec", 200, 200)
print(asof.value_type, asof.value)  # double_vector [1.0, 2.5, 3.25]

# Range form: latest value within [start, end] (inclusive).
asof_range = aapl.asof(
    "f_price", ("2026:03:09:12:00:00.000", "2026:03:09:12:10:00.000")
)
print(asof_range.value)

aapl.delete("f_price", 300, "w-delete-1", system_time_us=300)

Supported Python Value Types

MXDBEntityClient.ingest() accepts:

  • bool -> bool
  • int -> int64
  • float -> double
  • str -> string
  • list[float] -> float_vector / double_vector (depending on registered metadata type)

Read APIs:

  • client.entity(tenant, entity_type, entity_id) returns an entity-scoped client
  • entity.latest(..., count=1) returns one typed result
  • entity.latest(..., count=N) with N > 1 returns up to N typed results
  • entity.get() returns all registered features for that entity key
  • entity.asof(...) returns one typed result

Double-only helpers remain available on the entity client: entity.latest_double(...) and entity.asof_double(...).

Write APIs:

  • entity.ingest(..., operation="upsert"|"delete")
  • entity.delete(...) convenience wrapper for tombstone writes

Return Objects

entity.latest() and entity.asof() return TypedFeatureResult objects with:

  • found: bool
  • value_type: str | None
  • value: Any | None
  • event_time_us: int | None
  • system_time_us: int | None
  • lsn: int | None (latest() paths include lsn; asof() is None)

When count > 1, entity.latest() returns list[TypedFeatureResult] in newest-first order. entity.get() returns dict[str, TypedFeatureResult] keyed by feature_id.

Delete/latest contract:

  • if the latest visible event is a tombstone, entity.latest(..., count=1) returns found=False
  • entity.latest(..., count>1) returns [] when the latest visible event is a tombstone

Binary Resolution Order

MXDBClient resolves featurectl in this order:

  1. explicit featurectl_bin= argument
  2. MXDB_FEATURECTL_BIN environment variable
  3. bundled wheel binary payload (mxdb/bin/featurectl or mxdb/bin/featurectl.exe)
  4. featurectl on PATH

If none are found, construction fails with a clear error.

asof Time Inputs

event_cutoff_us / system_cutoff_us accept:

  • epoch microseconds (int)
  • datetime objects
  • strings in YYYY:MM:DD:HH:MM:SS[.ffffff]
  • ISO-8601 strings (for example 2026-03-09T12:34:56Z)
  • ranges as (start, end) or [start, end] using any supported time input above

system_cutoff_us is optional; if omitted, it defaults to current time. For range inputs, entity.asof(...) returns the latest visible value in the closed interval. Millisecond strings work via fractional seconds (for example .123).

Building Wheels With Bundled featurectl

python sdk/python/scripts/build_featurectl_for_wheel.py
cd sdk/python
python -m build

For source builds on Windows, install SQLite via vcpkg and pass the toolchain:

python sdk/python/scripts/install_windows_sqlite.py
$env:MXDB_CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
$env:MXDB_VCPKG_TARGET_TRIPLET="x64-windows"
python sdk/python/scripts/build_featurectl_for_wheel.py

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

mxdb-0.1.4.tar.gz (12.5 kB view details)

Uploaded Source

Built Distributions

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

mxdb-0.1.4-cp312-cp312-win_amd64.whl (166.9 kB view details)

Uploaded CPython 3.12Windows x86-64

mxdb-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

mxdb-0.1.4-cp312-cp312-macosx_11_0_arm64.whl (303.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mxdb-0.1.4-cp311-cp311-win_amd64.whl (166.9 kB view details)

Uploaded CPython 3.11Windows x86-64

mxdb-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mxdb-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (303.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mxdb-0.1.4-cp310-cp310-win_amd64.whl (166.9 kB view details)

Uploaded CPython 3.10Windows x86-64

mxdb-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mxdb-0.1.4-cp310-cp310-macosx_11_0_arm64.whl (303.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file mxdb-0.1.4.tar.gz.

File metadata

  • Download URL: mxdb-0.1.4.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mxdb-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0f089c3dd94f5797e3b59a1e5f1412c07bfb776155b11f2f0f48ecf63402e316
MD5 e57fcf9e0ec46d694a29d3a0e4d6fea0
BLAKE2b-256 82fd45a1c51ba2fb4b626a45264f41171b27ad65d9cd08a12b7c75ef08662812

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxdb-0.1.4.tar.gz:

Publisher: python-wheels.yml on JasonCodesC/mxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxdb-0.1.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: mxdb-0.1.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 166.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mxdb-0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8da2495278bfdfad3a8adfd9b9996635c299c90ce02a3f0597685f1611f5d3ca
MD5 de7415d032430a5c18f7809741634bdc
BLAKE2b-256 938cb26abe91227122884c84e53423a4fd1abf9581da26458bff0b4349c77ca8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxdb-0.1.4-cp312-cp312-win_amd64.whl:

Publisher: python-wheels.yml on JasonCodesC/mxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxdb-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mxdb-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7fa71c7e24846151c6f9f66d814dfe86bb5ef0dc0e58b097e75d8741d61f733c
MD5 859a90a1ba8c5241009fecd4fafc169e
BLAKE2b-256 8e46f2c903d020a83af6438c106ac7ad1d862355ae7a29d9dcca926b89133b06

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxdb-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-wheels.yml on JasonCodesC/mxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxdb-0.1.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mxdb-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31a637406a4e26bd144056cdcc61b1fc5fbe74ea29c2159496350c8a538bf26f
MD5 5fa019119a90e86ce9d64c62fd19e93d
BLAKE2b-256 87655472c3801f1d877198193b83725dd3d05555004258fa320261cbbf95c78d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxdb-0.1.4-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python-wheels.yml on JasonCodesC/mxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxdb-0.1.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: mxdb-0.1.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 166.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mxdb-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a53ee28e2edc10228d7a15de913daf269adbab758f899488b37f53d7c0b3c655
MD5 45dfe56dc315879ce1150707921d37f3
BLAKE2b-256 67c9fa1c3293e84dc1495416acaa4fd29fa390c3d6c9b6811bcd910e741ec26e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxdb-0.1.4-cp311-cp311-win_amd64.whl:

Publisher: python-wheels.yml on JasonCodesC/mxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxdb-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mxdb-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9170a3634fe5aa9bef1aabd7f259e7b1cd4c5e6ed6be6e73d244cb973d793f0
MD5 bb856b3ceb6126c36887135230507502
BLAKE2b-256 2d38298b612c9707260aa5d76c969da5144bb3395d8d3bd138cdb9272682ce15

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxdb-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-wheels.yml on JasonCodesC/mxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxdb-0.1.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mxdb-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6cc50d080d4b8aa9ef7a1563544b2569775f2be79dfa9bce92288f5a072cf11
MD5 bff8fc1b862d9fc8983dff9375acdc1a
BLAKE2b-256 053354dcc10d76124c751d75afdda8778788655e30c9bb5266d8573d625cfa6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxdb-0.1.4-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: python-wheels.yml on JasonCodesC/mxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxdb-0.1.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: mxdb-0.1.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 166.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mxdb-0.1.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 244f3de032639acb74bd13f6a5fc5d35b991997354efb56e254b568a349055f9
MD5 0fcdf6b57d2875ddc68496a5d4a7a94c
BLAKE2b-256 6826b1302368e79017daefe9845c44c8a33c776afaeb44bf91bcd05388c1438b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxdb-0.1.4-cp310-cp310-win_amd64.whl:

Publisher: python-wheels.yml on JasonCodesC/mxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxdb-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mxdb-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c4247ee8026ef5067f4a9664d156d488b1a181f1504d9496ec4d8843b34c93bd
MD5 53ad4a6d782dafef96d53c397341abf1
BLAKE2b-256 b844305064408a7efd78527f0f9cc044b9181663f1c401def740bb5f04fe0a80

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxdb-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-wheels.yml on JasonCodesC/mxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxdb-0.1.4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mxdb-0.1.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dbab84ebfdb973b093620e5344dd10678491ca129df4abcc06b0d24dd69ecd77
MD5 035fe10574745cc648b9b944971f0f41
BLAKE2b-256 b3855b7ea976d5955472048e460fa0cca19cf9c0e7a0ff93384789afcee1368e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxdb-0.1.4-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: python-wheels.yml on JasonCodesC/mxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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