Skip to content

Commit 13da694

Browse files
Merge pull request #10 from blockfrost/rebuild-object-mapping
0.4.0
2 parents 8f9885b + ce0d67e commit 13da694

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1160
-1455
lines changed

.github/workflows/package-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
python -m pip install --upgrade pip
2828
python -m pip install flake8 pytest
2929
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30+
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
3031
- name: Install package
3132
run: |
3233
python -m pip install .
@@ -37,5 +38,7 @@ jobs:
3738
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3839
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3940
- name: Test with pytest
41+
env:
42+
BLOCKFROST_PROJECT_ID_MAINNET: ${{ secrets.BLOCKFROST_PROJECT_ID_MAINNET }}
4043
run: |
4144
pytest

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
[![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)
2-
[![PyPI Latest Release](https://img.shields.io/pypi/v/blockfrost-python.svg)](https://pypi.org/project/blockfrost-python/)
1+
[![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)
2+
[![PyPI Latest Release](https://img.shields.io/pypi/v/blockfrost-python.svg?logo=pypi&label=pypi%20latest)](https://pypi.org/project/blockfrost-python/)
3+
[![PyPI - Downloads](https://img.shields.io/pypi/dm/blockfrost-python?logo=pypi&label=pypi%20downloads)](https://pypistats.org/packages/blockfrost-python)
34
[![Package Status](https://img.shields.io/pypi/status/blockfrost-python.svg)](https://pypi.org/project/blockfrost-python/)
45
[![License](https://img.shields.io/pypi/l/blockfrost-python.svg)](https://github.com/blockfrost/blockfrost-python/blob/master/LICENSE)
5-
6+
[![Made by Five Binaries](https://img.shields.io/badge/made%20by-Five%20Binaries-darkviolet.svg)](https://fivebinaries.com/)
7+
[![Maintained by Mathias Frohlich](https://img.shields.io/badge/maintained%20by-Mathias%20Frohlich-blue.svg)](https://github.com/mathiasfrohlich)
68

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

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

3032
## Installation
31-
33+
[![PyPI Latest Release](https://img.shields.io/pypi/v/blockfrost-python.svg)](https://pypi.org/project/blockfrost-python/)
3234
```console
3335
$ pip install blockfrost-python
3436
```
35-
3637
<br/>
3738

3839
## Usage

blockfrost/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from blockfrost.api import BlockFrostApi
22
from blockfrost.ipfs import BlockFrostIPFS
33
from blockfrost.config import ApiUrls
4-
from blockfrost.utils import ApiError
4+
from blockfrost.utils import ApiError, Namespace

blockfrost/api/__init__.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import requests
33
from dataclasses import dataclass
44

5-
from ..utils import Api, ApiUrls, object_request_wrapper
5+
from ..utils import Api, ApiUrls, request_wrapper
66

77

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

16-
@dataclass
17-
class RootResponse:
18-
url: str
19-
version: str
20-
21-
@object_request_wrapper(RootResponse)
16+
@request_wrapper
2217
def root(self, **kwargs):
2318
"""
2419
Root endpoint has no other function than to point end users to documentation.
@@ -56,9 +51,11 @@ def root(self, **kwargs):
5651
account_withdrawals, \
5752
account_mirs, \
5853
account_addresses, \
59-
account_addresses_assets
54+
account_addresses_assets, \
55+
account_addresses_total
6056
from .cardano.addresses import \
6157
address, \
58+
address_extended, \
6259
address_total, \
6360
address_utxos, \
6461
address_utxos_asset, \

0 commit comments

Comments
 (0)