Create and edit projects using code

I want to know if all of these are possible.
How do I:

  • Create a new project, e.g. download all the places specified in all the individual projects under an Umbrella project, and make a new Collection project whose filters include all these places
  • Edit the front text of a project, e.g. inserting a certain text into all projects, such as a link to the Umbrella project containing them inserted in every Collection project inside it.
  • Set the colour of a project, e.g. assign to each project on a list a different banner colour (from a list of hex codes)

I am the owner of these projects. I want to know if this can be done programmatically.
I have some python experience but nothing with APIs or web stuff. (I am about to learn some JS).

I do not want to download data, just change the place filters, banner colour and header text.

I looked into the ‘API’ docs that I could find for iNat, and I gather that it is easy to search for projects given some criteria, like a location they must contain, but not possible to change the place filters, and there was no mention of editing the banner text.

see https://forum.inaturalist.org/t/edit-project-breaks-entirely-for-project-with-undefined-user/30070/13

1 Like

I don’t know about this specific scenario (which sounds like turning an umbrella project into a single collection project), but you can duplicate existing projects.

https://pyinaturalist.readthedocs.io/en/stable/modules/pyinaturalist.v1.projects.html
There are functions for updating the user list in the project observation rules, but none for place. In your link you help that person update the user list in the project observations rules, but not the place list.

I read about 3 versions of this and they all list the same functions. So I’m asking if there is any way to specify/edit the place list specifically, or is it more complicated than using these functions (if it exists).

One thing I want to do is make an equivalent collection project, starting with an umbrella project (many times). Making a duplicate would be nice - if then you could turn the duplicate into a collection project.

Another is to add some text and/or urls into existing projects, e.g. the url for a blog post describing all the projects inserted into many projects that I have already.

The third is to a) download a list of the colours already used in a group of projects and b) specify the colour for new projects.

just make a dummy project, update the project criteria, save it, and look at the developer tools in your browser to see what the screen sends to the API.

for place inclusion criteria, operator is observed_in_place? and operand_type is Place.

if you want to use pyiNaturalist for whatever reason, and it doesn’t already have functions to handle place criteria, you could ask the developer to add some functions to handle that.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.