Python API

Entity Resolution In A Few Lines Of Python

pip install zingg and resolve customers, suppliers and products from any notebook or Spark job. Describe your fields, point at your data, label a few pairs, train and match, all in Python, on Databricks, Microsoft Fabric, AWS or your own Spark.

How It Works

Four Steps, One Script

Step 1

Install

pip install zingg, then import the client and the pipes.

Step 2

Describe Your Fields

One FieldDefinition per column, with a match type that says how to compare it.

Step 3

Point At Your Data

Pipes read the input and write the output: Delta, Parquet, Snowflake, BigQuery, Unity Catalog, JDBC or a DataFrame you already have.

Step 4

Run A Phase

Pick the phase with ClientOptions and call initAndExecute(). The same script labels, trains and matches.

resolve_customers.pyZingg Community
from zingg.client import *
from zingg.pipes import *

args = Arguments()
fname = FieldDefinition("fname", "string", MatchType.FUZZY)
email = FieldDefinition("email", "string", MatchType.EMAIL)
dob   = FieldDefinition("dob", "string", MatchType.EXACT)
args.setFieldDefinition([fname, email, dob])
args.setModelId("customers")
args.setZinggDir("models")

customers = Pipe("customers", "delta")
customers.addProperty("location", "/lake/crm/customers")
args.setData(customers)
resolved = Pipe("resolved", "delta")
resolved.addProperty("location", "/lake/crm/resolved")
args.setOutput(resolved)

options = ClientOptions([ClientOptions.PHASE, "match"])
zingg = Zingg(args, options)
zingg.initAndExecute()
pip install zingg
Snowflake

Resolve Snowflake Data Your Way

Read and write Snowflake tables from Python, or run Zingg Enterprise natively inside your Snowflake account.

Python API

Snowflake Tables From Python

SnowflakePipe reads your Snowflake tables and writes resolved records back, through the Snowflake Spark connector. Run it from the Spark you already use, such as Databricks, Fabric or EMR.

Zingg Enterprise

Native Inside Snowflake

Zingg Enterprise runs inside your Snowflake account on Snowpark Container Services. You start each phase from SQL as a Snowflake job, with no servers outside Snowflake, so records never leave it.

snowflake_input.pyZingg Python API
import os
from zingg.pipes import *

customers = SnowflakePipe("customers")
customers.setURL("myorg-myaccount.snowflakecomputing.com")
customers.setUser(os.environ["SF_USER"])
customers.setPassword(os.environ["SF_PASSWORD"])
customers.setDatabase("CRM")
customers.setSFSchema("PUBLIC")
customers.setWarehouse("COMPUTE_WH")
customers.setDbTable("CUSTOMERS")
args.setData(customers)

Zingg on Snowflake

What You Can Do

The Whole Of Zingg, From Python

Fields And Match Types

Fuzzy names and addresses, exact identifiers, emails, postcodes, numbers with units, long text. Mark a column DONT_USE to carry it through to the output without matching on it.

Read And Write Anywhere

Delta and Parquet through Pipe, SnowflakePipe, BigQueryPipe, UCPipe for Unity Catalog tables, and JDBC or any Spark source. Or pass a DataFrame from your own code.

Every Phase From One Script

findTrainingData, label, train, match and link, plus findAndLabel and trainMatch to do two steps in one run.

Notebooks On Your Spark

ZinggWithSpark reuses the session your notebook already has, on Databricks, Microsoft Fabric, AWS EMR or Glue.

Part Of Your Pipelines

It is a Python program, so it runs wherever your jobs run: Airflow, Databricks Workflows, Fabric pipelines, keeping the configuration in Git.

Enterprise In The Same Shape

The Zingg Enterprise Python API adds deterministic matching, incremental runs, mapping match types for nicknames, explanations of every match and output statistics.

Match Types

Tell Zingg How Each Field Compares

Each FieldDefinition takes a MatchType. Zingg learns how much each field matters from the pairs you label.

MatchTypeWhat it compares
FUZZYTypo-tolerant matching for names, addresses and free text
EXACTA strong signal when two values are identical
EMAILCompares the part of an email before the @
PINCODEPostal and ZIP codes across common formats
NUMERICNumbers inside strings, ignoring the letters around them
NUMERIC_WITH_UNITSNumbers with their units, such as 500 ml or 16 GB
TEXTOverlapping words in longer descriptions
ONLY_ALPHABETS_EXACT / FUZZYLetters only, numbers stripped, compared exactly or fuzzily
NULL_OR_BLANKLets the model learn what a missing value means
DONT_USEKept in the output, not used for matching
Community And Enterprise

Same API, More For Production

Zingg CommunityZingg Enterprise
Packagepip install zinggpip install zinggEC
ArgumentsArguments, FieldDefinitionEArguments, EFieldDefinition
MatchingAI matching trained on your labelsAI matching plus deterministic rules in the same run
UpdatesRerun match on the full datarunIncremental for new, changed and deleted records
Nicknames and abbreviationsNot includedMAPPING match types from a lookup file
SourcesDelta, Parquet, Snowflake, BigQuery, Unity Catalog, JDBC, DataFramesAdds in-memory pipes
ExplanationsNot includedWhy records matched: the pairs, their scores and how each cluster formed
OutputClusters with a Zingg ID per runPersistent ZINGG_ID, pass-through records and run statistics

Compare editions

FAQ

Python API Questions

How do I install the Zingg Python API?

Run pip install zingg for Zingg Community. Zingg Enterprise uses pip install zinggEC and needs an Enterprise licence. The Python API runs on Spark.

Where can I run Zingg Python programs?

On any Spark you have: Databricks, Microsoft Fabric, AWS EMR, AWS Glue or a local Spark. In a notebook, ZinggWithSpark uses the notebook's Spark session. As a script, run it with zingg.sh --run.

Do I still need a JSON configuration file?

No. The Python API sets the same fields, data and model options in code, so the configuration lives with the rest of your pipeline.

Can I label training pairs from Python?

Yes. Run findTrainingData and label, or findAndLabel to do both, then train. In notebooks you can label pairs in the notebook itself.

Can I use the Zingg Python API with Snowflake?

Yes. SnowflakePipe reads Snowflake tables as input and writes the resolved output back, through the Snowflake Spark connector. Zingg Enterprise can also run natively inside Snowflake on Snowpark Container Services, started from SQL.

Can Zingg read a DataFrame I already have?

Yes. Pass the DataFrame as the input instead of a file or table pipe, and Zingg matches it on the same Spark session.

Start Resolving From Your Notebook

Install the open source package today, or talk to us about Zingg Enterprise.