Skip to main content

Client for Data Space Catalog Service

Project description

Python client

API version: 0.2.1

Requirements

Installation & Usage

  1. If you don't have Poetry installed run:
pip install poetry
  1. Install dependencies:
poetry config virtualenvs.in-project true
poetry install --no-root
  1. 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.

  1. Building package:
poetry build
  1. 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_catalog
from ds_catalog.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_catalog.Configuration(
    host = "http://localhost"
)



# Enter a context with an instance of the API client
with ds_catalog.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ds_catalog.CatalogApi(api_client)
    request_body = None # Dict[str, object] | 

    try:
        # Get Local Catalog
        api_response = api_instance.get_catalog(request_body)
        print("The response of CatalogApi->get_catalog:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CatalogApi->get_catalog: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
CatalogApi get_catalog POST /catalog/ Get Local Catalog
CatalogApi get_public_catalog POST /public-catalog/ Get Public Catalog
DatasetsApi delete_dataset DELETE /datasets/{id}/ Delete Dataset
DatasetsApi get_dataset GET /datasets/{id}/ Get Dataset
DatasetsApi save_dataset POST /datasets/{filename}/ Save Dataset
MMIOApi delete_mmio_file DELETE /mmio/{filename}/ Delete Mmio File
MMIOApi get_mmio_file GET /mmio/{filename}/ Get Mmio File
MMIOApi save_mmio_file POST /mmio/ Save Mmio File
SharingApi share_dataset POST /datasets/{id}/share/ Share Dataset
SharingApi unshare_dataset POST /datasets/{id}/unshare/ Unhare Dataset
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

all-hiro@hiro-microdatacenters.nl

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

ds_catalog-0.2.1.tar.gz (38.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ds_catalog-0.2.1-py3-none-any.whl (111.7 kB view details)

Uploaded Python 3

File details

Details for the file ds_catalog-0.2.1.tar.gz.

File metadata

  • Download URL: ds_catalog-0.2.1.tar.gz
  • Upload date:
  • Size: 38.2 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

Hashes for ds_catalog-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5200ad665b1d47ca7de7e371873bebaff44e4d08274b65c85500cb4adf56aa2e
MD5 d52fc4ba4ef797fd5363a8ad62998901
BLAKE2b-256 c861f081b546c454e64433e569954d46df96039e9f14c4e3e2e1704562a93593

See more details on using hashes here.

File details

Details for the file ds_catalog-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ds_catalog-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 111.7 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

Hashes for ds_catalog-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c4280ce547f5c71adce3132002c57059c682067192a005ca0f05b044c34ab276
MD5 3a03a0bedd8cd3899f70e1ab032a5a92
BLAKE2b-256 1c5f1a0c67a464ff8f559074fdd0e40aab21ed56a4676c90db56433c754a2849

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page