Skip to main content

Strapi API Client is used for maintaining a communication with the Strapi CMS by HTTP transfer protocol.

Project description

strapi-api-client

Strapi API Client is used for maintaining a communication with the Strapi CMS by HTTP transfer protocol.

IMPORTANT NOTE: For now, dependency is in a testing phase and is used for a very specific use cases. It still needs more modular and configurable way to be used by a community.

Installation

# pip
pip install strapi-api-client

# pipenv
pipenv install strapi-api-client

# poetry
poetry add strapi-api-client

Example

1. Create ApiClient object

import os

from strapi_api_client.api_client import ApiClient

api_client = ApiClient(
    api_url=os.getenv('API_URL'),
    api_key=os.getenv('API_KEY'),
    timeout=60
)

2. Create request to Strapi with an Api Client

This request will return a dictionary as a result.

community_response = api_client.community.get_community(name='my-community')

Tests

To run tests, you need to run command: pytest

Tests require access data to the api. For security reasons, access data is stored in environment variables. To set environment variables, you need to create an .env file from the example in the .env.example file.


Developed with 💙 and ☕️ by Adam Žúrek with the support of CulturePulse.ai, 2023 (C)

0.1.0 : 01.01.2023

  • Added: Community CRUD operations

0.2.0 : 03.01.2023

  • Added: Subgroup CRUD operations

0.3.0 : 04.01.2023

  • Added: Group CRUD operations

0.4.0 : 10.01.2023

  • Added: Serializing of responses

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

strapi-api-client-0.4.0.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

strapi_api_client-0.4.0-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

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