Archivos de diario de enero 2019

21 de enero de 2019

20. oauth2 package for Python, body=str(paramsXML)

I don't know about using the oauth2 package for Python,
body=str(paramsXML) seems a bit suspicious, and I wouldn't be
surprised if the oauth2 package provides a more abstracted interface
to retrieving an access token then specifying all those POST params
like you're doing.

I don't know if it will help, but here's a Python version of one of
our Ruby examples from the docs: The Resource Owner
Password Credentials flow might be more appropriate for scripts like
the one you're writing. The Authorization Code Flow is more for
contexts in which your application interacts with iNat on behalf of
the user, and it needs to get permission to do so without knowing
confidential info like a password.

de link is niet naar de waarneming maar naar de waarnemingen van de gebruiker van een bepaalde soort.
nu is de link bijvoorbeeld
dan kom je op de oude site bij je waarnemingen.
Wil je nu op de site naar je waarnemingen van de deze soort dan is dit de link
dat is de nieuwe site.

It's still in an early stage of development, but pyinaturalist ( can be used to easily upload observations from Python to iNaturalist. See "For authenticated API calls, you first need to obtain a token for the user:" and "Create a new observation" from the link above.

Don't hesitate to ask if you encounter any issue or need a better example (I'm the develope

Publicado el 21 de enero de 2019 por ahospers ahospers | 5 comentarios | Deja un comentario

30 de enero de 2019

21. iNaturalist workflow Flickr Remove GeoTags Upload

How this fits into my iNaturalist workflow

My photo workflow is as follows.

Import photos to Darktable (

Geotag DSLR photos without locations using GPX files (I track where I go using the Cyclemeter app on my iPhone)

Add lots of tags to my photos (dragged onto photos from my big tag library of taxonomy, locations, and other things I've imported from various sources over the years).

This includes the place name, entered as a hierarchical tag in Darktable starting with "Places|", e.g., "Places|New Zealand|South Island|Canterbury|Banks Peninsula|Akaroa harbour|Hinewai Reserve". iNat just needs "Hinewai Reserve".
It also contains heirarchical tags for the notable species in the photo, tagged starting with "Species|" and including EOL machine tags for the higher taxonomy, e.g., "Species|taxonomy:kingdom=Animalia|taxonomy:phylum=Arthropoda|taxonomy:class=Insecta|taxonomy:order=Lepidoptera|taxonomy:family=Erebidae|taxonomy:genus=Nyctemera|taxonomy:binomial=Nyctemera annulata|taxonomy:common=Magpie moth|Magpie moth|Nyctemera annulata". iNat just needs "Nyctemera annulata".
Any tags I want shared as tags in iNaturalist get prefaced with "iNaturalist tag|" (e.g. "iNaturalist tag|Garden").

Any tags I want to become observation field values in iNaturalist ( start with "iNaturalist field|", e.g., "iNaturalist field|Insect life stage=adult" (an observation field needs to already exist on iNat for that to work).
None of my other tags, like the people in the photo, or the event name, or my tags tracking where I've shared a photo, match those Place, Species, or iNaturalist formats.
Export the photos I want to send to iNaturalist to one folder on my computer

Run my bash script '' in the Terminal app on my Mac. It automatically strips out all the tags except those starting with "iNaturalist field|", "iNaturalist tag|", "Species|", and "Places|" from all the photos in the folder, using the awesome power of exiftool (

All those photos are then dragged onto the iNaturalist Add Observation page (, which automatically assigns each observation a species name from my tags, gets any observation field values from my tags, and it adds all my tags as observation tags. The only manual thing to do, if necessary, is to combine multiple photos into single observations. Submit, delete the exported images from my iNaturalist folder, and I'm done.

Useful for other things?

My bash script could be modified for other tag-stripping purposes, as long as the tags you want to keep are consistently labelled.

I'm no programmer

Note that I'm a newbie to bash scripting so I'm sure my code could be written more efficiently. It works though. :-)

Requirements and Disclaimer:

You'll need to have exiftool installed on your computer for the bash script to work (it's free,

The current build assumes that there are no spaces in photo file names

I built this for my own use.
It is not an official product of iNaturalist.
Use at your own risk.

Like Charlie said we strip EXIF to remove potentially sensitive
location data. To do so, we use the imagemagick -strip command, which
sadly just removes ALL metadata. If you or anyone else knows of a way
to selectively strip tags using imagemagick, please let us know. We
could probably do this with exiftool, but I'm loath to add yet another
dependency to iNat if we can achieve this with the tools we have

exiftool \
-Subject="Dermestes lardarius" \
-Subject="Hanmer" \
-Subject="Indoors" \
-Subject="Insect life stage=adult" \
-Subject="Mt Isobel Place" \
-o ~/Downloads/output.jpg \

Publicado el 30 de enero de 2019 por ahospers ahospers | 2 comentarios | Deja un comentario
Vida Silvestre es una entidad asociada a la Organización Mundial de Conservación