Skip to main content

damicore-normalizer

damicore-normalizer turns an input source into canonical objects, recording the size and SHA-256 of every one. Objects come from one of two sources: a dataset split by column or by row -- delimited text (.csv, .tsv, .txt) or an .xlsx/.xlsm worksheet -- or a set of files that already are the objects. It is the first stage of the DAMICORE pipeline; most users install the aggregate damicore distribution, which runs all four stages end to end. Install this package alone to materialize objects without the rest of the pipeline.

pip install damicore-normalizer

Python

from damicore_normalizer import (
    DelimitedSource,
    FileCorpusSource,
    NormalizationConfig,
    SpreadsheetSource,
    materialize_objects,
)

# Split a delimited file. Any single character is a delimiter, so a tab-separated
# `.txt` is this same source with `delimiter="\t"`.
result = materialize_objects(
    "dataset.csv",
    "normalization",
    config=NormalizationConfig(source=DelimitedSource(split="columns"), chunk_rows=50_000),
)

# Split a worksheet. `sheet` is required when the workbook holds more than one.
spreadsheet = materialize_objects(
    "dataset.xlsx",
    "normalization-xlsx",
    config=NormalizationConfig(source=SpreadsheetSource(split="columns")),
)

# Adopt files that already are the objects. No split, delimiter, or encoding.
corpus = materialize_objects(
    "corpus",
    "normalization-files",
    config=NormalizationConfig(source=FileCorpusSource(recursive=True)),
)

A delimited source streams through pandas.read_csv and a worksheet streams through openpyxl in read-only mode; both bound open column files with an LRU pool. A file corpus is copied in and hashed, so the run directory stays self-contained. Every source writes the objects plus a manifest.json into the output directory, and that manifest is the input the sibling damicore-distance distribution consumes to compute the NCD matrix.

The manifest records object_encoding -- json-lines/1 for a split dataset, raw-bytes/1 for adopted files -- because an NCD value is only meaningful relative to the bytes it measured.

Partitioning a dataset by a numeric column

To cluster the best and the worst segments of a population separately, split the dataset first. partition_dataset ranks the rows by one numeric column and writes, for each requested partition, the rows with the highest values and the rows with the lowest values as complete datasets, plus a partition.json recording what chose them.

from damicore_normalizer import partition_dataset

result = partition_dataset("population.csv", "segments", column="fitness")
for item in result.manifest.files:
    print(item.relative_path, item.row_count)

By default the halves, quarters, eighths, sixteenths and thirty-seconds (quantiles=(2, 4, 8, 16, 32)), the top and bottom 5, 10 and 20 percent of rows (percentiles=(5, 10, 20)), and Fisher-Jenks natural breaks into 2 to 5 classes (jenks_classes=(2, 3, 4, 5)) are emitted; pass an empty sequence to disable a method. Files are named {method}_{parameter:02d}_{high|low}.csv, hold the input's rows in input order with every cell unchanged, and are always ,-delimited UTF-8, so each one feeds materialize_objects or damicore.run with no further argument. A spreadsheet is partitioned the same way with source_kind="xlsx".

The decimal separator of the column is detected by testing . and , against every cell, or declared with decimal=; a column that fits neither is refused naming the offending rows, never guessed. Every rule the files depend on is versioned as partition_rule v1 and specified in the partitioning specification.

Licensed under Apache-2.0.

Metadata

Release files for damicore-normalizer 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for damicore-normalizer 0.4.0
File Size Uploaded Provenance Actions
damicore_normalizer-0.4.0.tar.gz 38.4 kB With provenance Details for damicore_normalizer-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for damicore-normalizer 0.4.0
File Interpreter ABI Platform Actions
damicore_normalizer-0.4.0-py3-none-any.whl Python 3 none any Details for damicore_normalizer-0.4.0-py3-none-any.whl

Total release size: 83.5 kB

Release files / damicore_normalizer-0.4.0.tar.gz

Download URL damicore_normalizer-0.4.0.tar.gz
Size 38.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6101ca741e58a8844798161fe1d9dfb0cffeab9f128fd8d424a88172f6186865
BLAKE2b-256 checksum
How to use checksums
e2d4d7bcd114cf1c3420e75562be6c21643da4355cb7e270c2dae4c8687b3624
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 13, 2026.

Transparency log

Release files / damicore_normalizer-0.4.0-py3-none-any.whl

Download URL damicore_normalizer-0.4.0-py3-none-any.whl
Size 45.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c153e05bc113c64990ab8700929363797d81fb1adf9664eeb494e0fd678de326
BLAKE2b-256 checksum
How to use checksums
8cf33a3663680cab13b5c8d30e9ca46e0f0aad277e70cbde66109364bd953ea1
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 13, 2026.

Transparency log

Security for damicore-normalizer 0.4.0

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.

Select from 2 files

Attestation for damicore_normalizer-0.4.0.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 13, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page