# 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/
```
Raw data
{
"_id": null,
"home_page": null,
"name": "polars-darwin-core",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "biodiversity, csv, darwin-core, gbif, polars",
"author": null,
"author_email": "Corey Farwell <coreyf@rwell.org>",
"download_url": "https://files.pythonhosted.org/packages/7a/e8/728edc1e8f0417d637e95a36e907b032e2afb5341a6e7f9e033bb7acdf54/polars_darwin_core-4.0.0.tar.gz",
"platform": null,
"description": "# polars-darwin-core\n\nHelpers for working with [Darwin Core](https://dwc.tdwg.org/) CSV data using [polars](https://pola.rs/).\n\n## Usage\n\n### Reading a single Darwin Core CSV file\n\n```python\nfrom polars_darwin_core import DarwinCoreLazyFrame\n\nlf = DarwinCoreLazyFrame.from_csv(\"occurrence.csv\")\nprint(lf.collect())\n```\n\n### Working with Darwin Core Archives (DwC-A)\n\n```python\nimport polars as pl\nfrom polars_darwin_core import DarwinCoreLazyFrame\n\n# Path to an unpacked Darwin Core Archive directory (containing meta.xml)\narchive_path = \"path/to/dwc/archive\"\n\n# Load the core file from the archive\nlf = DarwinCoreLazyFrame.from_archive(archive_path)\n\n# Work with the data\ndf = lf.filter(pl.col(\"kingdom\") == \"Animalia\").collect()\nprint(df)\n```\n\n## Development\n\n```shell\n# Create a virtualenv however you prefer, then:\npip install -e .[dev]\n\n# Run the test-suite\npython -m unittest\n```\n\nThe project follows the standard [PEP 517](https://peps.python.org/pep-0517/) build flow via [Hatch](https://hatch.pypa.io/):\n\n```shell\npython -m build # create sdist and wheel in ./dist/\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Helpers for working with Darwin Core (DwC) CSVs using Polars.",
"version": "4.0.0",
"project_urls": {
"Homepage": "https://github.com/frewsxcv/polars-darwin-core"
},
"split_keywords": [
"biodiversity",
" csv",
" darwin-core",
" gbif",
" polars"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "eaa60086b0add0e6e665f1a6de37e7be1573b2a58704f3ca66b0b3ba5eb33fc1",
"md5": "53437c8c3998c4d360a5ef83e5bcae65",
"sha256": "53171cb6ddd2a7d229b5f05b87677f9c9262806aaf9e4587315d1410a4390213"
},
"downloads": -1,
"filename": "polars_darwin_core-4.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "53437c8c3998c4d360a5ef83e5bcae65",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 6874,
"upload_time": "2025-09-06T03:22:25",
"upload_time_iso_8601": "2025-09-06T03:22:25.323068Z",
"url": "https://files.pythonhosted.org/packages/ea/a6/0086b0add0e6e665f1a6de37e7be1573b2a58704f3ca66b0b3ba5eb33fc1/polars_darwin_core-4.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7ae8728edc1e8f0417d637e95a36e907b032e2afb5341a6e7f9e033bb7acdf54",
"md5": "f86ad261484c1015eba85e28b9bdaa27",
"sha256": "7038d0d02c4fe662451bf3feb25414266ee61aa7f9ea5c6786be862b1f49892f"
},
"downloads": -1,
"filename": "polars_darwin_core-4.0.0.tar.gz",
"has_sig": false,
"md5_digest": "f86ad261484c1015eba85e28b9bdaa27",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 1850386,
"upload_time": "2025-09-06T03:22:27",
"upload_time_iso_8601": "2025-09-06T03:22:27.031499Z",
"url": "https://files.pythonhosted.org/packages/7a/e8/728edc1e8f0417d637e95a36e907b032e2afb5341a6e7f9e033bb7acdf54/polars_darwin_core-4.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-06 03:22:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "frewsxcv",
"github_project": "polars-darwin-core",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "polars-darwin-core"
}