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 Studyget-individual-events
: Get Events for an Individualget-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
Release history Release notifications | RSS feed
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.1.tar.gz
(11.8 kB
view details)
Built Distribution
File details
Details for the file movebank_client-1.1.1.tar.gz
.
File metadata
- Download URL: movebank_client-1.1.1.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c9c946a076356087af95a651f169b9b0405d3bc2279a8295b8a16d0c33d9905 |
|
MD5 | f6b7a2eafcfdc5e5cb991535244605fd |
|
BLAKE2b-256 | 446bb320cfedfcc7e2c4f3e29d03f0a19ff788becd56200f75b9fec5f6e860a6 |
File details
Details for the file movebank_client-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: movebank_client-1.1.1-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b78ba7e3ea17a7131c49f940c4c9af081c91af138e9f90b7781563ea3c97119f |
|
MD5 | bee5d424ceb7a420ad0d34fe59f03470 |
|
BLAKE2b-256 | 71e72db7eec64a2116fd8a24c7bb52e8ba6197e877b37dd76d155417bfc8fc36 |