Skip to main content

Doorda Python SDK

GitHub Action GitHub Action PyPI version PyPI pyversions

Requirements

Installation

PyPi

$ pip install doorda-sdk

Usage

DoordaHost

  1. Connect to database

    from doorda_sdk.host import client
    
    conn = client.connect(username="username",
                          password="password",
                          catalog="catalog_name",
                          schema="schema_name")
    cursor = conn.cursor()
    
  2. Execute Queries

    cursor.execute("SELECT * FROM table_name")
    
    # Returns generator of results
    # Does not put result into memory. Iterates through rows in a streaming fashion.
    # DEPRECATED
    for row in cursor.iter_result():
        # Do something with row
    # Use:
    for row in cursor:
        # Do something with row
    
    
    # Fetch all results
    rows = cursor.fetchall()
    
    # Fetch one results
    rows = cursor.fetchone()
    
    # Fetch multiple results
    rows = cursor.fetchmany(size=10)
    
    # Get list of column names
    cursor.col_names
    
    # Get column names mapped to data types
    cursor.col_types
    
  3. Simplified Functions

    # List Permissions
    ## Permissions are shown as a hierarchical tree structure
    ### Level 1 = Catalog, Level 2 = Schemas, Level 3 = Table Names
    
    permissions = cursor.permissions()
    print(permissions)
    
    # Check database connection
    results = cursor.is_connected()
    
    # List all catalogs
    rows = cursor.show_catalogs()
    
    # List all schemas
    rows = cursor.show_schemas("catalog_name")
    
    # List all tables
    rows = cursor.show_tables("catalog_name", "schema_name")
    
    # Get number of rows
    rows = cursor.table_stats(catalog="catalog_name", 
                              schema="schema_name",
                              table="table_name")
    

Find out more

To find out more about DoordaHost, head over to https://github.com/Doorda/Getting-Started

Metadata

Release files for doorda-sdk 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for doorda-sdk 2.0.1
File Size Uploaded
doorda_sdk-2.0.1.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for doorda-sdk 2.0.1
File Interpreter ABI Platform
doorda_sdk-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 31.8 kB

Release files / doorda_sdk-2.0.1.tar.gz

Download URL doorda_sdk-2.0.1.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a5f5d1343918612a2f5851fe5163f127c91e7ac7e95179e9d08e5f47e02312c8
BLAKE2b-256 checksum
How to use checksums
f69442cdb0fc0df27401fdf2bca9b22bb11365557db310414e0809de34ab6d87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / doorda_sdk-2.0.1-py3-none-any.whl

Download URL doorda_sdk-2.0.1-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d26c57c94f7c77f97270a52465101d4aea39a12bfb828f6613cc7473fc89d587
BLAKE2b-256 checksum
How to use checksums
0ea1b75ea0025bac00eb7c9a865e097462be5eba740a0587283a16b82a13a1a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.0.11

2 release files

1.0.10

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.1

1 release file

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