Skip to content

Repository files navigation

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.

Installation

pip install metacrafter

Optional extras:

pip install 'metacrafter[rules]'         # extended YAML rules pack
pip install 'metacrafter[llm]'           # LLM/RAG hybrid classification
pip install 'metacrafter[datahub]'       # DataHub export
pip install 'metacrafter[openmetadata]'  # OpenMetadata export
pip install 'metacrafter[all]'           # rules + integrations
pip install 'metacrafter[dev]'           # tests and linters

When metacrafter[rules] is installed, the extended pack loads automatically. Set auto_rules: false in .metacrafter to use only 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 \
  --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 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.

About

Metadata and data identification tool and Python library. Identifies PII, common identifiers, language specific identifiers. Fully customizable and flexible rules

Topics

Resources

Stars

46 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages