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.1.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.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pystrapi-4.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 79fce6eb4c235c99fe2a94a74a36a5560b63beead0904c53feacbf431ddc1279
MD5 e113516e4e59e5a3a50dfa05fd6c0801
BLAKE2b-256 306fd08041eecbafb74f7a8702f0a6c7530a27fbbeacdb9129e8abfe20903eef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pystrapi-4.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1dc6defab9aaf300d9b7d24bd0a97901f2e75aa604ee10c676c5a11d36617455
MD5 e8885986c92c968d19580f1ea8aff383
BLAKE2b-256 667c0c4d6eb7186245b9043bf3f5cb76cae1028a325a07b7f4bd4efe5cd7d2ae

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