Skip to content

Instantly share code, notes, and snippets.

@barnabywalters
Last active April 4, 2022 14:27
Show Gist options
  • Save barnabywalters/e87421492b3475277af1295a5a3b88e9 to your computer and use it in GitHub Desktop.
Save barnabywalters/e87421492b3475277af1295a5a3b88e9 to your computer and use it in GitHub Desktop.
file: 2021-06-timberlake.csv
# context_query is used to provide context for links to lists of observations when there’s no inat project providing that context.
# If you do have a project with date and place bounds, leave out context_query and use
# project: your-project-id
# instead.
context_query: 'd1=2021-06-11&d2=2021-06-13&place_id=118103'
locale: en
root_header_level: 2
places:
# Places MUST be in smallest to biggest order, id: global MUST be last in list.
- id: '118103'
col: timberlake
observation_threshold: 5
first_text: First local observation!
# - id: ''
# col: county
# observation_threshold: 5
# first_text: First County observation!
- id: '18'
col: tx
observation_threshold: 5
first_text: First Texas observation!
# - id: '1'
# col: us
# observation_threshold: 5
# first_text: First USA observation!
- id: global
observation_threshold: 10
name: 'iNaturalist Global'
first_text: First iNaturalist observation!
inaturalist-project-stats/
(scripts etc.)
data/
project-name/ (e.g. timberlake)
config.yaml
data-from-inat-export.csv (set name to file key in config.yaml so the script can find it)
You’ll need to make the data folder, the project folder(s), and config.yaml files yourself, based on the template above.
Download the data relevant to your project from https://www.inaturalist.org/observations/export — the script doesn’t need
all the columns, but the default settings should work.
Running the analysis for a particular project with:
python uniquely_observed_species_api.py project-name
will produce an output/ folder in that project with separate HTML files for each analysis. It also gives you a species.csv
file which contains a lot of the information used internally for creating the output, and which you can use for further analysis.
When completed, the script leaves you in a IPython shell with all the internal data available, so you can do further analysis
without reconstructing everything. To end the script, press control+D to exit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment