Skip to main content

Python SDK for the G2M Snowflake Native App Platform API

Project description

Python SDK for the G2M Platform API

Overview

This Python client will give you access to the G2M API. See files in the examples folder for examples showing how to use the client. Note that a client_id should always be provided when querying the API; it is used for reporting purposes.

Installation instructions

Getting the client set up will require the following:

  1. Install the latest version of the client on your local machine:
pip install g2m-snowflake-sdk-python -U
  1. Get an API username and password from your G2M admin (you may need SSO credentials from your local admin instead).

  2. Confirm you are able to connect to the API, and check the API version as follows from a Python session:

>>> from g2mclient import Analyzer
>>> analyzer = Analyzer(host="<your host>")
>>> analyzer.login(
    user="snowflakeuser",
    account="account-idenfitier",
    endpoint="xyz.snowflakecomputing.com",
    role="snowflakerole",
    snowflake_account_url="xyz.snowflakecomputing.com",
    lifetime=59,
    renewal_delay=54
)
Login successful
>>> Analyzer().version()
{'status': 200, 'response': {'version': 'x.x.xxx', 'tenant': <your tenant name>, 'copyright': '2024 (c) Go2Market Insights Inc. All rights reserved.'}}

Testing instructions

If you are developing the SDK and would like to test the repo, clone it locally using git then run the following from the root directory:

python -m unittest tests.test_all -v   # all tests
python -m unittest tests.test_quick -v # quick tests

Make sure you update the config.json file first to include the name of your API tenant. To run a single test case do:

python -m unittest tests.test_all.PropensityTest.test_logistic_regression_classifier -v

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

g2m_snowflake_sdk_python-1.0.3.tar.gz (38.7 kB view details)

Uploaded Source

File details

Details for the file g2m_snowflake_sdk_python-1.0.3.tar.gz.

File metadata

  • Download URL: g2m_snowflake_sdk_python-1.0.3.tar.gz
  • Upload date:
  • Size: 38.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for g2m_snowflake_sdk_python-1.0.3.tar.gz
Algorithm Hash digest
SHA256 05244de39d25d210c8c8456939de82a33ebe086ec9bf8f82c19534bed953b437
MD5 58978c7a7f24346e1f2212c5d6d6539e
BLAKE2b-256 c7e0447600c40ced44174e90e41ab0755a7c712170e4d00f246865dcb4da30e2

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