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.7.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.7-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.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

Hashes for tagmap-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4f6a56cdc09afddac520b53be833ad698787131f872ec941375ade429534f7db
MD5 60d67e1293879b62631be66857332544
BLAKE2b-256 39bd7653999a4653985a1a4862958afb6a3786256cb83a3a64ba4d525c9aa6d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tagmap-0.1.7-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 524933dd98c21c5328ce48ae5a45315721fb17dfa28371a558cae3b71e70ca08
MD5 845af1110aa1e79e1f34fa1100d06713
BLAKE2b-256 7377b10ab341059b6abb2061c79a08ac4ced4f85573365ff55446a48c7c70e47

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