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 installmovebank-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

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.0.0.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

movebank_client-1.0.0-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

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