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_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_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_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.4.tar.gz (25.4 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.4-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pharia_data_sdk-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b9757a2478ea7d73af44cffd4bbb1df7f614549d30805659dec37447bf92f377
MD5 ec356d0915e3483872401ca323568771
BLAKE2b-256 2d76e1d209f22a01678c9e8341f347b8cd5da1ec6cdb82ce3cc9de6cafcfd7ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pharia_data_sdk-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7099d406f72108131db681ff3104c79c8fb83ff321e2fa9099c97ffe793d3cb5
MD5 13f5ea6e02ac8c03b57fdadf779d4062
BLAKE2b-256 4ab08630e2c552b79732cd232a4911fb622e7863f471ed7b742071d56a5c62a1

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