Metadata-Version: 2.1
Name: bancointer
Version: 0.0.8
Summary: Client to consume Banco Inter APIs
Keywords: bancointer
Author-email: Lucas Rangel Cezimbra <lucas@cezimbra.tec.br>
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: attrs==22.1.0
Requires-Dist: requests==2.28.1
Requires-Dist: flit>=3.4 ; extra == "build"
Requires-Dist: myst-parser==0.18.0 ; extra == "docs"
Requires-Dist: Sphinx==5.1.1 ; extra == "docs"
Requires-Dist: sphinx-rtd-theme==1.0.0 ; extra == "docs"
Requires-Dist: bump2version==1.0.1 ; extra == "test"
Requires-Dist: coverage==6.4.4 ; extra == "test"
Requires-Dist: coveralls==3.3.1 ; extra == "test"
Requires-Dist: faker==14.2.1 ; extra == "test"
Requires-Dist: flake8==5.0.4 ; extra == "test"
Requires-Dist: pre-commit==2.20.0 ; extra == "test"
Requires-Dist: pytest==7.1.3 ; extra == "test"
Requires-Dist: pytest-cov==3.0.0 ; extra == "test"
Requires-Dist: pytest-mock==3.8.2 ; extra == "test"
Requires-Dist: responses==0.22.0 ; extra == "test"
Requires-Dist: tox==3.26.0 ; extra == "test"
Project-URL: changelog, https://github.com/lucasrcezimbra/bancointer/blob/main/CHANGELOG.md
Project-URL: documentation, https://bancointer.readthedocs.io/
Project-URL: homepage, https://github.com/lucasrcezimbra/bancointer
Project-URL: repository, https://github.com/lucasrcezimbra/bancointer
Provides-Extra: build
Provides-Extra: docs
Provides-Extra: test

# Banco Inter


[![PyPI](https://img.shields.io/pypi/v/bancointer.svg)](https://pypi.python.org/pypi/bancointer)
[![Coverage Status](https://coveralls.io/repos/github/lucasrcezimbra/bancointer/badge.svg?branch=master)](https://coveralls.io/github/lucasrcezimbra/bancointer?branch=master)
[![Documentation Status](https://readthedocs.org/projects/bancointer/badge/?version=latest)](https://bancointer.readthedocs.io/en/latest/?version=latest)

Client to consume Banco Inter APIs

* Documentation: https://bancointer.readthedocs.io.


## Installation

```bash
pip install bancointer
```


## How to Use

### High-level API
```python
from inter import Inter


inter = Inter(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET"
    cert_path='/path/to/certificado.crt',
    key_path='/path/to/chave.key',
)

# get September/2022 statements
inter.get_statements(date(2022, 9, 1), date(2022, 9, 30))
```

#### Testing
```python
from inter.testing import InterFake


def my_function(inter):
    return inter.get_balance()


def test_my_function():
    inter = InterFake()

    result = my_function(inter)

    assert result == inter.balance
```

### Low-level API
```python
from datetime import date

from inter import Client as Inter


inter = Inter(
    "YOUR_CLIENT_ID",
    "YOUR_CLIENT_SECRET"
    '/path/to/certificado.crt',
    '/path/to/chave.key',
)

# get September/2022 statements
inter.get_statements(date(2022, 9, 1), date(2022, 9, 30))
```

#### Testing
```python
from inter.testing import ClientFake


def my_function(client):
    return client.get_balance()


def test_my_function():
    client = ClientFake()

    result = my_function(client)

    assert result == client.balance
```




## Contributing

Contributions are welcome, feel free to open an Issue or Pull Request.

Pull requests must be for the `develop` branch.

```
git clone https://github.com/lucasrcezimbra/bancointer
cd bancointer
git checkout develop
python -m venv .venv
source .venv/bin/activate
pip install .[test]
pre-commit install
pytest
```

