Skip to main content

High-level Databricks client

Project description

PyPI - Version GitHub Build

License PyPI - Python Version PyPI - Downloads

Ruff Checked with mypy

dbxio: High-level Databricks client

Overview

dbxio is a high-level client for Databricks that simplifies working with tables and volumes. It provides a simple interface for reading and writing data, creating and deleting objects, and running SQL queries and fetching results.

Why dbxio?

  1. dbxio connects the power of Databricks SQL and Python for local data manipulation.
  2. dbxio provides a simple and intuitive interface for working with Databricks Tables and Volumes. Now it's possible to read/write data with just a few lines of code.
  3. For large amounts of data, dbxio uses intermediate object storage of your choice to perform bulk upload later (see COPY INTO for more details). So, you can upload any amount of data, and dbxio will take care of synchronizing the data with the table in Databricks.

Alternatives

Currently, we are not aware of any alternatives that offer the same functionality as dbxio. If you come across any, we would be interested to learn about them. Please let us know by opening an issue in our GitHub repository.


Installation

dbxio requires Python 3.9 or later. You can install dbxio using pip:

pip install dbxio

dbxio by Example

import dbxio

client = dbxio.DbxIOClient.from_cluster_settings(
    cluster_type=dbxio.ClusterType.SQL_WAREHOUSE,
    http_path='<YOUR_HTTP_PATH>',
    server_hostname='<YOUR_SERVER_HOSTNAME>',
    settings=dbxio.Settings(cloud_provider=dbxio.CloudProvider.AZURE),
)

# read table
table = list(dbxio.read_table('catalog.schema.table', client=client))

# write table
data = [
    {'col1': 1, 'col2': 'a', 'col3': [1, 2, 3]},
    {'col1': 2, 'col2': 'b', 'col3': [4, 5, 6]},
]
schema = dbxio.TableSchema.from_obj(
    {
        'col1': dbxio.types.IntType(),
        'col2': dbxio.types.StringType(),
        'col3': dbxio.types.ArrayType(dbxio.types.IntType()),
    }
)
dbxio.bulk_write_table(
    dbxio.Table('domain.schema.table', schema=schema),
    data,
    client=client,
    abs_name='blob_storage_name',
    abs_container_name='container_name',
    append=True,
)

Cloud Support

dbxio supports the following cloud providers:

  • Azure
  • AWS (in plans)
  • GCP (in plans)

Project Information

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

dbxio-0.5.3.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

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

dbxio-0.5.3-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file dbxio-0.5.3.tar.gz.

File metadata

  • Download URL: dbxio-0.5.3.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dbxio-0.5.3.tar.gz
Algorithm Hash digest
SHA256 4bfe11291c391c14ffe71a5b77a01b88383b7b6b870a2cca0fc2547d01129c1e
MD5 c4f660b9b3e2d41411b01575cca8ed09
BLAKE2b-256 ab780eae1d4f1b0c29f5102743007a3ab5f1abcb54ce2e04fe8d5fe9944da52c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbxio-0.5.3.tar.gz:

Publisher: release.yml on Toloka/dbxio

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

File details

Details for the file dbxio-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: dbxio-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dbxio-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 96d1f25d8f9d71662bd3238750897f560aeb9264be8915d45d65588ae38ba3bd
MD5 88ce128b611eae4dd0aa32618acb349a
BLAKE2b-256 6c1dd9528f7173867300f41a543b6726e2684451b21614bbbce936a7f6e8c7c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbxio-0.5.3-py3-none-any.whl:

Publisher: release.yml on Toloka/dbxio

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