Metadata-Version: 2.4
Name: tagmap
Version: 0.1.0
Summary: Fast data structure for managing tags and metadata with efficient queries
Author: originalsouth
License: MIT
Project-URL: Homepage, https://github.com/originalsouth/tagmap.py
Project-URL: Repository, https://github.com/originalsouth/tagmap.py
Keywords: tags,metadata,data-structure,c++
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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

```bash
uv pip install tagmap
```

## Usage

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

```bash
# Install build dependencies
uv pip install pybind11

# Build and install in development mode
uv pip install -e .

# Or build directly
make
```
