Skip to main content

An async client for Movebank's API

Project description

Movebank Client

Introduction

The movebank-client is an unofficial async python client to interact with Movebank's API, developed by the Gundi team of EarthRanger,.

Installation

pip install movebank-client

Usage

from movebank_client import MovebankClient

# You can use it as an async context-managed client
async with MovebankClient(
    base_url="https://www.movebank.mpg.de",
    username="your-user",  
    password="your-password",
) as client:
    # Upload permissions for a study
    async with aiofiles.open("permissions.csv", mode='rb') as perm_file:
        await client.post_permissions(
            study_name="your-study",
            csv_file=perm_file
        )

    # Send tag data to a feed
    async with aiofiles.open("data.json", mode='rb') as tag_data:
        await client.post_tag_data(
            feed_name="gundi/earthranger",
            tag_id="your-tag-id",
            json_file=tag_data
        )

# Or create an instance and close the client explicitly later
client = MovebankClient()
# Send tag data to a feed
async with aiofiles.open("data.json", mode='rb') as tag_data:
    await client.post_tag_data(
        feed_name="gundi/earthranger",
        tag_id="your-tag-id",
        json_file=tag_data
    )
...
await client.close()  # Close the session used to send requests

Using the CLI suite

There are 3 commands to use directly, in order to test Movebank API endpoints and credentials:

  • get-events-for-study: Get Events for a Study
  • get-individual-events: Get Events for an Individual
  • get-study: Get a Study, with option to fetch its individuals

For running the CLI suite help, run:

python cli.py --help

For running specific command help, run:

python cli.py <COMMAND_NAME> --help

All responses will be printed in the terminal as JSON or list responses.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

movebank_client-1.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

movebank_client-1.1.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file movebank_client-1.1.0.tar.gz.

File metadata

  • Download URL: movebank_client-1.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for movebank_client-1.1.0.tar.gz
Algorithm Hash digest
SHA256 34a71740c80c9cf79af205d058d5199d58377c694821e12f1227515d3d5cb84b
MD5 d383ece5aee13fb16f10687c2008a836
BLAKE2b-256 35afe2f57e799fdec5259cb74b3a1a36f67fc29acaeda5919c9957e9c0d07c10

See more details on using hashes here.

Provenance

File details

Details for the file movebank_client-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for movebank_client-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2812f6211da2cf3d3c1e279d7245c8ec30085c8614b9946d92a93c63bfbe46a4
MD5 3fed36894c3f130a69d4fa35aacdb114
BLAKE2b-256 0b8bb0cbf549da7bd3d1d4abda3af13afba10d8d572f2b4e0dc996edb7cce952

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page