PyStrapi
Work with Strapi from Python via REST API
Install
pip install pystrapi
Examples
Quick start:
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:
prospector
Unit tests
pytest test/unittests
Integration tests
Run Strapi test server (see instructions), and run integration tests:
pytest test/integration
Create new release
Push changes to 'main' branch following Conventional Commits.
Metadata
Release files for pystrapi 4.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pystrapi-4.5.0.tar.gz | 9.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pystrapi-4.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.4 kB
Release files / pystrapi-4.5.0.tar.gz
| Download URL | pystrapi-4.5.0.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5928f529b41f704da9db8e3dce97b35b170cc4b11eec71946737f0e1056d6b96
|
|
BLAKE2b-256 checksum How to use checksums |
b8e1264a134da910c1e5c132f1c805b72ad80c2c5e62ca56f3b44a587c5eb8c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.8.13 Linux/5.13.0-1031-azure
|
Release files / pystrapi-4.5.0-py3-none-any.whl
| Download URL | pystrapi-4.5.0-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2672d197372b456665dfde7b50acb44b3538bff13358ed122935512891291ca
|
|
BLAKE2b-256 checksum How to use checksums |
6c87e0767cde2e2b11b5c958aaa333f496a55f5bdfeb2d4a95a1e763a4174fcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.8.13 Linux/5.13.0-1031-azure
|