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
Metadata
Release files for strapi-api-client 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| strapi-api-client-0.4.0.tar.gz | 7.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| strapi_api_client-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.5 kB
Release files / strapi-api-client-0.4.0.tar.gz
| Download URL | strapi-api-client-0.4.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f629b66488e346bfc1c6e1fb1e32997fb283b8440a0747ae1d5669d6820442ba
|
|
BLAKE2b-256 checksum How to use checksums |
509476eed6c47b06428381d813a90dcba1372229b188cc341c4f3589a28591cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / strapi_api_client-0.4.0-py3-none-any.whl
| Download URL | strapi_api_client-0.4.0-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef067c4952e9d2af32d349f986fbcc9893754ac6aa423e536204bcb16d4c3012
|
|
BLAKE2b-256 checksum How to use checksums |
7686e7a4ef14fcfd13960978affd84973e4db1948a3d1be2f985a110c3b3bfe3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|