lookalike
Turn a file of real data into one that looks the same but isn't.
lookalike replaces every value in a CSV, JSON, JSON Lines or Parquet file
with random fake data of the same type and shape. Each column keeps its number
of distinct values and how often each one occurs, so the copy behaves like the
original in tests, demos and analysis. Before the output is saved it is checked
against the input; if any original value survived, nothing is written.
Example
Input (examples/customers.csv):
customer_id,full_name,email,phone,ssn,city,state,...
CU-1001,Maria Lopez,maria.lopez@acme.com,(703) 281-4410,514-22-9081,Reston,VA,...
CU-1002,James Carter,jcarter@gmail.com,(301) 774-2295,233-71-4406,Bethesda,MD,...
CU-1003,Priya Nair,priya.nair@acme.com,(571) 902-1184,601-35-7720,Reston,VA,...
CU-1001,Maria Lopez,maria.lopez@acme.com,(703) 281-4410,514-22-9081,Reston,VA,...
Output:
customer_id,full_name,email,phone,ssn,city,state,...
ZO-7893,Scott Kirby,hartdaniel298@ikuma.example,(249) 555-4032,000-62-2439,West Jasonborough,DC,...
WO-9217,April Bowman,ojones692@bajecoro.example,(899) 555-1023,000-32-8367,North Josephmouth,CO,...
DU-0967,Vincent Bates,matthew45420@ikuma.example,(940) 555-9546,000-60-1108,West Jasonborough,DC,...
ZO-7893,Scott Kirby,hartdaniel298@ikuma.example,(249) 555-4032,000-62-2439,West Jasonborough,DC,...
Rows 1 and 4 were the same customer and still are. The two acme.com
addresses still share a domain. Nothing real is left.
Install
Requires Python 3.10 or newer.
pip install lookalike
For Parquet files, install with the extra:
pip install "lookalike[parquet]"
Use
lookalike inspect customers.csv # 1. see how each column will be treated
lookalike anonymize customers.csv safe.csv # 2. write the anonymized copy
lookalike verify customers.csv safe.csv # 3. optional: re-check later
Common adjustments. ssn, notes, order_total and col7 below stand for
column names in your own file; inspect lists them.
lookalike anonymize in.csv out.csv --drop ssn --drop notes # remove the ssn and notes columns
lookalike anonymize in.csv out.csv --keep order_total # leave the order_total column as is
lookalike anonymize in.csv out.csv --type col7=name # tell it the col7 column holds people's names
lookalike anonymize in.csv out.csv --type 'code=regex:[0-9]{2}-[A-Z]{5}' # fill the code column from your own pattern
lookalike anonymize in.csv out.csv --report report.json # save the check results
--type takes COLUMN=TYPE. Every column is anonymized whatever its type;
the type only decides what the fakes look like. A column of names that
inspect shows as text would come out as Kovar Tunib; with
--type col7=name it comes out as Scott Kirby. For a format of your own,
use regex: followed by a regular expression: [0-9]{2}-[A-Z]{5} gives values
such as 66-QNIDO. The full list of types is in
Column types.
To reuse the same options, save them under a name and pass --profile
(see Profiles):
lookalike profile save customers --drop ssn --type col7=name
lookalike anonymize in.csv out.csv --profile customers
Exit code 0 means the output was written and passed every check.
Before you share the output
lookalike removes the values, not the patterns. Someone looking at the
output can still see how many distinct values a column has, how often each
occurs, where the blanks are, and the rough range of numbers and dates. That
is the point of the tool, but it also means a person who already knows your
data could recognise rows by their pattern. Drop columns you do not need, and
read what is and is not guaranteed before publishing
anything.
Documentation
| Guide | What it covers |
|---|---|
| Getting started | A first run, step by step, and how to read the results |
| Command reference | Every command and option, selecting columns, exit codes |
| Column types | How types are detected and what each fake looks like |
| Privacy guarantees | What is protected, what stays visible, known limits |
| Verification | The checks that run and the fields of the report |
| File formats | CSV, JSON, JSON Lines and Parquet specifics |
| Python API | Using lookalike from code |
Development
uv sync
uv run pytest
Pushing a vX.Y.Z tag publishes to PyPI; see Releasing.
License
Metadata
Release files for lookalike 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lookalike-0.1.3.tar.gz | 77.1 kB | With provenance | Details for lookalike-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lookalike-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for lookalike-0.1.3-py3-none-any.whl |
Total release size: 113.3 kB
Release files / lookalike-0.1.3.tar.gz
| Download URL | lookalike-0.1.3.tar.gz |
|---|---|
| Size | 77.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4a935f612d8c670772be594095497dde11ae1cb22b245e9f3a07d9f069e8c44
|
|
BLAKE2b-256 checksum How to use checksums |
8ea7a0b487c9ee12356861c2079456e822d65bf9009881d3ad7c2a15b3b24711
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logRelease files / lookalike-0.1.3-py3-none-any.whl
| Download URL | lookalike-0.1.3-py3-none-any.whl |
|---|---|
| Size | 36.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4dbd9a2e08f6fd52b7cae3edb5f160b5c8e5805f67cc38fd9b53106515813ab5
|
|
BLAKE2b-256 checksum How to use checksums |
86b5ab5dbc26f84164c0d02f46a723fd9ddf78cdfc5049175f44504e9a6aee4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logSecurity for lookalike 0.1.3
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for lookalike-0.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logA 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.