Skip to main content

dwca-writer

Python package for writing Darwin Core Archives (DwC-A).

Installation

pip install dwca-writer

Quick start

from dwcawriter import Archive, Table
import os
import pandas as pd

df_core = pd.DataFrame(data={
    "occurrenceID": [1, 2, 3],
    "scientificName": ["Abra alba", "Lanice conchilega", "Nereis diversicolor"],
    "notes": ["white", "brown", "green"],
    "year": [2008, 2009, 2010]
})

df_extension = pd.DataFrame(data={
    "id": [1, 2, 3],
    "measurementType": ["temperature", "temperature", "temperature"],
    "measurementValue": [12, 13, 14]
})

archive = Archive()
archive.eml_text = ""

core_table = Table(spec="https://rs.gbif.org/core/dwc_occurrence_2022-02-02.xml", data=df_core, id_index=0, only_mapped_columns=True)
archive.core = core_table

extension_table = Table(spec="https://rs.gbif.org/extension/dwc/measurements_or_facts_2022-02-02.xml", data=df_extension, id_index=0)
archive.extensions.append(extension_table)

print(archive)
Archive with 1 core tables and 1 extension tables
Table of type http://rs.tdwg.org/dwc/terms/Occurrence with 3 rows and 4 columns
  occurrenceID: http://rs.tdwg.org/dwc/terms/occurrenceID (column 1)
  scientificName: http://rs.tdwg.org/dwc/terms/scientificName (column 2)
  notes
  year: http://rs.tdwg.org/dwc/terms/year (column 3)
Table of type http://rs.tdwg.org/dwc/terms/MeasurementOrFact with 3 rows and 3 columns
  id (column 1)
  measurementType: http://rs.tdwg.org/dwc/terms/measurementType (column 2)
  measurementValue: http://rs.tdwg.org/dwc/terms/measurementValue (column 3)
archive.export("dummy.zip")

Release files for dwca-writer 0.2.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 dwca-writer 0.2.0
File Size Uploaded
dwca-writer-0.2.0.tar.gz 238.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dwca-writer 0.2.0
File Interpreter ABI Platform
dwca_writer-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 530.1 kB

Release files / dwca-writer-0.2.0.tar.gz

Download URL dwca-writer-0.2.0.tar.gz
Size 238.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3c7102262cc75202d7747fb4968cc5f122d1555a5e6f61aef76ec86d1b0d621c
BLAKE2b-256 checksum
How to use checksums
b29a48b59651c439791f4a86333d3b291210d20ec0243cef43f66f910b488f0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release files / dwca_writer-0.2.0-py3-none-any.whl

Download URL dwca_writer-0.2.0-py3-none-any.whl
Size 292.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86508d5254f0900c75de7c4e9507e161c58d66e73868fdd6bc3f352c7b869f31
BLAKE2b-256 checksum
How to use checksums
115189c9700cf9ecb3fb44188f3c8de67ccc01b055dcc7e8d5f1c9da29037a29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

2 release files

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.1

1 release file

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