Skip to main content

Convert iNaturalist observation data to and from multiple formats

Project description

pyinaturalist-convert

Build status Codecov Docs PyPI Conda PyPI - Python Versions

This package provides tools to convert iNaturalist observation data to and from a wide variety of useful formats. This is mainly intended for use with the iNaturalist API (via pyinaturalist), but also works with other data sources.

Complete project documentation can be found at pyinaturalist-convert.readthedocs.io.

Formats

Import formats currently supported:

Import formats with partial support:

Export formats currently supported:

  • CSV, Excel, and anything else supported by tablib
  • Feather, Parquet, and anything else supported by pandas
  • GeoJSON and GPX
  • Darwin Core

Installation

Install with pip:

pip install pyinaturalist-convert

Or with conda:

conda install -c conda-forge pyinaturalist-convert

To keep things modular, many format-specific dependencies are not installed by default, so you may need to install some more packages depending on which formats you want. See pyproject.toml for the full list (TODO: docs on optional dependencies).

To install all of the things:

pip install pyinaturalist-convert[all]

Usage

Export

Get your own observations and save to CSV:

from pyinaturalist import get_observations
from pyinaturalist_convert import *

observations = get_observations(user_id='my_username')
to_csv(observations, 'my_observations.csv')

Or any other supported format:

to_dwc(observations, 'my_observations.dwc')
to_excel(observations, 'my_observations.xlsx')
to_feather(observations, 'my_observations.feather')
to_gpx(observations, 'my_observations.gpx')
to_hdf(observations, 'my_observations.hdf')
to_parquet(observations, 'my_observations.parquet')
df = to_dataframe(observations)
geo_obs = to_geojson(observations)

Import

Load your observations from the iNat Export tool, convert to be consistent with API results, and save to Parquet:

df = load_csv_exports('my_observations.csv')
df.to_parquet('my_observations.parquet')

Download

Download the complete research-greade observations dataset:

download_dwca()

Or the complete taxonomy dataset:

download_dwca_taxa()

Load taxonomy and common name data into a full text search database:

load_taxon_fts_table(languages=['english', 'german'])

And get lightning-fast autocomplete results from it:

ta = TaxonAutocompleter()
ta.search('aves')
ta.search('flughund', language='german')

Planned and Possible Features

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyinaturalist-convert-0.3.0.tar.gz (282.7 kB view details)

Uploaded Source

Built Distribution

pyinaturalist_convert-0.3.0-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

Details for the file pyinaturalist-convert-0.3.0.tar.gz.

File metadata

  • Download URL: pyinaturalist-convert-0.3.0.tar.gz
  • Upload date:
  • Size: 282.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0a2 CPython/3.10.4 Linux/5.13.0-1022-azure

File hashes

Hashes for pyinaturalist-convert-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d1e94d937fb00e095e4cf28b5a57037936cac63b6428601d8426fc03d1c030ee
MD5 52f6ce717ae069e41cc12ff505fdd8cb
BLAKE2b-256 4e19ba7856b5a401634f8954f187a02254561a885c1e2a79f81670f35015088c

See more details on using hashes here.

File details

Details for the file pyinaturalist_convert-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyinaturalist_convert-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 925f3a368ca112eef7beb695794c209bd9cf92adeeb3d1b0108fddd0642d2325
MD5 5d0085cdfd140b37b6b6f0157b1fab2a
BLAKE2b-256 9f033d7fdfa29738a7d2eaa13a4b7ce8ff76aee3ea3013cf8e534d693a0aed17

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page