Skip to main content

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/ and is published at apicrafter.github.io/metacrafter.

Section What it covers
Getting started Install, quick start, positioning
Cookbook Task index by role
CLI reference Every command
Formats Files and compression codecs
Python SDK CrafterCmd API
LLM classification Hybrid rules + RAG
Troubleshooting Common errors

Source pages: docs/docs/. Changelog: CHANGELOG.md.

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

Installation

Requires Python 3.10+.

pip install metacrafter

The default rule pack is the pinned metacrafter-rules GitHub release. A copy of its archive ships with the package, so no download is needed (it is verified by SHA-256 and unpacked into the cache on first use). Registry data comes from registry.apicrafter.io; the package ships a snapshot of it for the first scan. For offline use, run metacrafter registry fetch --to DIR.

Optional extras:

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.

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), and country-specific types
  • Files via 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

Quick start

metacrafter scan file somefile.csv --format short

metacrafter scan file users.csv \
  --contexts pii \
  --langs en \
  --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 and Cookbook.

Ecosystem

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.

Metadata

Release files for metacrafter 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metacrafter 2.0.0
File Size Uploaded Provenance Actions
metacrafter-2.0.0.tar.gz 1.3 MB Without provenance Details for metacrafter-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for metacrafter 2.0.0
File Interpreter ABI Platform Actions
metacrafter-2.0.0-py3-none-any.whl Python 3 none any Details for metacrafter-2.0.0-py3-none-any.whl

Total release size: 2.5 MB

Release files / metacrafter-2.0.0.tar.gz

Download URL metacrafter-2.0.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
c3242fb6cadac1587385440ce8d4d3e323a4a3e4da8e0e3799350d465ca8184e
BLAKE2b-256 checksum
How to use checksums
f244e6bfab6ff3a4d1d3d5d7263a3db81b6e63a66d0a2037011c6a48e34eb976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.18

Release files / metacrafter-2.0.0-py3-none-any.whl

Download URL metacrafter-2.0.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
63cf86c870cea2c65efef2073adb31574003362c4dfd53aea19d28ba6293d6ab
BLAKE2b-256 checksum
How to use checksums
06bcfad361605eb967a822261b812524f233269177fad1591bd76b9644ea6558
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.18

Security for metacrafter 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page