Skip to main content

A CLI utility for Snowflake Snowpipe REST APIs

Project description

Snowpipe CLI

Snowpipe CLI provides access to the Snowpipe REST API via the CLI. The script uses the snowflake-ingest python package to call the REST endpoints.

There is also a JWT generator that you can use to simply generate a JWT for adhoc use.

Installation

You can install the latest version with pip

pip install snowpipe-cli

Note: If you are installing into a virtual environment, you may need to deactivate and activate again in order for the snowpipe command to work correctly from your shell.

Requirements

The script requires Python3.6+, but has only been tested on Python 3.9.

Configuration

Create a config file with the Snowflake credentials and account information. The config file must be YAML like below:

url: phdata.snowflakecomputing.com
account: PHDATA
user: USER
key_fp: SHA256:something_from_snowflake_user
key_file: /path/to/user/private/key.pem
key_password: optional_password

See also example config.

The account value must not include the region and cloud if present in the Snowflake URL. The url is the URL of the Snowflake instance minus the scheme. For example, if your URL is https://tacos.us-east-2.azure.snowflakecomputing.com, then the account will be tacos and the url will be tacos.us-east-2.azure.snowflakecomputing.com.

To generate a private key, see Key Pair Authentication & Key Pair Rotation. When verifying the fingerprint, record the value into the key_fp YAML key.

Usage

The commands below are examples of calling the snowpipe script from your shell after it has been installed with pip. If you have cloned the repository, you can also invoke the script from its parent directory with ./snowpipe.py, or you can run from the src directory with python -m snowpipe_cli.

Show the script help, including the subcommands:

snowpipe -h

Show subcommand help:

snowpipe <subcommand> -h

Run a subcommand:

snowpipe <subcommand> <config_file> <other_args>...

Enable debug logging:

snowpipe -d <subcommand> <config_file>

Contributing

Install the prerequisites:

pip install -r requirements.txt

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

snowpipe-cli-0.0.1a14.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

snowpipe_cli-0.0.1a14-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file snowpipe-cli-0.0.1a14.tar.gz.

File metadata

  • Download URL: snowpipe-cli-0.0.1a14.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

File hashes

Hashes for snowpipe-cli-0.0.1a14.tar.gz
Algorithm Hash digest
SHA256 ea273450d6a7bd7aa3cdb740595d99504ee0353dccdae8acd03504a524a284df
MD5 b77513f4039eeef9b780c8d8bcb9968e
BLAKE2b-256 3cceb584e65e1d5be003b563e7e132a6d993d76377aa768a2c4a450afb41b937

See more details on using hashes here.

File details

Details for the file snowpipe_cli-0.0.1a14-py3-none-any.whl.

File metadata

  • Download URL: snowpipe_cli-0.0.1a14-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

File hashes

Hashes for snowpipe_cli-0.0.1a14-py3-none-any.whl
Algorithm Hash digest
SHA256 e193ae46f8cc46152eb1a308fb96e890467420d4578200166c9bf207eaa273a4
MD5 8e62be0f38ff5cd2e24f3f1d51ceaed9
BLAKE2b-256 b0d2eb281a8dea51c822c2e44407d07309ba04008fabca5f4e48f4218ca6729e

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