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.5.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.5.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pystrapi-4.5.0.tar.gz
Algorithm Hash digest
SHA256 5928f529b41f704da9db8e3dce97b35b170cc4b11eec71946737f0e1056d6b96
MD5 876e2a6276d40d947bfe5d679dda28d0
BLAKE2b-256 b8e1264a134da910c1e5c132f1c805b72ad80c2c5e62ca56f3b44a587c5eb8c2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pystrapi-4.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2672d197372b456665dfde7b50acb44b3538bff13358ed122935512891291ca
MD5 a5217500e9c02bc3b782d45ba3be920f
BLAKE2b-256 6c87e0767cde2e2b11b5c958aaa333f496a55f5bdfeb2d4a95a1e763a4174fcf

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