Client for Data Space Search Service
Project description
Python client
API version: 0.2.0
Requirements
- Python 3.10+
- Docker engine. Documentation
Installation & Usage
- If you don't have
Poetryinstalled run:
pip install poetry
- Install dependencies:
poetry config virtualenvs.in-project true
poetry install --no-root
- Running tests:
poetry run pytest
You can test the application for multiple versions of Python. To do this, you need to install the required Python versions on your operating system, specify these versions in the tox.ini file, and then run the tests:
poetry run tox
Add the tox.ini file to client/.openapi-generator-ignore so that it doesn't get overwritten during client generation.
- Building package:
poetry build
- Publishing
poetry config pypi-token.pypi <pypi token>
poetry publish
Client generator
To generate the client, execute the following script from the project root folder
poetry --directory server run python ./tools/client_generator/generate.py ./api/openapi.yaml
Command
generate.py <file> [--asyncio]
Arguments
file Specifies the input OpenAPI specification file path or URL. This argument is required for generating the Python client. The input file can be either a local file path or a URL pointing to the OpenAPI schema.
--asyncio Flag to indicate whether to generate asynchronous code. If this flag is provided, the generated Python client will include asynchronous features. By default, synchronous code is generated.
Configuration
You can change the name of the client package in the file /tools/client_generator/config.json.
Add file's paths to client/.openapi-generator-ignore so that it doesn't get overwritten during client generation.
Examples
python generate.py https://<domain>/openapi.json
python generate.py https://<domain>/openapi.json --asyncio
python generate.py /<path>/openapi.yaml
python generate.py /<path>/openapi.yaml --asyncio
Getting Started
Please follow the installation procedure and then run the following:
import ds_search_service
from ds_search_service.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = ds_search_service.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with ds_search_service.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ds_search_service.DecentralizedSearchApi(api_client)
catalog_filters = ds_search_service.CatalogFilters() # CatalogFilters |
try:
# Decentralized Search Across Catalogs
api_response = api_instance.decentralized_search(catalog_filters)
print("The response of DecentralizedSearchApi->decentralized_search:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling DecentralizedSearchApi->decentralized_search: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DecentralizedSearchApi | decentralized_search | POST /search/ | Decentralized Search Across Catalogs |
| LocalSearchApi | search_catalog | POST /search-catalog/ | Search Local Catalog |
| DefaultApi | health_check | GET /health-check | Health check |
| DefaultApi | metrics_metrics_get | GET /metrics | Metrics |
Documentation For Models
Documentation For Authorization
Endpoints do not require authorization.
Author
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 ds_search_service-0.2.0.tar.gz.
File metadata
- Download URL: ds_search_service-0.2.0.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.10 Linux/6.11.0-1014-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
876af6362af7e5d3913fa173e0521988fec7c24240ee92afdd17356792781f0a
|
|
| MD5 |
6827e901d6e195b64bb5f72d6f3e7ea3
|
|
| BLAKE2b-256 |
35a55ddf5f503407c5d804212380010fb17c1dbb3f6184ff23695c9211d8fa77
|
File details
Details for the file ds_search_service-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ds_search_service-0.2.0-py3-none-any.whl
- Upload date:
- Size: 39.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.10 Linux/6.11.0-1014-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44e160541f85c00514c589faec8a017d67e27339b103ac11962534fde15e9ed4
|
|
| MD5 |
f3bf5ff8d369540fdeecf3328164e51a
|
|
| BLAKE2b-256 |
00ee71d3f88f4f4a611f94f7074b1844cdf65f26a11a5055115efdbea679cdc3
|