Skip to main content

No project description provided

Project description

pharia-data-sdk

Formerly the intelligence_layer/connectors/data, intelligence_layer/connectors/document_index and intelligence_layer/connectors/retrievers modules.

Overview

This module provides connectors for interacting with the Pharia Data Platform and Document Index, you can use it to semantically search, access and manage data, documents.

Installation

pip install pharia-data-sdk

Usage

Data Platform Connector

from pharia_data_sdk.connectors.data import DataClient

client = DataClient(token="<token>", base_data_platform_url="<base_data_platform_url>")

repositories = client.list_repositories()
repository = repositories[0]
datasets = client.list_datasets(repository)
dataset = datasets[0]

Document Index Connector

from pharia_data_sdk.connectors.document_index.document_index import DocumentIndexClient, SearchQuery

client = DocumentIndexClient(token="<token>", base_document_index_url="<base_document_index_url>")

namespaces = client.list_namespaces()
collections = client.list_collections(namespaces[0])
indexes = client.list_indexes(namespaces[0])
client.search(collections[0], indexes[0].index, SearchQuery(query="What fish is most common in swedish lakes?"))

Retrievers

from pharia_data_sdk.connectors.retrievers.document_index_retriever import DocumentIndexRetriever
from pharia_data_sdk.connectors.document_index.document_index import DocumentIndexClient

retriever = DocumentIndexRetriever(
    document_index=DocumentIndexClient(token="<token>", base_document_index_url="<base_document_index_url>"),
    index_name="<index_name>",
    namespace="<namespace>",
    collection="<collection>",
)

retriever.get_relevant_documents_with_scores("What fish is most common in swedish lakes?")

Contributing

We welcome contributions! Please see our Contributing Guide for details on how to set up the development environment and submit changes.

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

pharia_data_sdk-0.1.3.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

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

pharia_data_sdk-0.1.3-py3-none-any.whl (30.8 kB view details)

Uploaded Python 3

File details

Details for the file pharia_data_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: pharia_data_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.14

File hashes

Hashes for pharia_data_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 090b8540e8dfbd129ee15cdf27ba600a36666ff2aedd875b8102b37388c6cc62
MD5 26d371200741ed10611d1745a655fe2e
BLAKE2b-256 3166628eab03121797bb686cd4b0706378eb31d361bae08c9b1f93ae2f3be2fb

See more details on using hashes here.

File details

Details for the file pharia_data_sdk-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pharia_data_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f0ab2e2ed04fbec1fe92a9bf3995b46df7c64abef963dfaa11faa82d3a8fdd98
MD5 cd72ffd194a3a1d365fe65b768860486
BLAKE2b-256 57ba907f6b7c1099d7fa5b98e2846351617288ad2a4c885b752d8da8e704fae9

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