Skip to main content

Installation

Requirements​

  • Python 3.10 or newer (CI tests 3.10–3.13)

Using pip​

pip install metacrafter

That is all you need. The default rule pack is the pinned metacrafter-rules GitHub release. The package includes a copy of its archive (about 280 KB), so the rule pack needs no network access. On first use, Metacrafter checks the archive's SHA-256 and unpacks it into ~/.cache/metacrafter/rules/. Registry data is read from registry.apicrafter.io and cached. The package ships a registry snapshot (about 550 KB), so the first scan does not wait for the registry download; the cache is refreshed after 24 hours. Neither project is a Python dependency.

To prepare an offline machine, write a registry snapshot on a machine with network access and copy it:

metacrafter registry fetch --to ./registry # registry snapshot for registry_path

Optional features are available as install extras:

pip install 'metacrafter[formats]' # Parquet, ORC, Excel, ODS, SPSS, Stata, SAS, dBase, R data, iCalendar, XML, Shapefile, lz4/zstd/brotli
pip install 'metacrafter[mongodb]' # metacrafter scan mongodb, .bson files
pip install 'metacrafter[duckdb]' # native DuckDB scanning, duckdb:// URLs
pip install 'metacrafter[server]' # metacrafter server run
pip install 'metacrafter[llm]' # LLM/RAG hybrid classification
pip install 'metacrafter[datahub]' # DataHub export
pip install 'metacrafter[openmetadata]' # OpenMetadata export
pip install 'metacrafter[all]' # every optional feature
pip install 'metacrafter[dev]' # tests and linters

A command that needs a missing extra stops with an error naming the extra, for example pip install 'metacrafter[mongodb]'.

The default rule pack never comes from the current directory. Its sources, in order:

  1. rules_dir in .metacrafter (or METACRAFTER_RULES_DIR): a metacrafter-rules checkout or an unpacked pack;
  2. an installed metacrafterext package;
  3. the cache;
  4. the archive bundled with the package (pinned release only);
  5. a download of the configured release.

Set rules_offline: true to forbid downloads. rules_release with rules_sha256 selects another release; it is downloaded from GitHub (metacrafter rules fetch --release TAG --sha256 HEX). Set auto_rules: false to load only the paths you list in rulepath.

The stable public Python API is importable from the package:

from metacrafter import CrafterCmd

Optional extras​

ExtraEnables
formatsParquet, Avro, ORC, Excel, XML and lz4/zstd/brotli files (via iterabledata)
mongodbMongoDB scanning and BSON files (pymongo)
duckdbNative DuckDB scanning (duckdb, duckdb-engine)
serverHTTP API server (FastAPI, uvicorn)
mcpMCP server for AI agents
llmLLM classification; adds the Anthropic SDK (OpenAI-compatible providers need nothing extra)
llm-chromaDeprecated vector-index pipeline (llm_registry_path): OpenAI SDK, ChromaDB
datahubExport scan results to DataHub (acryl-datahub)
openmetadataExport scan results to OpenMetadata
rulesNo-op, kept for compatibility: the rule pack comes from GitHub releases
allEvery optional feature above
devpytest, coverage, ruff, mypy, build

From source​

git clone https://github.com/apicrafter/metacrafter.git
cd metacrafter
pip install -e '.[dev,formats]'

To work on rules at the same time, point rules_dir (or METACRAFTER_RULES_DIR) at a metacrafter-rules checkout. ecosystem.lock records the rule release and the registry version that CI is tested against.

Next steps​