Fast timestamp-based data structure with O(log N) operations
Project description
TimestampStore
Fast data structure for (id, timestamp) pairs with O(log N) operations. Warning! Created by claude-opus-4.5 without human intervention.
Installation
pip install git+https://github.com/shutkanos/timestamp_store.git
Requirements: C++ compiler (g++, clang++, or MSVC)
Installing compiler
- Ubuntu/Debian:
sudo apt install g++ - macOS:
xcode-select --install - Windows: Install Visual Studio Build Tools or:
PowerShell:
winget install -e --id MSYS2.MSYS2
MSYS2:
pacman -S mingw-w64-x86_64-gcc
Usage
from timestamp_store import TimestampStore
store = TimestampStore()
# Add pairs
store.add(1, 100)
store.add(2, 50)
store.add(3, 150)
# Remove all with timestamp < 120
removed = store.remove_timestamp(120)
print(removed) # [2, 1]
# Remove by id
store.remove(3)
# Create from list
store = TimestampStore([(1, 100), (2, 200)])
# Create from dict
store = TimestampStore({1: 100, 2: 200})
Complexity
| Operation | Complexity |
|---|---|
add(id, timestamp) |
O(log N) |
remove(id) |
O(log N) |
remove_timestamp(ts) |
O(K) where K = removed count |
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 Distribution
timestamp_store-1.0.0.tar.gz
(233.5 kB
view details)
Built Distribution
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 timestamp_store-1.0.0.tar.gz.
File metadata
- Download URL: timestamp_store-1.0.0.tar.gz
- Upload date:
- Size: 233.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12552bf3afce5770d9141b2714a2344d0056b8c7cbf1141014047cc38e6b0fb5
|
|
| MD5 |
666a7ecabf94092403f446cd898bb884
|
|
| BLAKE2b-256 |
3c6ff41fc654471205c42c6a0add09b3070c5acfbab6d166afb5055db9cc48f7
|
File details
Details for the file timestamp_store-1.0.0-py3-none-any.whl.
File metadata
- Download URL: timestamp_store-1.0.0-py3-none-any.whl
- Upload date:
- Size: 231.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2db35848904cfaa793401123df66ab505db320276512d673bfc69e1c2aa9d0be
|
|
| MD5 |
9f71e43c9f4065876c1edfe4f5a8a4ad
|
|
| BLAKE2b-256 |
858fb6b1836e02740827a24b1f3d905acdc1b55d435f906b25fb26fa1f2db5e8
|