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.2.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

movebank_client-1.2.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: movebank_client-1.2.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for movebank_client-1.2.0.tar.gz
Algorithm Hash digest
SHA256 0502d3a29c9708be15460be332ebdf9c42800be9b8868cddbf1eb289e582bec0
MD5 a6d55cd234a3480c9e635a4b484bb971
BLAKE2b-256 2a6c8f638112f570682800436a11acf45dc1df49b6e0f19036810ceeaa07e58c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for movebank_client-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce56c9fc2a0d598477117babf5d1184325e7111ed111be33c70ea9e57bade62f
MD5 0ca63f26c0d6ccb489a10c1d3f11f584
BLAKE2b-256 15cf80deb84efb8a6f8210728600bf2aa03878de29b8a45341a2a744f8fa9565

See more details on using hashes here.

Supported by

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