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 write the column files from a fixed
8 MiB buffer and never hold more than max_open_files of them open. 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.
Links
- Repository: https://github.com/delbem-research/damicore
- Issues: https://github.com/delbem-research/damicore/issues
- Documentation: https://github.com/delbem-research/damicore/blob/main/docs/quickstart.md
Licensed under Apache-2.0.
Metadata
Release files for damicore-normalizer 0.7.0
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 |
|---|---|---|---|---|
| damicore_normalizer-0.7.0.tar.gz | 39.9 kB | With provenance | Details for damicore_normalizer-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| damicore_normalizer-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for damicore_normalizer-0.7.0-py3-none-any.whl |
Total release size: 86.6 kB
Release files / damicore_normalizer-0.7.0.tar.gz
| Download URL | damicore_normalizer-0.7.0.tar.gz |
|---|---|
| Size | 39.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
203e65cc18fcd78be7974f0574c130fb1d1d5f6c15bbc4d4410656b131c93078
|
|
BLAKE2b-256 checksum How to use checksums |
f83a6dfe0349db408fd80b2b6e87ff55731b927e26e25dae6300b4d2f20bf1fd
|
| 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 27, 2026.
Transparency logRelease files / damicore_normalizer-0.7.0-py3-none-any.whl
| Download URL | damicore_normalizer-0.7.0-py3-none-any.whl |
|---|---|
| Size | 46.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b52642654e6dc47ae6f67ac8cba18fb4d2c8178a8852ba4cd3276c57c99c324
|
|
BLAKE2b-256 checksum How to use checksums |
1567d543796c4e6970e63651afede8a07a3c807a94acac1d53a3a608856993c9
|
| 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 27, 2026.
Transparency logSecurity for damicore-normalizer 0.7.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.
Attestation for damicore_normalizer-0.7.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 27, 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.