An open API service indexing awesome lists of open source software.

https://github.com/quantmind/metablock-py

An asynchronous Python client for Metablock REST API
https://github.com/quantmind/metablock-py

client metablock

Last synced: 25 days ago
JSON representation

An asynchronous Python client for Metablock REST API

Awesome Lists containing this project

README

          

# A Python Client for Metablock API

[![PyPI version](https://badge.fury.io/py/metablock.svg)](https://badge.fury.io/py/metablock)
[![Python versions](https://img.shields.io/pypi/pyversions/metablock.svg)](https://pypi.org/project/metablock)
[![Build](https://github.com/quantmind/metablock-py/workflows/build/badge.svg)](https://github.com/quantmind/metablock-py/actions?query=workflow%3Abuild)
[![codecov](https://codecov.io/gh/quantmind/metablock-py/branch/main/graph/badge.svg?token=EAdSVpD0Af)](https://codecov.io/gh/quantmind/metablock-py)

This is an asynchronous python client for [metablock API](https://api.metablock.io/v1/docs).

## Installation

This is a simple python package you can install via pip:

```
pip install metablock
```

## Usage

Create the client

```python
from metablock import Metablock

cli = Metablock()

# get the user associated with the API token
user = await cli.get_user()
```

For the authentication token, you can use the `METABLOCK_API_TOKEN` environment variable,
alternatively, you can pass it to the client constructor:

```python
cli = Metablock(auth_key="your-token")
```

## Command line

You can also use the client from the command line, to do so, install the package with the `cli` extra:

```bash
pip install metablock[cli]
```

Then you can use the `metablock` command:

```bash
metablock --help
```