Metadata-Version: 2.4
Name: metacrafter
Version: 1.0.0
Summary: Metacrafter metadata classification tool
Author-email: Ivan Begtin <ivan@begtin.tech>
License: Apache-2.0
Project-URL: Homepage, https://github.com/apicrafter/metacrafter/
Project-URL: Documentation, https://apicrafter.github.io/metacrafter/
Project-URL: Repository, https://github.com/apicrafter/metacrafter/
Keywords: json,jsonl,csv,bson,cli,dataset,metadata,pii,semantic-types
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
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: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Topic :: Software Development
Classifier: Topic :: Text Processing
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyparsing>=3.1
Requires-Dist: phonenumbers
Requires-Dist: qddate
Requires-Dist: orjson
Requires-Dist: PyYAML>=6.0
Requires-Dist: sqlalchemy>=2.0
Requires-Dist: validators
Requires-Dist: typer
Requires-Dist: tabulate
Requires-Dist: rich
Requires-Dist: pydantic>=2.0
Requires-Dist: xmltodict
Requires-Dist: iterabledata>=1.1
Requires-Dist: tqdm
Requires-Dist: requests>=2.28.0
Requires-Dist: chardet
Requires-Dist: jsonschema>=4.18
Provides-Extra: rules
Provides-Extra: formats
Requires-Dist: pyarrow>=10.0; extra == "formats"
Requires-Dist: avro>=1.11; extra == "formats"
Requires-Dist: pyorc; extra == "formats"
Requires-Dist: xlrd>=2.0; extra == "formats"
Requires-Dist: openpyxl>=3.0; extra == "formats"
Requires-Dist: lxml>=4.9; extra == "formats"
Requires-Dist: lz4; extra == "formats"
Requires-Dist: zstandard; extra == "formats"
Requires-Dist: brotli; extra == "formats"
Requires-Dist: brotli_file; extra == "formats"
Provides-Extra: mongodb
Requires-Dist: pymongo>=4.6; extra == "mongodb"
Provides-Extra: duckdb
Requires-Dist: duckdb>=0.9; extra == "duckdb"
Requires-Dist: duckdb-engine>=0.9; extra == "duckdb"
Provides-Extra: server
Requires-Dist: fastapi>=0.110; extra == "server"
Requires-Dist: uvicorn>=0.29; extra == "server"
Provides-Extra: mcp
Requires-Dist: mcp<3,>=2.0; extra == "mcp"
Provides-Extra: llm
Requires-Dist: anthropic>=2.0; extra == "llm"
Provides-Extra: llm-chroma
Requires-Dist: openai>=1.0.0; extra == "llm-chroma"
Requires-Dist: chromadb>=0.4.0; extra == "llm-chroma"
Provides-Extra: datahub
Requires-Dist: acryl-datahub[datahub-rest]>=0.12.0; extra == "datahub"
Provides-Extra: openmetadata
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-mock; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: httpx; extra == "dev"
Provides-Extra: all
Requires-Dist: pyarrow>=10.0; extra == "all"
Requires-Dist: avro>=1.11; extra == "all"
Requires-Dist: pyorc; extra == "all"
Requires-Dist: xlrd>=2.0; extra == "all"
Requires-Dist: openpyxl>=3.0; extra == "all"
Requires-Dist: lxml>=4.9; extra == "all"
Requires-Dist: lz4; extra == "all"
Requires-Dist: zstandard; extra == "all"
Requires-Dist: brotli; extra == "all"
Requires-Dist: brotli_file; extra == "all"
Requires-Dist: pymongo>=4.6; extra == "all"
Requires-Dist: duckdb>=0.9; extra == "all"
Requires-Dist: duckdb-engine>=0.9; extra == "all"
Requires-Dist: fastapi>=0.110; extra == "all"
Requires-Dist: uvicorn>=0.29; extra == "all"
Requires-Dist: mcp<3,>=2.0; extra == "all"
Requires-Dist: anthropic>=2.0; extra == "all"
Requires-Dist: acryl-datahub[datahub-rest]>=0.12.0; extra == "all"
Dynamic: license-file

# Metacrafter

Python command-line tool and library to label table fields and data files. Use it to find meaningful columns in tables — or to find personal identifiable information (PII).

## Documentation

