Metadata-Version: 2.4
Name: polars-darwin-core
Version: 4.1.0
Summary: Helpers for working with Darwin Core (DwC) CSVs using Polars.
Project-URL: Homepage, https://github.com/frewsxcv/polars-darwin-core
Author-email: Corey Farwell <coreyf@rwell.org>
License-Expression: Apache-2.0 OR MIT
Keywords: biodiversity,csv,darwin-core,gbif,polars
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: polars>=0.30
Description-Content-Type: text/markdown

# polars-darwin-core

Helpers for working with [Darwin Core](https://dwc.tdwg.org/) CSV data using [polars](https://pola.rs/).

## Usage

### Reading a single Darwin Core CSV file

```python
from polars_darwin_core import DarwinCoreLazyFrame

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

### Working with Darwin Core Archives (DwC-A)

```python
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

```shell
# 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](https://peps.python.org/pep-0517/) build flow via [Hatch](https://hatch.pypa.io/):

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