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
Built Distribution
File details
Details for the file strapi-api-client-0.4.0.tar.gz
.
File metadata
- Download URL: strapi-api-client-0.4.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f629b66488e346bfc1c6e1fb1e32997fb283b8440a0747ae1d5669d6820442ba |
|
MD5 | 18bdf598725c9e4ce705726e371998a2 |
|
BLAKE2b-256 | 509476eed6c47b06428381d813a90dcba1372229b188cc341c4f3589a28591cc |
File details
Details for the file strapi_api_client-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: strapi_api_client-0.4.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef067c4952e9d2af32d349f986fbcc9893754ac6aa423e536204bcb16d4c3012 |
|
MD5 | edea224532fb4a3c728260958b20acb5 |
|
BLAKE2b-256 | 7686e7a4ef14fcfd13960978affd84973e4db1948a3d1be2f985a110c3b3bfe3 |