Skip to content

tagbase/pytagbase

Repository files navigation

pytagbase

tagbse-server provides HTTP endpoints for ingestion of various files \ into a Tagbase SQL database. Input file support currently includes eTUFF (see here \ and here). The REST API complies with OpenAPI v3.0.3.

This Python package is automatically generated by the OpenAPI Generator project:

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import pytagbase

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import pytagbase

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import time
import pytagbase
from pytagbase.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://localhost/tagbase/api/v0.14.0
# See configuration.py for a list of all supported configuration parameters.
configuration = pytagbase.Configuration(
    host = "https://localhost/tagbase/api/v0.14.0"
)



# Enter a context with an instance of the API client
with pytagbase.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pytagbase.IngestApi(api_client)
    file = 'file_example' # str | Location of a network accessible (file, ftp, http, https) file e.g. 'file:///usr/src/app/data/eTUFF-sailfish-117259.txt'.
    notes = 'notes_example' # str | Free-form text field where details of submitted eTUFF file for ingest can be provided e.g. submitter name, etuff data contents (tag metadata and measurements + primary position data, or just secondary solution-positional meta/data) (optional)
    type = 'etuff' # str | Type of file to be ingested, defaults to 'etuff' (optional) (default to 'etuff')
    version = 'version_example' # str | Version identifier for the eTUFF tag data file ingested (optional)

    try:
        # Get network accessible file and execute ingestion
        api_response = api_instance.ingest_get(file, notes=notes, type=type, version=version)
        print("The response of IngestApi->ingest_get:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling IngestApi->ingest_get: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://localhost/tagbase/api/v0.14.0

Class Method HTTP request Description
IngestApi ingest_get GET /ingest Get network accessible file and execute ingestion
IngestApi ingest_post POST /ingest Post a local file and perform a ingest operation
TagsApi delete_sub DELETE /tags/{tag_id}/subs/{sub_id} Delete a tag submission
TagsApi delete_tag DELETE /tags/{tag_id} Delete an individual tag
TagsApi delete_tags DELETE /tags Delete all tags
TagsApi get_tag GET /tags/{tag_id} Get information about an individual tag
TagsApi list_tags GET /tags Get information about all tags
TagsApi replace_tag PUT /tags/{tag_id}/subs/{sub_id} Update the 'notes' and/or 'version' associated with a tag submission

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Author

tagtuna@gmail.com

Releases

No releases published

Packages

No packages published