Metadata-Version: 2.4
Name: timestamp-store
Version: 1.0.0
Summary: Fast timestamp-based data structure with O(log N) operations
Home-page: https://github.com/shutkanos/timestamp_store
Author: Shutkanos
Author-email: Shutkanos <Shutkanos836926@mail.ru>
License: MIT
Project-URL: Homepage, https://github.com/shutkanos/timestamp_store
Project-URL: Repository, https://github.com/shutkanos/timestamp_store
Keywords: timestamp,data-structure,ctypes
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: C++
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# TimestampStore

Fast data structure for (id, timestamp) pairs with O(log N) operations.
Warning! Created by claude-opus-4.5 without human intervention.

## Installation

```bash
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](https://visualstudio.microsoft.com/visual-cpp-build-tools/) or:

PowerShell:
```PowerShell
winget install -e --id MSYS2.MSYS2
```
MSYS2:
```
pacman -S mingw-w64-x86_64-gcc
```

## Usage

```python
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 |
