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:

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.0.0.tar.gz (8.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.0.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pystrapi-4.0.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

Hashes for pystrapi-4.0.0.tar.gz
Algorithm Hash digest
SHA256 43eee0c073a0ccef2a7b77ec9f65dd698e9e81f99682b81c53e6daede5af0a9b
MD5 19d2fb6d890ab8ca600e09cc6e4017f9
BLAKE2b-256 2cedf038d009b5be0871208757745ef48b17c48b37c9cb703a42097826a9b99b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pystrapi-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99da88939c5a2294b51ec9e407c3c4f09c6a76eaa3d29bde658b2e40eb3c8468
MD5 9933509f96bc1e09de3c784525d7d84c
BLAKE2b-256 dd7da672a4fffba5ea9ab2cc36f414e8a00eb69199207180ff94b145db5bd627

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