Skip to main content

Anansi REST API

Project description

anansi-sdk

These endpoints describe the REST API of the Anansi Data Lineage Tool. The Catalog endpoint is for saving data into Nodes. The Relationships endpoints is for connecting data between Nodes. The endpoints use JWT as the security mechanism.

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

pip install anansi-sdk

(you may need to run pip with root permission: sudo pip install anansi-sdk)

Then import the package:

import anansi_sdk 

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 anansi_sdk

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import anansi_sdk
from anansi_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: JWT
configuration = anansi_sdk.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = anansi_sdk.DefaultApi(anansi_sdk.ApiClient(configuration))
table_name = 'table_name_example' # str | Also can be called Node Name interchangeably.
unused_parameter = 'unused_parameter_example' # str | This is a unused parameter. It can be set to anything.
body = [{
  "value" : [ {
    "Email" : "test@test1.com"
  } ]
}] # list[object] |  (optional)

try:
    # Delete Catalog Entries
    api_response = api_instance.delete_api_catalog_table_name(table_name, unused_parameter, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->delete_api_catalog_table_name: %s\n" % e)

# Configure API key authorization: JWT
configuration = anansi_sdk.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = anansi_sdk.DefaultApi(anansi_sdk.ApiClient(configuration))
catalogname = 'catalogname_example' # str | Source Catalog Name
unused_parameter = 'unused_parameter_example' # str | Unused but required parameter.
body = [anansi_sdk.RelationshipUnusedParameterBody()] # list[RelationshipUnusedParameterBody] |  (optional)

try:
    # Delete Relationships
    api_response = api_instance.delete_api_relationship_unused_parameter_catalog_name(catalogname, unused_parameter, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->delete_api_relationship_unused_parameter_catalog_name: %s\n" % e)

# Configure API key authorization: JWT
configuration = anansi_sdk.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = anansi_sdk.DefaultApi(anansi_sdk.ApiClient(configuration))
catalogname = 'catalogname_example' # str | Source Catalog Name
limit = 56 # int | Number of Records returned
skip = 56 # int | Number of Records to be skipped
source_label = 'source_label_example' # str | Name of the Source Node. Used for Filter.  (optional)
dest_label = 'dest_label_example' # str | Name of the Destination Node. Used for Filter. (optional)
relation_name = 'relation_name_example' # str | Type of Relationship. Used for Filter. (optional)
order_prop = 'order_prop_example' # str | Order By Property. Used for Sorting. (optional)
order_type = 'order_type_example' # str | Ascending or Descending. Used for Sorting. (optional)

try:
    # GET Relationships
    api_response = api_instance.get_api_relationship(catalogname, limit, skip, source_label=source_label, dest_label=dest_label, relation_name=relation_name, order_prop=order_prop, order_type=order_type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->get_api_relationship: %s\n" % e)

# Configure API key authorization: JWT
configuration = anansi_sdk.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = anansi_sdk.DefaultApi(anansi_sdk.ApiClient(configuration))
limit = 56 # int | The number of rows to return.
skip = 56 # int | The number of rows to skip during a select. This mainly used for pagination.
table_name = 'table_name_example' # str | Also can be called Node Name interchangeably.
_property = '_property_example' # str | We can choose to return only 1 property (optional)
order_info_order_prop = 'order_info_order_prop_example' # str | Order by this property (optional)
order_info_order_type = 'order_info_order_type_example' # str | Ascending or Descending Order. Default is Ascending Order. (optional)
optional_filter = 'optional_filter_example' # str | Used for filtering data. (optional)
relation_info_name = 'relation_info_name_example' # str | Relationship Name (optional)
relation_info_node_name = 'relation_info_node_name_example' # str | Source Node (optional)
relation_info_unique_col_name = 'relation_info_unique_col_name_example' # str | Source Node Unique Column Name (optional)
relation_info_id = 'relation_info_id_example' # str | Source Node Identifier (optional)
relation_info_direction = 'Downstream' # str | Direction Identifier (optional) (default to Downstream)

try:
    # Get Catalog Data by Table Name
    api_response = api_instance.get_catalog_tablename(limit, skip, table_name, _property=_property, order_info_order_prop=order_info_order_prop, order_info_order_type=order_info_order_type, optional_filter=optional_filter, relation_info_name=relation_info_name, relation_info_node_name=relation_info_node_name, relation_info_unique_col_name=relation_info_unique_col_name, relation_info_id=relation_info_id, relation_info_direction=relation_info_direction)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->get_catalog_tablename: %s\n" % e)

# Configure API key authorization: JWT
configuration = anansi_sdk.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = anansi_sdk.DefaultApi(anansi_sdk.ApiClient(configuration))
table_name = 'table_name_example' # str | Also can be called Node Name interchangeably.
unused_parameter = 'unused_parameter_example' # str | This is a unused parameter. It can be set to anything.
body = NULL # object |  (optional)

try:
    # Update Properties in the table
    api_response = api_instance.patch_api_catalog_table_name_x(table_name, unused_parameter, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->patch_api_catalog_table_name_x: %s\n" % e)

# Configure API key authorization: JWT
configuration = anansi_sdk.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = anansi_sdk.DefaultApi(anansi_sdk.ApiClient(configuration))
catalogname = 'catalogname_example' # str | Source Catalog Name
unused_parameter = 'unused_parameter_example' # str | Unused but required parameter.
body = anansi_sdk.Relationship() # Relationship |  (optional)

try:
    # Update Relationship
    api_response = api_instance.patch_api_relationship(catalogname, unused_parameter, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->patch_api_relationship: %s\n" % e)

# Configure API key authorization: JWT
configuration = anansi_sdk.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = anansi_sdk.DefaultApi(anansi_sdk.ApiClient(configuration))
table_name = 'table_name_example' # str | Also can be called Node Name interchangeably.
body = [{
  "value" : [ {
    "User Id" : "123",
    "Email" : "test@test1.com",
    "Encrypted Password" : "x",
    "Name" : "Someone",
    "Last Updated By" : "System Startup",
    "Last Updated DateTime" : "2023-06-15T09:26:40Z",
    "Created By" : "System Startup",
    "Created DateTime" : "2023-06-15T09:26:40Z"
  } ]
}] # list[object] |  (optional)

try:
    # Create New Entries in the Table
    api_instance.post_api_catalog_table_name(table_name, body=body)
except ApiException as e:
    print("Exception when calling DefaultApi->post_api_catalog_table_name: %s\n" % e)

# Configure API key authorization: JWT
configuration = anansi_sdk.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = anansi_sdk.DefaultApi(anansi_sdk.ApiClient(configuration))
catalog_name = 'catalog_name_example' # str | Name of the Catalog
body = anansi_sdk.GraphRequest() # GraphRequest |  (optional)

try:
    # Generate Graph
    api_response = api_instance.post_api_graph_catalog_name(catalog_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->post_api_graph_catalog_name: %s\n" % e)

# Configure API key authorization: JWT
configuration = anansi_sdk.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = anansi_sdk.DefaultApi(anansi_sdk.ApiClient(configuration))
catalogname = 'catalogname_example' # str | Source Catalog Name
body = [anansi_sdk.Relationship()] # list[Relationship] |  (optional)

try:
    # Create Relationships
    api_instance.post_api_relationship(catalogname, body=body)
except ApiException as e:
    print("Exception when calling DefaultApi->post_api_relationship: %s\n" % e)

# Configure API key authorization: JWT
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))
body = {
  "value" : {
    "searchStr" : "Treasury",
    "similarityThreshold" : 0.8,
    "fullTextIndexLimit" : 3,
    "maxResultReturned" : 3
  }
} # object |  (optional)

try:
    # Your POST endpoint
    api_response = api_instance.post_api_search(search_type="fulltext",body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->post_api_search: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost:80

Class Method HTTP request Description
DefaultApi delete_api_catalog_table_name DELETE /api/catalog/{tableName}/{unusedParameter} Delete Catalog Entries
DefaultApi delete_api_relationship_unused_parameter_catalog_name DELETE /api/relationship/{UnusedParameter} Delete Relationships
DefaultApi get_api_relationship GET /api/relationship GET Relationships
DefaultApi get_catalog_tablename GET /api/catalog/{tableName} Get Catalog Data by Table Name
DefaultApi patch_api_catalog_table_name_x PATCH /api/catalog/{tableName}/{unusedParameter} Update Properties in the table
DefaultApi patch_api_relationship PATCH /api/relationship/{UnusedParameter} Update Relationship
DefaultApi post_api_catalog_table_name POST /api/catalog/{tableName} Create New Entries in the Table
DefaultApi post_api_graph_catalog_name POST /api/graph/{catalogName} Generate Graph
DefaultApi post_api_relationship POST /api/relationship Create Relationships
DefaultApi post_api_search POST /api/search Search endpoint
DefaultApi post_api_embeddings POST /api/embeddings Generate Vector Embeddings

Documentation For Models

Documentation For Authorization

JWT

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

admin@suketa.in

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

anansi_sdk-1.2.1.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

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

anansi_sdk-1.2.1-py3-none-any.whl (50.6 kB view details)

Uploaded Python 3

File details

Details for the file anansi_sdk-1.2.1.tar.gz.

File metadata

  • Download URL: anansi_sdk-1.2.1.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for anansi_sdk-1.2.1.tar.gz
Algorithm Hash digest
SHA256 6573caa9f846ff49685729e73fcdb678d620722202e577be884e10c38a48bf2f
MD5 52c9293208356080fb4b7965c3f868b1
BLAKE2b-256 3ba8e31194db98dddd738751150b5e64b91c9b56be7efea098a0ceed42d9a718

See more details on using hashes here.

Provenance

The following attestation bundles were made for anansi_sdk-1.2.1.tar.gz:

Publisher: python-publish.yml on data-lineage/anansi-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anansi_sdk-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: anansi_sdk-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 50.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for anansi_sdk-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b846715fd18e37c28beac49b4db45fc22435de1344a40105754ca217eb80852b
MD5 54098eaa9e45521120855dcec714b829
BLAKE2b-256 55f69dbb0ce45ec0c4af29f78423c48274edf54caae34dac1a802f855cc3f023

See more details on using hashes here.

Provenance

The following attestation bundles were made for anansi_sdk-1.2.1-py3-none-any.whl:

Publisher: python-publish.yml on data-lineage/anansi-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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