Metadata-Version: 2.1
Name: pystrapi
Version: 4.1.0
Summary: Work with Strapi from Python via REST API
Home-page: https://github.com/NoamNol/py-strapi
License: MIT
Keywords: strapi,cms,api,rest
Author: Noam Nol
Author-email: noamnol19@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: aiohttp
Requires-Dist: requests (>=2.25.0,<3.0.0)
Requires-Dist: urllib3 (>=1.26.9,<2.0.0)
Project-URL: Repository, https://github.com/NoamNol/py-strapi
Description-Content-Type: text/markdown

# PyStrapi
![CI](https://github.com/NoamNol/py-strapi/workflows/CI/badge.svg?event=push)
![Build and release](https://github.com/NoamNol/py-strapi/workflows/%F0%9F%9A%80%20Build%20and%20release/badge.svg?event=push)
[![PyPI version](https://badge.fury.io/py/pystrapi.svg)](https://pypi.org/project/pystrapi)
![pyversions](https://img.shields.io/pypi/pyversions/pystrapi)

Work with Strapi from Python via REST API

## Install

```bash
pip install pystrapi
```

## Examples

Quick start:

```python
import asyncio
from pystrapi import StrapiClient

async def main():
    strapi = StrapiClient(api_url=strapi_url)
    await strapi.authorize(your_identifier, your_password) # optional
    users = await strapi.get_entries('users', filters={'username': {'$eq': 'Pavel'}})
    user_id = users['data'][0]['id']
    await strapi.update_entry('users', user_id, data={'username': 'Mark'})

asyncio.run(main())
```

## Development
### Install environment:
```
python -m venv .env
source .env/bin/activate
poetry install
```

### Lint
Run [prospector](https://prospector.landscape.io/):
```
prospector
```

### Unit tests
```
pytest test/unittests
```

### Integration tests
Run Strapi test server (see [instructions](testserver/README.md)), and run integration tests:
```
pytest test/integration
```

### Create new release

Push changes to 'main' branch following [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).


