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.4.0.tar.gz (9.9 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.4.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file pystrapi-4.4.0.tar.gz.

File metadata

  • Download URL: pystrapi-4.4.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.13 Linux/5.13.0-1031-azure

File hashes

Hashes for pystrapi-4.4.0.tar.gz
Algorithm Hash digest
SHA256 07455a58f90a7536dc7d810e36c5de3ee46d40241bf8a693db7ccbdfbf2dd9f5
MD5 a1ed0370bba5c9c69f5215f7d22069a4
BLAKE2b-256 01d99f4662e0093db9f85bddd3cbf9726c467d380b1221ddf6df71dfe42eb46f

See more details on using hashes here.

File details

Details for the file pystrapi-4.4.0-py3-none-any.whl.

File metadata

  • Download URL: pystrapi-4.4.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.13 Linux/5.13.0-1031-azure

File hashes

Hashes for pystrapi-4.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8489cab73630d9a0eda36fee83bb1fd737b412e1cb43f79cd5bb48f5a6476a0
MD5 7ca56643a64c07074d0eb2e9f1174eb7
BLAKE2b-256 7c6679798e872af58dfebb561ad577cbd85c2124ad60b8fa1313a21d12e78a90

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