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.5.0.tar.gz
(9.9 kB
view hashes)
Built Distribution
pystrapi-4.5.0-py3-none-any.whl
(14.5 kB
view hashes)