Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.4.0 #10

Merged
merged 10 commits into from
Nov 28, 2021
3 changes: 3 additions & 0 deletions .github/workflows/package-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
- name: Install package
run: |
python -m pip install .
Expand All @@ -37,5 +38,7 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
env:
BLOCKFROST_PROJECT_ID_MAINNET: ${{ secrets.BLOCKFROST_PROJECT_ID_MAINNET }}
run: |
pytest
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[![Package Test](https://github.com/blockfrost/blockfrost-python/actions/workflows/package-test.yml/badge.svg)](https://github.com/blockfrost/blockfrost-python/actions/workflows/package-test.yml)
[![PyPI Latest Release](https://img.shields.io/pypi/v/blockfrost-python.svg)](https://pypi.org/project/blockfrost-python/)
[![Package Test](https://img.shields.io/github/workflow/status/blockfrost/blockfrost-python/Package%20Test?logo=GitHub&label=package%20test)](https://github.com/blockfrost/blockfrost-python/actions/workflows/package-test.yml)
[![PyPI Latest Release](https://img.shields.io/pypi/v/blockfrost-python.svg?logo=pypi&label=pypi%20latest)](https://pypi.org/project/blockfrost-python/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/blockfrost-python?logo=pypi&label=pypi%20downloads)](https://pypistats.org/packages/blockfrost-python)
[![Package Status](https://img.shields.io/pypi/status/blockfrost-python.svg)](https://pypi.org/project/blockfrost-python/)
[![License](https://img.shields.io/pypi/l/blockfrost-python.svg)](https://github.com/blockfrost/blockfrost-python/blob/master/LICENSE)

[![Made by Five Binaries](https://img.shields.io/badge/made%20by-Five%20Binaries-darkviolet.svg)](https://fivebinaries.com/)
[![Maintained by Mathias Frohlich](https://img.shields.io/badge/maintained%20by-Mathias%20Frohlich-blue.svg)](https://github.com/mathiasfrohlich)

<img src="https://blockfrost.io/images/logo.svg" width="250" align="right" height="90">

Expand All @@ -28,11 +30,10 @@ your API key.
<br/>

## Installation

[![PyPI Latest Release](https://img.shields.io/pypi/v/blockfrost-python.svg)](https://pypi.org/project/blockfrost-python/)
```console
$ pip install blockfrost-python
```

<br/>

## Usage
Expand Down
2 changes: 1 addition & 1 deletion blockfrost/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from blockfrost.api import BlockFrostApi
from blockfrost.ipfs import BlockFrostIPFS
from blockfrost.config import ApiUrls
from blockfrost.utils import ApiError
from blockfrost.utils import ApiError, Namespace
13 changes: 5 additions & 8 deletions blockfrost/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import requests
from dataclasses import dataclass

from ..utils import Api, ApiUrls, object_request_wrapper
from ..utils import Api, ApiUrls, request_wrapper


class BlockFrostApi(Api):
Expand All @@ -13,12 +13,7 @@ def __init__(self, project_id: str = None, base_url: str = None, api_version: st
base_url=base_url if base_url else os.environ.get('BLOCKFROST_API_URL', default=ApiUrls.mainnet.value),
api_version=api_version)

@dataclass
class RootResponse:
url: str
version: str

@object_request_wrapper(RootResponse)
@request_wrapper
def root(self, **kwargs):
"""
Root endpoint has no other function than to point end users to documentation.
Expand Down Expand Up @@ -56,9 +51,11 @@ def root(self, **kwargs):
account_withdrawals, \
account_mirs, \
account_addresses, \
account_addresses_assets
account_addresses_assets, \
account_addresses_total
from .cardano.addresses import \
address, \
address_extended, \
address_total, \
address_utxos, \
address_utxos_asset, \
Expand Down
Loading