Skip to main content

The following “ornitho controllers / calls” are implemented:

  • taxonomic groups

    • List taxo groups

    • Get a single taxo group

  • families

    • List families

    • Get a single family

  • species

    • List species

    • Get a single species

  • territorial units

    • List territorial units

    • Get a single territorial unit

  • local admin units

    • List local admin units

    • Get a single local admin unit

  • places

    • List places

    • Get a single place

  • observers

    • List Observers

    • Get a single observer

    • Get an observer rights list

    • Get current observers info

  • entities

    • List entities

    • Get a single entity

  • protocol

    • List protocol

    • Get a single protocol

    • Get list of sites for protocol id

    • Get PDF for site id

  • observations

    • List observations

    • Get a single observation

    • Create an observation

    • Update an observations

    • Delete an observations

    • Search an observation

    • Search update or deletion since a given date

    • Delete a record

    • Delete a list

  • fields

    • List fields

    • Get a single field options

  • media

    • Get a single media

Not yet Implemented:

  • local admin units

    • Search local admin units

  • export organizations

    • List export organizations

    • Get a single export organization

  • observations

    • Search closest observations

    • Search last observations

    • Search rare observations

    • Search my observations

    • Search observations from a list of observers

    • Search observations from a list of coordinates

    • Search resources linked to an observation

    • Create a new resources for an observation

  • import files

    • List import files

    • Get a single import file

  • import files/observations

    • List links for import files and observations

    • Get a single link between import file and observation

  • validations

    • List validations

    • Get a single validation

  • mortality information

    • List mortality informations

  • bearded vulture birds

    • List all bearded vulture birds

    • Get a single bird

  • bearded vulture information

    • List bearded vulture informations

  • observations by polygon

    • List observations_by_polygon

    • Get a single family

    • Get a single group

  • polygons

    • Get a single polygon

    • List polygons from a group

    • List polygon groups

    • List cache for a given polygon or group with a period

    • List form cache for a given polygon or group with a period

    • List species form cache for a given polygon or group with a period

    • List observer cache for a given polygon or group

    • List observer species cache for a given polygon or group

Installing

The project is published on PyPI, and can be install using pip or any other package manager:

$ pip install ornitho

Manual installation can be done with following command:

$ pip install .

Optional caching dependency can be installed with

$ pip install ornitho[caching]

Usage

Before the client can be used consumer_key, consumer_secret, user_email, user_pw and api_base must be set:

import ornitho

ornitho.consumer_key = "CONSUMER_KEY"
ornitho.consumer_secret = "CONSUMER_SECRET"
ornitho.user_email = "USER_MAIL"
ornitho.user_pw = "USER_PASSWORD"
ornitho.api_base = "https://www.ornitho.de/api/"

The client can then be used.

Caching

If the additional caching dependency is installed, non chunked responses can be cached. For activating the cache one has to set the cache_enabled flag. Following settings are available:

ornitho.cache_enabled = True          # Enable/Disable caching
ornitho.cache_name = "ornitho_cache"  # Name of the cache
ornitho.cache_backend = "redis"       # Set caching backend, possible values: sqlite, memory, mongodb, redis
ornitho.cache_expire_after = 600      # Set expiration time for cached responses

For more information see the requests-cache documentation

Examples

Following code shows how to get all observation from ornitho.de between 01.10.2019 and 31.10.2019:

import os
import ornitho

ornitho.consumer_key = os.environ.get("ORNITHO_CONSUMER_KEY")
ornitho.consumer_secret = os.environ.get("ORNITHO_CONSUMER_SECRET")
ornitho.user_email = os.environ.get("ORNITHO_USER_EMAIL")
ornitho.user_pw = os.environ.get("ORNITHO_USER_PW")
ornitho.api_base = "https://www.ornitho.de/api/"

resp = ornitho.Observation.search_all(period_choice="range", date_from="01.10.2019", date_to="31.10.2019")
print(f"Found {len(resp)} observations between 01.10.2019 and 31.10.2019")

More examples can be found the examples folder.

Prerequisites

The project has been tested with the following python versions:

  • Python 3.7

  • Python 3.8

  • Python 3.9

  • Python 3.10

Collaborate

Any kind of help with the project will be well received, and there are two main ways to give such help:

  • Reporting errors and asking for extensions through the issues management

  • or forking the repository and extending the project

Issues management

Issues are managed at the Github project issues tracker, where any Github user may report bugs or ask for new features.

Testing

The tests included with the project can be run with:

$ pytest

or with a coverage report:

$ pytest --cov=ornitho tests/

To test all supported Python versions, use tox:

$ tox

License

The project has been released under the MIT License.

Metadata

Release files for ornitho 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ornitho 0.3.0
File Size Uploaded Provenance Actions
ornitho-0.3.0.tar.gz 32.4 kB Without provenance Details for ornitho-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ornitho 0.3.0
File Interpreter ABI Platform Actions
ornitho-0.3.0-py3-none-any.whl Python 3 none any Details for ornitho-0.3.0-py3-none-any.whl

Total release size: 75.0 kB

Release files / ornitho-0.3.0.tar.gz

Download URL ornitho-0.3.0.tar.gz
Size 32.4 kB
Tags Source
SHA-256 checksum
How to use checksums
da7cc1c398788f01c36b9d7a63b703c74a79c6f13b234622829bed7b98c5f31e
BLAKE2b-256 checksum
How to use checksums
f296a00b562e7629e86d85d72ba86e3631501bfeba9b78db04c76189c9a10407
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.2 Linux/5.15.21-1-MANJARO

Release files / ornitho-0.3.0-py3-none-any.whl

Download URL ornitho-0.3.0-py3-none-any.whl
Size 42.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53a9c1bcdbca16de26b634dfa1da09e6c3fb80085cd2e316d05a082d9e1e27e7
BLAKE2b-256 checksum
How to use checksums
ac50bcd8b1e3e09daa179cdb5a954524692c8c74ea182271a65ff80045673641
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.2 Linux/5.15.21-1-MANJARO

Security for ornitho 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page