Metadata-Version: 2.1
Name: berapi
Version: 0.1.1
Summary: An API client for simplifying API testing with Python + PyTest
License: MIT
Author: fachrulch
Author-email: fachrul.fch@gmail.com
Requires-Python: >=3.13,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: assertpy (>=1.1,<2.0)
Requires-Dist: curlify (>=2.2.1,<3.0.0)
Requires-Dist: jsonschema (>=4.23.0,<5.0.0)
Requires-Dist: requests (>=2.32.3,<3.0.0)
Description-Content-Type: text/markdown

# 🔥 berAPI 🔥
An API client for simplifying API testing with Python + PyTest

## Features
- Builtin curl API in the `pytest-html` report
- Easy to import the API logs into Postman/curl
- Multiple common assertions to a single request

![Report](berapi-report.gif)

## Installation
```bash
pip3 install berapi
```

## How to use
```python
from berapi.apy import berAPI

def test_simple():
    url = 'https://swapi.dev/api/people/1'
    api = berAPI()
    response = api.get(url).assert_2xx().parse_json()
    assert response['name'] == 'Luke Skywalker'

def test_chaining():
    (berAPI()
     .get('https://swapi.dev/api/people/1')
     .assert_2xx()
     .assert_value('name', 'Luke Skywalker')
     .assert_response_time_less_than(seconds=1)
     )
```
make sure pytest.ini is having output log
```ini
[pytest]
log_cli_level = INFO
```

### Install Development

```bash
pip install poetry
pip install pytest
pip install pytest-html
```
