Skip to main content
Build Status

A Python module that provides the tools you need to authenticate with, and use the Qubole Data Service API.

Installation

From PyPI

The SDK is available on PyPI.

$ pip install qds-sdk

From source

  • Get the source code:

  • Run the following command (may need to do this as root):

    $ python setup.py install
  • Alternatively, if you use virtualenv, you can do this:

    $ cd qds-sdk-py
    $ virtualenv venv
    $ source venv/bin/activate
    $ python setup.py install

This should place a command line utility qds.py somewhere in your path

$ which qds.py
/usr/bin/qds.py

CLI

qds.py allows running Hive, Hadoop, Pig, Presto and Shell commands against QDS. Users can run commands synchronously - or submit a command and check its status.

$ qds.py -h  # will print detailed usage

Examples:

  1. run a hive query and print the results

    $ qds.py --token 'xxyyzz' hivecmd run --query "show tables"
    $ qds.py --token 'xxyyzz' hivecmd run --script_location /tmp/myquery
    $ qds.py --token 'xxyyzz' hivecmd run --script_location s3://my-qubole-location/myquery
  2. pass in api token from bash environment variable

    $ export QDS_API_TOKEN=xxyyzz
  3. run the example hadoop command

    $ qds.py hadoopcmd run streaming -files 's3n://paid-qubole/HadoopAPIExamples/WordCountPython/mapper.py,s3n://paid-qubole/HadoopAPIExamples/WordCountPython/reducer.py' -mapper mapper.py -reducer reducer.py -numReduceTasks 1 -input 's3n://paid-qubole/default-datasets/gutenberg' -output 's3n://example.bucket.com/wcout'
  4. check the status of command # 12345678

    $ qds.py hivecmd check 12345678
    {"status": "done", ... }
  5. If you are hitting api_url other than api.qubole.com, then you can pass it in command line as --url or set in as env variable

    $ qds.py --token 'xxyyzz' --url https://<env>.qubole.com/api hivecmd ...
    
    or
    
    $ export QDS_API_URL=https://<env>.qubole.com/api

SDK API

An example Python application needs to do the following:

  1. Set the api_token and api_url (if api_url other than api.qubole.com):

    from qds_sdk.qubole import Qubole
    
    Qubole.configure(api_token='ksbdvcwdkjn123423')
    
    # or
    
    Qubole.configure(api_token='ksbdvcwdkjn123423', api_url='https://<env>.qubole.com/api')
  2. Use the Command classes defined in commands.py to execute commands. To run Hive Command:

    from qds_sdk.commands import *
    
    hc=HiveCommand.create(query='show tables')
    print "Id: %s, Status: %s" % (str(hc.id), hc.status)

example/mr_1.py contains a Hadoop Streaming example

Reporting Bugs and Contributing Code

  • Want to report a bug or request a feature? Please open an issue.

  • Want to contribute? Fork the project and create a pull request with your changes against unreleased branch.

Where are the maintainers ?

Qubole was acquired. All the maintainers of this repo have moved on. Some of the employees founded ClearFeed. Others are at big data teams in Microsoft, Amazon et al.

Release files for qds-sdk 1.17.0

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

Source distribution (sdist)

Source distribution for qds-sdk 1.17.0
File Size Uploaded
qds_sdk-1.17.0.tar.gz 108.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qds-sdk 1.17.0
File Interpreter ABI Platform
qds_sdk-1.17.0-py3-none-any.whl Python 3 none any Details

Total release size: 203.5 kB

Release files / qds_sdk-1.17.0.tar.gz

Download URL qds_sdk-1.17.0.tar.gz
Size 108.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1de5d17995c6e0ea6ca91378aa953694248018268d300cbdb5cd4673ea101477
BLAKE2b-256 checksum
How to use checksums
074ad8bbee639ee1a70fcd03774b6f4aa29dc75c9d733d79121028dde60458c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / qds_sdk-1.17.0-py3-none-any.whl

Download URL qds_sdk-1.17.0-py3-none-any.whl
Size 94.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
383840feb8972786ab604e8004bf0cd7dc035cc65bfd173593d1d4bd45e4815c
BLAKE2b-256 checksum
How to use checksums
b12126eac9beae9dcf469b9e874c95139e43330e8e1557b2c62e106bb1f7cbcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.17.0 This release

2 release files

1.16.1

1 release file

1.16.0

1 release file

1.15.2

1 release file

1.15.1

1 release file

1.15.0

1 release file

1.14.0

1 release file

1.13.2

1 release file

1.13.1

1 release file

1.12.0

1 release file

1.11.1

1 release file

1.11.0

1 release file

1.10.4

1 release file

1.10.3

1 release file

1.10.2

1 release file

1.10.1

1 release file

1.10.0

1 release file

1.9.9

1 release file

1.9.8

1 release file

1.9.7

1 release file

1.9.6

1 release file

1.9.5

1 release file

1.9.4

1 release file

1.9.3

1 release file

1.9.2

1 release file

1.9.1

1 release file

1.9.0

1 release file

1.8.0

1 release file

1.7.0

1 release file

1.6.2

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.18

1 release file

1.0.16

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