Skip to main content

datasherlock

Project description

Sherlock

Introduction

The Datasherlock Python SDK allows you to seamlessly integrate Datasherlock's powerful database querying capabilities into your Python applications. With this SDK, you can interact with Datasherlock's cloud-based service to register your database, ask queries, and retrieve valuable insights without the need for complex SQL queries.

This documentation will guide you through the installation process, usage of the SDK, and provide examples to help you get started.

Installation

You can install the Datasherlock Python SDK using pip:

pip install datasherlock

Quick Start

Before using the Datasherlock Python SDK, ensure that you have already registered your agent with the Datasherlock cloud. If you haven't done so, please refer to the Datasherlock platform documentation on agent registration.

Once your agent is registered, you can start using the Python SDK as follows:

from datasherlock import DataSherlock

# Initialize the DataSherlock SDK with api token and database configuration
sherlock = DataSherlock(token="YOUR_API_TOKEN", db_type="mysql", db_config={
    'host': "localhost",
    'database': "employees",
    'user': "root",
    'port': 3306,
    'password': "college",
    'ssl_disabled': True
})

# Register your database with Datasherlock
registration_result = sherlock.register("employees")
print(registration_result)

# Ask a query to retrieve insights, Ask will return you pandas dataframe 
query_result = sherlock.ask("List of department")
print(query_result)

DataSherlock Class

  • token: Your API access token obtained during registration.
  • db_type: The type of the database you're using (e.g., "mysql").
  • region: Datasherlock region.
  • db_config: A dictionary containing your database configuration, including host, database name, user, port, password, and SSL settings.

SDK Methods

  • register(database_name): Registers your database with Datasherlock.
  • ask(query): Submits a query to Datasherlock and retrieves the result.
  • list(): Retrieves a list of available queries from Datasherlock.
  • db(): Retrieves a db client.

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

datasherlock-0.0.24.tar.gz (21.7 kB view details)

Uploaded Source

File details

Details for the file datasherlock-0.0.24.tar.gz.

File metadata

  • Download URL: datasherlock-0.0.24.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for datasherlock-0.0.24.tar.gz
Algorithm Hash digest
SHA256 dcbea3a7570ce08affc24bf1141dbfb1b4c0e66bcec048fad36b36cb1072e7aa
MD5 d5b90af93b44e0b3bcc7ec8ba3868f72
BLAKE2b-256 3bf076770264755c602a020dbc0e0a05eaf53f9e2eb77b1f725fee61f62a9dd8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page