pyst-client
A Python client library for the PyST (Python Semantic Taxonomy) API.
Overview
This client library provides a Python interface to interact with the PyST API, which is a Knowledge Organization System for Sustainability Assessment. It allows you to programmatically manage and query semantic taxonomies, concepts, and their relationships.
Requirements
- Python 3.12+
Installation
From PyPI
pip install pyst-client
From Source
git clone https://github.com/cauldron/pyst-client.git
cd pyst-client
pip install -e .
Generating the Client
This client is automatically generated from an OpenAPI specification. You can regenerate it using the following steps:
-
Install the OpenAPI Generator CLI:
$ pip install openapi-generator-cli[jdk4py]
-
Generate the client using the existing configuration:
$ openapi-generator-cli generate -i openapi.json -g python -o . -c generator-config.json
The
openapi.jsonfile can be either:- A local file in the project root
- A URL pointing to your PyST API's OpenAPI specification (e.g.,
http://your-api/openapi.json)
Usage
Here's a basic example of how to use the client:
import pyst_client
from pyst_client.rest import ApiException
from pprint import pprint
# Configure the client
configuration = pyst_client.Configuration(
host = "http://localhost" # Replace with your PyST server URL
)
# Create an API client
async with pyst_client.ApiClient(configuration) as api_client:
# Create an instance of the Concept API
concept_api = pyst_client.ConceptApi(api_client)
try:
# Create a new concept
concept_create = pyst_client.ConceptCreate(
# Add your concept details here
)
response = await concept_api.concept_create_concept_post(concept_create)
print("Created concept:", response)
except ApiException as e:
print(f"Error creating concept: {e}")
API Documentation
The client provides access to the following main API endpoints:
- ConceptApi: Manage concepts and their relationships
- ConceptSchemeApi: Handle concept schemes
- ConceptAssociationApi: Manage concept associations
- CorrespondenceApi: Handle concept correspondences
For detailed API documentation, see the API Reference.
Development
Setup Development Environment
- Clone the repository
- Install development dependencies:
pip install -e ".[dev]"
Running Tests
pytest
Code Style
This project follows PEP 8 guidelines. To check your code:
flake8
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Documentation for API Endpoints
All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| ConceptApi | concept_create_concept_post | POST /concept/ | Create a `Concept` object |
| ConceptApi | concept_delete_concept_delete | DELETE /concept/ | Delete a `Concept` object |
| ConceptApi | concept_get_concept_get | GET /concept/ | Get a `Concept` object |
| ConceptApi | concept_search_concept_search_get | GET /concept/search/ | Search for `Concept` objects |
| ConceptApi | concept_suggest_concept_suggest_get | GET /concept/suggest/ | Suggestion search for `Concept` objects |
| ConceptApi | concept_update_concept_put | PUT /concept/ | Update a `Concept` object |
| ConceptApi | relationship_delete_relationships_delete | DELETE /relationships/ | Delete a list of `Concept` relationships |
| ConceptApi | relationships_create_relationships_post | POST /relationships/ | Create a list of `Concept` relationships |
| ConceptApi | relationships_get_relationships_get | GET /relationships/ | Get a list of `Concept` relationships |
| ConceptAssociationApi | association_create_association_post | POST /association/ | Create an `Association` object |
| ConceptAssociationApi | association_delete_association_delete | DELETE /association/ | Delete an `Association` object |
| ConceptAssociationApi | association_get_association_get | GET /association/ | Get an `Association` object |
| ConceptSchemeApi | concept_scheme_create_concept_scheme_post | POST /concept_scheme/ | Create a `ConceptScheme` object |
| ConceptSchemeApi | concept_scheme_delete_concept_scheme_delete | DELETE /concept_scheme/ | Delete a `ConceptScheme` object |
| ConceptSchemeApi | concept_scheme_get_concept_scheme_get | GET /concept_scheme/ | Get a `ConceptScheme` object |
| ConceptSchemeApi | concept_scheme_update_concept_scheme_put | PUT /concept_scheme/ | Update a `ConceptScheme` object |
| CorrespondenceApi | correspondence_create_correspondence_post | POST /correspondence/ | Create a `Correspondence` object |
| CorrespondenceApi | correspondence_delete_correspondence_delete | DELETE /correspondence/ | Delete a `Correspondence` object |
| CorrespondenceApi | correspondence_get_correspondence_get | GET /correspondence/ | Get a `Correspondence` object |
| CorrespondenceApi | correspondence_update_correspondence_put | PUT /correspondence/ | Update a `Correspondence` object |
| CorrespondenceApi | made_of_add_made_of_post | POST /made_of/ | Add some `Correspondence` `madeOf` links |
| CorrespondenceApi | made_of_remove_made_of_delete | DELETE /made_of/ | Remove some `Correspondence` `madeOf` links |
Documentation For Models
- AssociationInput
- AssociationOutput
- Concept
- ConceptCreate
- ConceptSchemeInput
- ConceptSchemeOutput
- ConceptUpdate
- CorrespondenceInput
- CorrespondenceOutput
- DateTime
- DateTimeType
- HTTPValidationError
- MadeOf
- MultilingualString
- Node
- NonLiteralNote
- Notation
- RelationshipInput
- RelationshipOutput
- SearchResult
- Status
- StatusChoice
- ValidationError
- ValidationErrorLocInner
- VersionString
Documentation For Authorization
Endpoints do not require authorization.
Author
Metadata
Release files for pyst-client 1.2.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 | Provenance | Actions |
|---|---|---|---|---|
| pyst_client-1.2.0.tar.gz | 28.4 kB | Without provenance | Details for pyst_client-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyst_client-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for pyst_client-1.2.0-py3-none-any.whl |
Total release size: 50.6 kB
Release files / pyst_client-1.2.0.tar.gz
| Download URL | pyst_client-1.2.0.tar.gz |
|---|---|
| Size | 28.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e1f5e93cf20de700e54565c215c37e99db7e990b3a7afc8db6759f773726c65
|
|
BLAKE2b-256 checksum How to use checksums |
071fc593cf000e03364a388458caf92b3dfa6862278264839bf138cb5b8ac0b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / pyst_client-1.2.0-py3-none-any.whl
| Download URL | pyst_client-1.2.0-py3-none-any.whl |
|---|---|
| Size | 22.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb804972e84a2a6147bf9d0c5c33e5a2147b8f41b23414806809f7610247cff5
|
|
BLAKE2b-256 checksum How to use checksums |
5626e5f8a1424812b09b059c67685b19e88e317121407e5ec180821ffe6ba0fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for pyst-client 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.