Name | movebank-client JSON |
Version |
1.1.1
JSON |
| download |
home_page | None |
Summary | An async client for Movebank's API |
upload_time | 2024-11-20 19:42:21 |
maintainer | None |
docs_url | None |
author | Chris Doehring |
requires_python | <4.0,>=3.7 |
license | Apache-2.0 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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](https://www.earthranger.com/),.
## Installation
```bash
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:
```bash
python cli.py --help
```
For running specific command help, run:
```bash
python cli.py <COMMAND_NAME> --help
```
All responses will be printed in the terminal as JSON or list responses.
Raw data
{
"_id": null,
"home_page": null,
"name": "movebank-client",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Chris Doehring",
"author_email": "chrisdo@earthranger.com",
"download_url": "https://files.pythonhosted.org/packages/44/6b/b320cfedfcc7e2c4f3e29d03f0a19ff788becd56200f75b9fec5f6e860a6/movebank_client-1.1.1.tar.gz",
"platform": null,
"description": "# Movebank Client\n## Introduction\nThe movebank-client is an unofficial async python client to interact with Movebank's API, developed by the Gundi team of [EarthRanger](https://www.earthranger.com/),.\n\n## Installation\n\n```bash\npip install movebank-client\n```\n\n## Usage\n```\nfrom movebank_client import MovebankClient\n\n# You can use it as an async context-managed client\nasync with MovebankClient(\n base_url=\"https://www.movebank.mpg.de\",\n username=\"your-user\", \n password=\"your-password\",\n) as client:\n # Upload permissions for a study\n async with aiofiles.open(\"permissions.csv\", mode='rb') as perm_file:\n await client.post_permissions(\n study_name=\"your-study\",\n csv_file=perm_file\n )\n\n # Send tag data to a feed\n async with aiofiles.open(\"data.json\", mode='rb') as tag_data:\n await client.post_tag_data(\n feed_name=\"gundi/earthranger\",\n tag_id=\"your-tag-id\",\n json_file=tag_data\n )\n\n# Or create an instance and close the client explicitly later\nclient = MovebankClient()\n# Send tag data to a feed\nasync with aiofiles.open(\"data.json\", mode='rb') as tag_data:\n await client.post_tag_data(\n feed_name=\"gundi/earthranger\",\n tag_id=\"your-tag-id\",\n json_file=tag_data\n )\n...\nawait client.close() # Close the session used to send requests\n```\n\n### Using the CLI suite\n\nThere are 3 commands to use directly, in order to test Movebank API\nendpoints and credentials:\n- `get-events-for-study`: Get Events for a Study\n- `get-individual-events`: Get Events for an Individual\n- `get-study`: Get a Study, with option to fetch its individuals\n\nFor running the CLI suite help, run:\n\n```bash\npython cli.py --help\n```\n\nFor running specific command help, run:\n\n```bash\npython cli.py <COMMAND_NAME> --help\n```\nAll responses will be printed in the terminal as JSON or list responses. \n\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "An async client for Movebank's API",
"version": "1.1.1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "71e72db7eec64a2116fd8a24c7bb52e8ba6197e877b37dd76d155417bfc8fc36",
"md5": "bee5d424ceb7a420ad0d34fe59f03470",
"sha256": "b78ba7e3ea17a7131c49f940c4c9af081c91af138e9f90b7781563ea3c97119f"
},
"downloads": -1,
"filename": "movebank_client-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bee5d424ceb7a420ad0d34fe59f03470",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.7",
"size": 12782,
"upload_time": "2024-11-20T19:42:20",
"upload_time_iso_8601": "2024-11-20T19:42:20.483736Z",
"url": "https://files.pythonhosted.org/packages/71/e7/2db7eec64a2116fd8a24c7bb52e8ba6197e877b37dd76d155417bfc8fc36/movebank_client-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "446bb320cfedfcc7e2c4f3e29d03f0a19ff788becd56200f75b9fec5f6e860a6",
"md5": "f6b7a2eafcfdc5e5cb991535244605fd",
"sha256": "7c9c946a076356087af95a651f169b9b0405d3bc2279a8295b8a16d0c33d9905"
},
"downloads": -1,
"filename": "movebank_client-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "f6b7a2eafcfdc5e5cb991535244605fd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.7",
"size": 11799,
"upload_time": "2024-11-20T19:42:21",
"upload_time_iso_8601": "2024-11-20T19:42:21.561425Z",
"url": "https://files.pythonhosted.org/packages/44/6b/b320cfedfcc7e2c4f3e29d03f0a19ff788becd56200f75b9fec5f6e860a6/movebank_client-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-20 19:42:21",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "movebank-client"
}