Package: pyinaturalist-open-data
pyinaturalist-open-dataThis is a work in progress and not yet complete!pyinaturalist-open-datais a python library and CLI tool for working withinaturalist-open-data.
Its goal is to make it easy to import and use this dataset in a python application backed byany SQLAlchemy-compatible database engine(SQLite by default), or simply for local data exploration.See the CLI in action here or onasciinema:InstallationInstall with pip:pip install pyinaturalist-open-dataOr for local development:gitclonehttps://github.com/JWCook/pyinaturalist-open-data.gitcdpyinaturalist-open-data
pipinstallpoetry&&poetryinstallUsageThis package provides the commandpynat. See--helpfor commands and options:Usage: pynat [OPTIONS] COMMAND [ARGS]...

  Commands for working with inaturalist open data

Options:
  -v, --verbose  Show more detailed output
  --help         Show this message and exit.

Commands:
  db    Load contents of CSV files into a database
  dl    Download and extract inaturalist open data archive
  init  Just create tables (if they don't already exist) without populating...
  load  Download and load all data into a database.Run everythingThe simplest command isload, which runs all steps:Download and extract the datasetCreate database tables and indicesLoad the data into the databaseOptions:Usage: pynat load [OPTIONS]

Options:
  -d, --download-dir TEXT  Alternate path for downloads
  -u, --uri TEXT           Alternate database URI to connect to
  --help                   Show this message and exit.By default, this will create a new SQLite database. Alternatively, you can provide a URI forany supported database.Run individual stepsOther commands are available if you only one to run one of those steps at a time.dlcommand:Usage: pynat dl [OPTIONS]

  Download and extract all files in the inaturalist open data archive

Options:
  -d, --download-dir TEXT  Alternate path for downloads
  --help                   Show this message and exitNote:Bothdlandloadwill reuse local data if already exists and is up to date.dbcommand:Usage: pynat db [OPTIONS]

  Load contents of CSV files into a database. Also creates tables and
  indexes, if they don't already exist.

Options:
  -d, --download-dir TEXT         Alternate path for downloads
  -i, --init                      Just initialize the database with tables
                                  + indexes without loading data
  -t, --tables [observation|photo|taxon|user]
                                  Load only these specific tables
  -u, --uri TEXT                  Alternate database URI to connect to

  --help                          Show this message and exit.Note:This can take a long time to run. Depending on the database type, you will likely get
better performance with database-specific bulk loading tools (for example,psqlwithCOPYfor PostgreSQL)Python packageTo use as a python package instead of a CLI tool:frompyinaturalist_open_dataimportdownload_metadata,load_alldownload_metadata()load_all()Full package documentation on readthedocs will be coming soon.Planned featuresSome features I would ideally like to add to this:Performance optimizationsBasic querying featuresImage downloads based on query resultsIntegration withiNaturalist APIdata viapyinaturalistIntegration with CSV data from theiNaturalist export tool