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.0.tar.gz (9.6 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.0-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.0.tar.gz.

File metadata

  • Download URL: tagmap-0.1.0.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

Hashes for tagmap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a06d974824b6635c07b396f6d0221f27386b90889bbfb5f880893dc83e856934
MD5 e80833c92d6abf6c68da4624e6ad4d85
BLAKE2b-256 b86c02b37a04f84b6a1b58367ad727e84c4c511fb935d483b7bf80dadc335eaa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tagmap-0.1.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 b6fd2f5d6377b67fbca32213d264e8ee6dead152b9492b2f9c8ef5a1c707b07b
MD5 d679cd276517c435634495de0cae1177
BLAKE2b-256 8a61a4efcdd523df11c0e64a698e1e5318aff978fb6bc4650f8a9d281324b231

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