Community Python API
The open-source Python interface to Zingg. Configure arguments, define fields, build pipes, and run every Community phase from Python.
The Community Zingg Python API is the open source way to run Zingg from Python. It provides classes for arguments, field definitions, client options, pipes, and the Zingg execution client.
Use this package when you want a free, open-source Zingg installation running on Spark. For Enterprise features like deterministic matching, blocking strategy, primary keys, pass-through, mapping match types, and incremental matching, see Enterprise ZinggEC Python API.
Requirements
Python 3.6+
Spark 3.5.0
Install the package
pip install zinggModules and classes
zingg.client module
Zingg
The Zingg execution client. Pass it args and options, call initAndExecute().
ZinggWithSpark
Same as Zingg but for use when an existing Spark session is already present (e.g. in a Databricks or Fabric notebook).
Arguments
Configuration object holding the model ID, Zingg directory, partition count, field definitions, and pipes.
ClientOptions
Holds the phase name. Pass to the Zingg execution client.
FieldDefinition
Defines a single field with its name, data type, and match type.
zingg.pipes module
Pipe
Base class for any input or output. Use for generic JDBC, custom formats, or any source where the specialised classes do not fit.
CsvPipe
Read or write CSV files.
BigQueryPipe
Read from or write to Google BigQuery.
SnowflakePipe
Read from or write to Snowflake (via Spark connector).
Imports
Build the arguments object
Define fields and match types
Configure input and output pipes
CSV pipe example:
For BigQuery
For Snowflake
For generic pipes
Execute Zingg phases
Run any phase by passing its name to ClientOptions. The same pattern works for findTrainingData, label, train, match, link, findAndLabel, updateLabel, generateDocs, and any other Community phase.
Run findTrainingData:
Run label:
Run findAndLabel
Combines findTrainingData and label into one call — use for smaller datasets where findTrainingData runs quickly.
Run updateLabel
Revisit and correct previously marked pairs — run generateDocs first to identify pairs to update
Run generateDocs
Run train
Run match
Run link
Using ZinggWithSpark in notebooks
When running inside a Databricks, Fabric, or other notebook where a Spark session already exists, use ZinggWithSpark instead of Zingg:
ZinggWithSpark reuses the existing Spark session instead of creating a new one. This is the recommended class for notebook environments.
Full example
Complete working example combining all the steps above:
Example notebooks and reference
Working example notebooks are at github.com/zinggAI/zingg/tree/main/examples/febrl. Start with FebrlExample.py.
Last updated
Was this helpful?