Skip to main content

Work with Strapi from Python via REST API

Project description

PyStrapi

CI Build and release PyPI version pyversions

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystrapi-4.3.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

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

Hashes for pystrapi-4.3.0.tar.gz
Algorithm Hash digest
SHA256 160ab66b76c5ac630afe0c89dcf8e1535f8f41583f33bf47ee21e1e2a2a1b133
MD5 fe59e412a1a3046161544d84050c1300
BLAKE2b-256 520b4b651771958e60aad0b58843800560feeb31ea447e7730481de4abb5951e

See more details on using hashes here.

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

Hashes for pystrapi-4.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d61dd9ba87756e18fa7c38af8c41b36ab88de5eacb8ecac910183bd2c53be97
MD5 c76bf1c0542e2b59151c495bb3759267
BLAKE2b-256 9ace12707963d83e39c2cc1f6dc2d9f2918926711046a97d48a3e89c5b26bc82

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page