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.2.0.tar.gz
(8.9 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.2.0-py3-none-any.whl
(11.9 kB
view details)
File details
Details for the file pystrapi-4.2.0.tar.gz.
File metadata
- Download URL: pystrapi-4.2.0.tar.gz
- Upload date:
- Size: 8.9 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 |
5adca5662c8310251ec2569454f88764a28fe7e2f6c27d09ffb78efbd9bc1665
|
|
| MD5 |
846afd4c2555ce99b2b105565d04307e
|
|
| BLAKE2b-256 |
b804b9598b78e5ad6186da9096162a367cf60635ec9a3941354ca7b87b4a7241
|
File details
Details for the file pystrapi-4.2.0-py3-none-any.whl.
File metadata
- Download URL: pystrapi-4.2.0-py3-none-any.whl
- Upload date:
- Size: 11.9 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 |
aefe388c0368e82ba9ef6394cd444fed88cb853e04ffc8eff82e12ecb55d1132
|
|
| MD5 |
5435cf42a307f8119f27026f2f3faef4
|
|
| BLAKE2b-256 |
a4df4f944f04f8b82c184cf32c9c2903f272451d3f73480556351d8c91292d73
|