The full documentation site (Docusaurus) lives in [`docs/`](docs/) and is published at **[apicrafter.github.io/metacrafter](https://apicrafter.github.io/metacrafter/)**.

| Section | What it covers |
|---------|----------------|
| [Getting started](https://apicrafter.github.io/metacrafter/getting-started/installation) | Install, quick start, positioning |
| [Cookbook](https://apicrafter.github.io/metacrafter/getting-started/cookbook) | Task index by role |
| [CLI reference](https://apicrafter.github.io/metacrafter/commands/) | Every command |
| [Formats](https://apicrafter.github.io/metacrafter/formats/) | Files and compression codecs |
| [Python SDK](https://apicrafter.github.io/metacrafter/integrations/sdk) | `CrafterCmd` API |
| [LLM classification](https://apicrafter.github.io/metacrafter/integrations/llm) | Hybrid rules + RAG |
| [Troubleshooting](https://apicrafter.github.io/metacrafter/getting-started/troubleshooting) | Common errors |

Source pages: [`docs/docs/`](docs/docs/). Changelog: [`CHANGELOG.md`](CHANGELOG.md).

Repository assessment and proposed work: [Code quality review and improvement plan](REPOSITORY_REVIEW_AND_IMPROVEMENT_PLAN.md) (2026-10-01).

## Installation

Requires Python 3.10+.

```bash
pip install metacrafter
```

The default rule pack is downloaded on first use from the pinned
[metacrafter-rules](https://github.com/apicrafter/metacrafter-rules) GitHub release (verified
by SHA-256 and cached). Registry data comes from
[registry.apicrafter.io](https://registry.apicrafter.io). For offline use, run
`metacrafter rules fetch` and `metacrafter registry fetch --to DIR`.

Optional extras:

```bash
pip install 'metacrafter[formats]'       # Parquet, ORC, Excel, XML, compressed files
pip install 'metacrafter[mongodb]'       # MongoDB and BSON
pip install 'metacrafter[duckdb]'        # native DuckDB scanning
pip install 'metacrafter[server]'        # HTTP API server
pip install 'metacrafter[llm]'           # LLM/RAG hybrid classification
pip install 'metacrafter[datahub]'       # DataHub export
pip install 'metacrafter[openmetadata]'  # OpenMetadata export
pip install 'metacrafter[all]'           # everything above
pip install 'metacrafter[dev]'           # tests and linters
```

Set `auto_rules: false` in `.metacrafter` to load only the rule paths you list.

```python
from metacrafter import CrafterCmd
```

## Features

- YAML rules for field names and values (text, PyParsing, Python functions)
- PII, person names, identifiers (UUID/GUID, email, phone), dates (312+ patterns via [qddate](https://github.com/ivbeg/qddate)), and country-specific types
- Files via [iterabledata](https://github.com/datenoio/iterabledata): CSV, TSV, JSON/JSONL, XML, Parquet, Avro, ORC, Excel, BSON, Pickle, plus gzip/bzip2/xz/lz4/zstd/brotli/snappy/zip
- SQL databases (SQLAlchemy) and MongoDB
- Context and language filters so only relevant rules run
- Built-in HTTP API (`metacrafter server run`)
- Optional LLM/RAG classification (OpenAI, OpenRouter, Ollama, LM Studio, Perplexity)
- Export to DataHub, OpenMetadata, and Apache Atlas
- Datatype URLs from [metacrafter-registry](https://github.com/apicrafter/metacrafter-registry)

## Quick start

```bash
metacrafter scan file somefile.csv --format short

metacrafter scan file users.csv \
  --contexts pii \
  --langs en \
  --confidence 20.0 \
  --format full \
  -o pii_scan.json

metacrafter scan sql "sqlite:///users.db" --format full -o db.json

metacrafter rules list
metacrafter server run --host 127.0.0.1 --port 10399
```

More examples: [Quick start](https://apicrafter.github.io/metacrafter/getting-started/quick-start) and [Cookbook](https://apicrafter.github.io/metacrafter/getting-started/cookbook).

## Ecosystem

- [metacrafter-rules](https://github.com/apicrafter/metacrafter-rules) — extra validators and YAML rules
- [metacrafter-registry](https://github.com/apicrafter/metacrafter-registry) — canonical semantic types at [registry.apicrafter.io](https://registry.apicrafter.io)

## Commercial support

Contact ibegtin@apicrafter.io or ivan@begtin.tech for a commercial API with additional rules and dedicated support.

## License

Apache-2.0. See [LICENSE](LICENSE).
