Skip to main content

semantha® SDK

The semantha SDK is a high-level REST client to access the semantha API. It provides classes to access any endpoint found in the official API Guide. The SDK is still under development. An overview of the current progress (i.e. implemented and tested resources and endpoints) may be found at the end of this document.

Disclaimer

IMPORTANT: The SDK is under development and interfaces may change at any time without notice. Use with caution and on own risk.

Access

To access semantha's API you will need an API and a server url. Both can be requested via this contact form.

Basic Usage

Import

import semantha_sdk

Authentication

semantha = semantha_sdk.login(url="<seantha platform server URL>", key="<your key>")
# or
semantha = semantha_sdk.login(url="<seantha platform server URL>", key_file="<path to your key file (json format)>")

End-point Access

# end-points (resp. resources) can be used like objects
current_user = semantha.current_user
my_domain = semantha.domains.get_one("my_domain")

# they may have sub-resources, which can be retrieved as objects as well
reference_documents = my_domains.reference_documents

CRUD on End-points

# CRUD operations are functions
domain_settings = my_domain.get_settings()
my_domain.reference_documents.delete_all()

Function Return Types & semantha Data Model

# some functions only return None, e.g.
my_domain.reference_documents.delete_all() # returns NoneType

# others return built in types, e.g
roles_list = current_user.get_user_roles() # returns list[str]

# but most return objects of the semantha Data Model
# (all returned objects are instances of frozen dataclasses)
settings = my_domain.get_settings() # returns instance of DomainSettings
# attributes can be accessed as properties, e.g.
settings.enable_tagging # returns true or false
# Data Model objects may be complex
document = my_domain.references.post(file=a, reference_document=b) # returns instance of Document
# the following returns the similarity value of the first references of the first sentence of the
# the first paragraph on the first page of the document (if a reference was found for this sentence)
similarity = pages[0].contents[0].paragraphs[0].references[0].similarity # returns float

State of Development

The following resources and end-points are fully functional and (partially) tested: CurrentUser

  • get_user_data
  • get_user_roles

Domains

  • get_all
  • get_one --> returns sub-resource Domain
    • get_configuration
    • get_settings
    • References
      • post
    • ReferenceDocuments
      • get_all
      • get_one
      • delete_all
      • delete_one
      • post
      • get_paragraph
      • delete_paragraph
      • get_sentence
      • get_named_entities
      • get_statistic

Model/Domains

  • get_one --> returns sub-resource DomainModel
    • Boostwords
      • get_all
      • get_one
      • delete_all
      • get_one

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semantha_sdk-4.1.1.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

semantha_sdk-4.1.1-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file semantha_sdk-4.1.1.tar.gz.

File metadata

  • Download URL: semantha_sdk-4.1.1.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Windows/10

File hashes

Hashes for semantha_sdk-4.1.1.tar.gz
Algorithm Hash digest
SHA256 acfc9bec9a1ee3c726e439b75ea01addcf6bd92475c85004828cc6b1fb6344a4
MD5 3cad669c14408d035ec209db0e613bef
BLAKE2b-256 d99df4779cbacba408edad18f7e70694a87071b352e7a8aa4d5e34470532393c

See more details on using hashes here.

File details

Details for the file semantha_sdk-4.1.1-py3-none-any.whl.

File metadata

  • Download URL: semantha_sdk-4.1.1-py3-none-any.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Windows/10

File hashes

Hashes for semantha_sdk-4.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eadb13c156033c7be71633f7ca4b40d090dc7d72b6bf5562bcb9399d9290faa7
MD5 fccb2b497d386256b898cb8c612ee597
BLAKE2b-256 16a73330473de01c6616b02f56ae56f7493a01210c00c0e2909e820a95c327b1

See more details on using hashes here.

Release history Release notifications | RSS feed

11.10.0

2 files

11.9.0

2 files

11.8.0

2 files

11.7.0

2 files

11.6.0

2 files

11.5.0

2 files

11.4.0

2 files

11.3.0

2 files

11.2.1

2 files

11.2.0

2 files

11.1.0

2 files

10.10.0

2 files

10.9.0

2 files

10.6.0

2 files

10.5.0

2 files

10.4.0

2 files

10.1.0

2 files

10.0.0

2 files

9.1.0

2 files

9.0.0

2 files

8.12.0

2 files

8.10.0

2 files

8.9.0

2 files

8.8.2

2 files

8.8.1

2 files

8.8.0

2 files

8.6.0

2 files

8.5.1

2 files

8.5.0

2 files

8.3.0

2 files

8.2.0

2 files

8.1.0

2 files

7.13.0

2 files

7.11.0

2 files

7.10.0

2 files

7.9.0

2 files

7.8.0

2 files

7.5.0

2 files

7.3.0

2 files

7.1.1

2 files

7.1.0

2 files

7.0.0

2 files

6.11.2

2 files

6.11.1

2 files

6.11.0

2 files

6.10.0

2 files

6.9.0

2 files

6.8.0

2 files

6.7.0

2 files

6.6.0

2 files

6.5.0

2 files

6.4.0

2 files

6.3.0

2 files

6.2.1

2 files

6.2.0

2 files

6.1.0

2 files

6.0.1

2 files

6.0.0

2 files

5.11.1

2 files

5.11.0

2 files

5.10.0

2 files

5.9.0

2 files

5.8.0

2 files

5.7.2

2 files

5.7.1

2 files

5.7.0

2 files

5.6.2

2 files

5.6.1

2 files

5.6.0

2 files

5.5.0

2 files

5.4.1

2 files

5.4.0

2 files

5.3.2

2 files

5.3.1

2 files

5.3.0

2 files

5.2.0

2 files

4.8.1

2 files

4.8.0

2 files

4.7.0

2 files

4.6.0

2 files

4.5.3

2 files

4.5.2

2 files

4.5.1

2 files

4.5.0

2 files

4.3.1

2 files

4.3.0

2 files

4.2.1

2 files

4.2.0

2 files

This release

4.1.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page