Helpers for working with Darwin Core (DwC) CSVs using Polars.
Python 100%
<1%

README.md

polars-darwin-core #

Helpers for working with Darwin Core CSV data using polars.

Usage #

Reading a single Darwin Core CSV file #

from polars_darwin_core import DarwinCoreLazyFrame

lf = DarwinCoreLazyFrame.from_csv("occurrence.csv")
print(lf.collect())

Working with Darwin Core Archives (DwC-A) #

import polars as pl
from polars_darwin_core import DarwinCoreLazyFrame

# Path to an unpacked Darwin Core Archive directory (containing meta.xml)
archive_path = "path/to/dwc/archive"

# Load the core file from the archive
lf = DarwinCoreLazyFrame.from_archive(archive_path)

# Work with the data
df = lf.filter(pl.col("kingdom") == "Animalia").collect()
print(df)

Development #

# Create a virtualenv however you prefer, then:
pip install -e .[dev]

# Run the test-suite
python -m unittest

The project follows the standard PEP 517 build flow via Hatch:

python -m build    # create sdist and wheel in ./dist/