High-performance bitemporal data processing for Python
Project description
High-performance bitemporal data processing for Python
PyTemporal is a Rust-powered library for processing bitemporal timeseries data with world-class performance (157,000+ rows/second). Perfect for financial services, audit systems, and applications requiring immutable data trails with both business and system time dimensions.
Quick Start
# Install from source
git clone <your-repo>
cd pytemporal
uv run maturin develop --release
import pandas as pd
from pytemporal import BitemporalTimeseriesProcessor
# Initialize processor
processor = BitemporalTimeseriesProcessor(
id_columns=['id'],
value_columns=['price']
)
# Process temporal updates
result = processor.process_updates(
current_state=current_df,
updates=updates_df,
system_date='2025-01-27'
)
print(f"Updated {len(result.to_insert)} records")
Key Features
- ๐ World-Class Performance: 157,000+ rows/second throughput
- ๐ Bitemporal Processing: Track both business time and system time
- ๐ Python-First: High-level DataFrame API with pandas integration
- โก Zero-Copy: Apache Arrow columnar format for memory efficiency
- ๐ง Flexible Schema: Configure ID and value columns dynamically
- ๐ฏ Two Update Modes: Delta updates or full state replacement
- ๐ Smart Conflation: Optional merging of consecutive records with identical values
- ๐๏ธ Production Ready: Comprehensive test coverage and clean architecture
Documentation
- ๐ API Reference - Complete API documentation
- ๐ฏ Usage Examples - Practical code examples
- โก Performance Guide - Benchmarks and optimization tips
What is Bitemporal Data?
Bitemporal data tracks two time dimensions:
- Effective Time: When events occurred in the real world
- As-Of Time: When information was recorded in the system
This enables powerful queries like "What did we think the price was on Jan 15th, as of Jan 20th?"
Use Cases
- Financial Services: Price histories, portfolio valuations, risk calculations
- Audit Systems: Immutable change tracking with full reconstruction capability
- Regulatory Compliance: Time-accurate reporting for compliance requirements
- Data Warehousing: Slowly changing dimensions with full history preservation
Performance
| Dataset Size | Processing Time | Throughput | Memory |
|---|---|---|---|
| 800k ร 80 cols | 5.4 seconds | 157k rows/sec | ~14GB |
| 100k ร 20 cols | 0.6 seconds | 167k rows/sec | ~2GB |
Benchmarked on modern hardware with optimized settings
Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Python DataFrameโโโโโถโ PyTemporal (Rust)โโโโโถโ Processed Resultsโ
โ (Pandas) โ โ โข Arrow Columnar โ โ (DataFrame) โ
โ โ โ โข Parallel Proc โ โ โ
โโโโโโโโโโโโโโโโโโโ โ โข Timeline Logic โ โโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโ
Built With:
- Rust: Core processing engine for maximum performance
- Apache Arrow: Columnar data format for zero-copy operations
- PyO3: Seamless Rust-Python integration
- Rayon: Data parallelism for multi-core performance
Development
# Run tests
cargo test # Rust tests
uv run python -m pytest tests/ -v # Python tests
# Performance benchmarks
cargo bench # Detailed benchmarks
uv run python validate_refactoring.py # End-to-end validation
# Build release
uv run maturin develop --release
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make changes and add tests
- Run the test suite:
cargo test && uv run pytest - Submit a pull request
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in PyTemporal by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Acknowledgments
Built with modern Rust performance engineering and extensive profiling to achieve world-class bitemporal processing speeds while maintaining clean, maintainable code.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytemporal-1.4.7-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pytemporal-1.4.7-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7bbebf487f0c664af6d43b60646ed20c61bc2909ee17f5c019dee7ae39c7390
|
|
| MD5 |
c7b1073d2e67da53af4a5a55d2dcc55e
|
|
| BLAKE2b-256 |
e3573232de18146090824f0d584a848b2f9f782538428779b4d9b16a889fb5ec
|
Provenance
The following attestation bundles were made for pytemporal-1.4.7-cp312-cp312-manylinux_2_34_x86_64.whl:
Publisher:
build-wheels.yml on gingermike/pytemporal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytemporal-1.4.7-cp312-cp312-manylinux_2_34_x86_64.whl -
Subject digest:
c7bbebf487f0c664af6d43b60646ed20c61bc2909ee17f5c019dee7ae39c7390 - Sigstore transparency entry: 724890197
- Sigstore integration time:
-
Permalink:
gingermike/pytemporal@91515c48242c856b507ae38efaf7538e9b66859e -
Branch / Tag:
refs/tags/v1.4.7 - Owner: https://github.com/gingermike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@91515c48242c856b507ae38efaf7538e9b66859e -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytemporal-1.4.7-cp311-cp311-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pytemporal-1.4.7-cp311-cp311-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f2d89d18fd72456693bbe281383b02bc860ab61d92363bb25b2cae178cc9e40
|
|
| MD5 |
57b7c1c4e98720af0c11b9b3bcfc8fa9
|
|
| BLAKE2b-256 |
c142a394c4f0ca6228a3a3cbe2b8e18bbcf75c43d0db0835e6d4d8d0ddddebf8
|
Provenance
The following attestation bundles were made for pytemporal-1.4.7-cp311-cp311-manylinux_2_34_x86_64.whl:
Publisher:
build-wheels.yml on gingermike/pytemporal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytemporal-1.4.7-cp311-cp311-manylinux_2_34_x86_64.whl -
Subject digest:
2f2d89d18fd72456693bbe281383b02bc860ab61d92363bb25b2cae178cc9e40 - Sigstore transparency entry: 724890198
- Sigstore integration time:
-
Permalink:
gingermike/pytemporal@91515c48242c856b507ae38efaf7538e9b66859e -
Branch / Tag:
refs/tags/v1.4.7 - Owner: https://github.com/gingermike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@91515c48242c856b507ae38efaf7538e9b66859e -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytemporal-1.4.7-cp310-cp310-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pytemporal-1.4.7-cp310-cp310-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c183305a46442b4e7ff633d4624bef4d34d3983155cdc3c5f9f8ea1d3ed5397
|
|
| MD5 |
5e033793c5df1e40ccbde5a91078391a
|
|
| BLAKE2b-256 |
df20fc172976ac8b6176a006bbbea26a5714081d3b0889945c03568ed5a6a23f
|
Provenance
The following attestation bundles were made for pytemporal-1.4.7-cp310-cp310-manylinux_2_34_x86_64.whl:
Publisher:
build-wheels.yml on gingermike/pytemporal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytemporal-1.4.7-cp310-cp310-manylinux_2_34_x86_64.whl -
Subject digest:
7c183305a46442b4e7ff633d4624bef4d34d3983155cdc3c5f9f8ea1d3ed5397 - Sigstore transparency entry: 724890201
- Sigstore integration time:
-
Permalink:
gingermike/pytemporal@91515c48242c856b507ae38efaf7538e9b66859e -
Branch / Tag:
refs/tags/v1.4.7 - Owner: https://github.com/gingermike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@91515c48242c856b507ae38efaf7538e9b66859e -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytemporal-1.4.7-cp39-cp39-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pytemporal-1.4.7-cp39-cp39-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.9, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dc5453508eee20ed0d65a2512a924fc4cdd722aacb010f6340c88f5056cf51c
|
|
| MD5 |
19dccddbf5889ddcacb00577ca7a2064
|
|
| BLAKE2b-256 |
1c4d456de627c901cded745fa401e876fefbb0123f76739d11b7c13371fb957b
|
Provenance
The following attestation bundles were made for pytemporal-1.4.7-cp39-cp39-manylinux_2_34_x86_64.whl:
Publisher:
build-wheels.yml on gingermike/pytemporal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytemporal-1.4.7-cp39-cp39-manylinux_2_34_x86_64.whl -
Subject digest:
6dc5453508eee20ed0d65a2512a924fc4cdd722aacb010f6340c88f5056cf51c - Sigstore transparency entry: 724890194
- Sigstore integration time:
-
Permalink:
gingermike/pytemporal@91515c48242c856b507ae38efaf7538e9b66859e -
Branch / Tag:
refs/tags/v1.4.7 - Owner: https://github.com/gingermike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@91515c48242c856b507ae38efaf7538e9b66859e -
Trigger Event:
push
-
Statement type: