GithubHelp home page GithubHelp logo

artdatabanken-utils's Introduction

artdatabanken-utils

Assorted tools to interact with Artdatabankens API:s. As of February 13, there are five API:s described here: https://api-portal.artdatabanken.se/docs/services.

Requirements

It is developed with Python 3.6. The current dependencies are to Python3 standard modules and 'requests'. See below.

About the utils

There are two main components:

  • obsapi.py is a Python module for invoking the "Species Observation System API".
  • adb-get.py is a Python CLI-program for making calls to the "Artfakta - Species information API", the "Species Observation System API" and an older "Observations Sandbox API".

Note that use of all of the above API:S require you to have API-keys for each API.

There is also Postman API collections resource that can be imported into Postman for trying out some API calls.

Development

Set up the development environment with:

  1. Clone the git repo.
  2. Create a virtual env:
$ virtualenv -p python3 env
  1. Jump into the virtual env:
$ source env/bin/activate
  1. Install dependent packages with:
$ pip install -r requirements.txt
  1. Start hacking!

Usage

If you want to know what adb-get.py can do, without reading the source code, run it with:

$ ./adb-get.py -h

To get the first 200 observations of Tajgasångare or Yellow-browed warbler (Phylloscopus inornatus), with Artdatabanken taxon id 205835, since 1900-01-01 do:

$ ./adb-get.py --get-observations --taxon-id=205835

Or get them by taxon name with:

$ ./adb-get.py --get-observations --taxon-name=Tajgasångare

You can pass your API keys as options with the --species-api-key and the --observations-api-key, but it is easier to set them as environment variables:

$ export ADB_SPECIES_API_KEY=<YOUR-SPECIES-API-KEY>
$ export ADB_OBSERVATIONS_SANDBOX_API_KEY=<YOUR-OBSERVATIONS-SANDBOX-API-KEY>
$ export ADB_OBSERVATIONS_API_KEY=<YOUR_OBSERVATIONS-API-KEY>

so you don't have to provide them as options each time you invoke adb-get.py.

artdatabanken-utils's People

Contributors

pacoispaco avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.