A client library for accessing Sadales Tikls M2M API
Project description
sadales-tikls-m2m-api-client
A client library for accessing Sadales Tikls M2M API
OpenAPI
See preview in Swagger Editor online.
Keep in mind that direct queries from browser won't work due to known CORS issue.
Usage
First, create a client:
from sadales_tikls_m2m_api_client import AuthenticatedClient
client = AuthenticatedClient(base_url="https://services.e-st.lv/m2m", token="SuperSecretToken")
Now call your endpoint and use your models:
from sadales_tikls_m2m_api_client import AuthenticatedClient
from sadales_tikls_m2m_api_client.types import Response
from sadales_tikls_m2m_api_client.api.default import get_object_list
from sadales_tikls_m2m_api_client.models import GetObjectListResponse200
objects: GetObjectListResponse200 = get_object_list.sync(client=client)
# or if you need more info (e.g. status_code)
response: Response[GetObjectListResponse200] = get_object_list.sync_detailed(client=client)
Or do the same thing with an async version:
from sadales_tikls_m2m_api_client import AuthenticatedClient
from sadales_tikls_m2m_api_client.types import Response
from sadales_tikls_m2m_api_client.api.default import get_object_list
from sadales_tikls_m2m_api_client.models import GetObjectListResponse200
my_data: GetObjectListResponse200 = await get_object_list.asyncio(client=client)
response: Response[GetObjectListResponse200] = await get_object_list.asyncio_detailed(client=client)
Things to know:
-
Every path/method combo becomes a Python module with four functions:
sync: Blocking request that returns parsed data (if successful) orNonesync_detailed: Blocking request that always returns aRequest, optionally withparsedset if the request was successful.asyncio: Likesyncbut the async instead of blockingasyncio_detailed: Likesync_detailedby async instead of blocking
-
All path/query params, and bodies become method arguments.
-
If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
-
Any endpoint which did not have a tag will be in
sadales_tikls_m2m_api_client.api.default
Building / publishing this Client
This project uses Poetry to manage dependencies and packaging. Here are the basics:
- Update the metadata in pyproject.toml (e.g. authors, version)
- If you're using a private repository, configure it with Poetry
poetry config repositories.<your-repository-name> <url-to-your-repository>poetry config http-basic.<your-repository-name> <username> <password>
- Publish the client with
poetry publish --build -r <your-repository-name>or, if for public PyPI, justpoetry publish --build
If you want to install this client into another project without publishing it (e.g. for development) then:
- If that project is using Poetry, you can simply do
poetry add <path-to-this-client>from that project - If that project is not using Poetry:
- Build a wheel with
poetry build -f wheel - Install that wheel from the other project
pip install <path-to-wheel>
- Build a wheel with
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sadales-tikls-m2m-1.0.0.tar.gz.
File metadata
- Download URL: sadales-tikls-m2m-1.0.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.8.5 Linux/4.4.0-19041-Microsoft
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab6efd5bf29329b84e72cfa6eef104db4ca418e4b8b14ca0d952845381012180
|
|
| MD5 |
ece3d4c14afaafe0c504b492e48525cb
|
|
| BLAKE2b-256 |
e596856bc2bf8c37725d64f0e42a1f676315919c9dbbed116a9d6120903be8f4
|
File details
Details for the file sadales_tikls_m2m-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sadales_tikls_m2m-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.8.5 Linux/4.4.0-19041-Microsoft
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
286cdd0e86c25238afa2b8f9c29032607a6ed8327af348cb2a83a6052ca5c6f6
|
|
| MD5 |
e8dc2523d0b2b1bb4dc0156011623e37
|
|
| BLAKE2b-256 |
e0b7694f8aab485d8f5d69fa4fb63de15f55c3a0636d0585154fd7e68315da79
|