Skip to main content

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

tagmap-0.1.9.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

tagmap-0.1.9-cp311-cp311-manylinux_2_39_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

File details

Details for the file tagmap-0.1.9.tar.gz.

File metadata

  • Download URL: tagmap-0.1.9.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tagmap-0.1.9.tar.gz
Algorithm Hash digest
SHA256 2193e0ece122e0dd18bf9d47af3797d856eeaf613bd74d7ed1bae0380edd8dc4
MD5 c24b21389bd8e7c55e73badaee57698e
BLAKE2b-256 b18737b35f88d9aae0a9457c81519ed77477a1488ac5de44c005fe5350f36a7c

See more details on using hashes here.

File details

Details for the file tagmap-0.1.9-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for tagmap-0.1.9-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 73b046dd40bb890435c35ba7d1e41beb8360a02164e8a1b5e6fb24458afafc33
MD5 a959e336cd5f5a885bc9e5ad34e61612
BLAKE2b-256 7ebc6d18e04a09798d6c898f44b6a02abc5c5e0ebe40e742c4558b6072a1a6bc

See more details on using hashes here.

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