Work with Strapi from Python via REST API
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pystrapi-4.3.0.tar.gz
(9.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pystrapi-4.3.0-py3-none-any.whl
(13.4 kB
view details)
File details
Details for the file pystrapi-4.3.0.tar.gz.
File metadata
- Download URL: pystrapi-4.3.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.13 Linux/5.13.0-1031-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
160ab66b76c5ac630afe0c89dcf8e1535f8f41583f33bf47ee21e1e2a2a1b133
|
|
| MD5 |
fe59e412a1a3046161544d84050c1300
|
|
| BLAKE2b-256 |
520b4b651771958e60aad0b58843800560feeb31ea447e7730481de4abb5951e
|
File details
Details for the file pystrapi-4.3.0-py3-none-any.whl.
File metadata
- Download URL: pystrapi-4.3.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.13 Linux/5.13.0-1031-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d61dd9ba87756e18fa7c38af8c41b36ab88de5eacb8ecac910183bd2c53be97
|
|
| MD5 |
c76bf1c0542e2b59151c495bb3759267
|
|
| BLAKE2b-256 |
9ace12707963d83e39c2cc1f6dc2d9f2918926711046a97d48a3e89c5b26bc82
|