Fast data structure for managing tags and metadata with efficient queries
Project description
TagMap
A fast, efficient data structure for managing tags and metadata in Python, built with C++ and pybind11.
Overview
TagMap is a specialized dictionary-like data structure optimized for managing multiple tags per key. It supports efficient queries for keys with specific tag combinations.
Features
- Fast tag-based queries with intersection (all-of) and union (any-of) operations
- Efficient tag addition and removal
- Multiple query methods for flexible data retrieval
- Built on high-performance C++ implementation
Installation
uv pip install tagmap
Usage
import tagmap
# Create a TagMap
m = tagmap.TagMap()
# Add entries with tags
m["alice"] = {"dev", "python"}
m["bob"] = {"dev", "cpp"}
m["carol"] = ["design", "python"]
# Query all entries with both "dev" and "python"
results = m.query("dev", "python")
# Query entries with either "python" OR "ops"
results = m.query_any("python", "ops")
# Check if an entry has a tag
has_tag = m.has_tag("alice", "python")
# Add/remove tags
m.add_tag("alice", "ml")
m.remove_tag("bob", "dev")
Building from Source
# Install build dependencies
uv pip install pybind11
# Build and install in development mode
uv pip install -e .
# Or build directly
make
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
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 tagmap-0.1.7.tar.gz.
File metadata
- Download URL: tagmap-0.1.7.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f6a56cdc09afddac520b53be833ad698787131f872ec941375ade429534f7db
|
|
| MD5 |
60d67e1293879b62631be66857332544
|
|
| BLAKE2b-256 |
39bd7653999a4653985a1a4862958afb6a3786256cb83a3a64ba4d525c9aa6d2
|
File details
Details for the file tagmap-0.1.7-cp311-cp311-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: tagmap-0.1.7-cp311-cp311-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
524933dd98c21c5328ce48ae5a45315721fb17dfa28371a558cae3b71e70ca08
|
|
| MD5 |
845af1110aa1e79e1f34fa1100d06713
|
|
| BLAKE2b-256 |
7377b10ab341059b6abb2061c79a08ac4ced4f85573365ff55446a48c7c70e47
|