Skip to main content

Python connector to GraphQL API of Klarity

Project description

Klarity Connector

Python connector for Klarity API

Installation

pip install klarity-connector

Usage

from klarity_connector import KlarityConnector

# Create a connector
connector = KlarityConnector(
    region='eu'
    api_key='YOUR_API_KEY',
)

# Sending GraphQL query
query = """
    query applications{
        applicationsPaginated(limit: 100, page: 0){
            results{
                name,
                cost{
                    currentMonth
                }
            }
        }
    }
"""

response = connector.graphql_request(query)

# Sending GraphQL mutation
mutation = """
    mutation createApplication($name: String!, $description: String){
        createApplication(name: $name, description: $description){
            name
        }
    }
"""

variables = {
    'name': 'My new application',
    'description': 'My new application description'
}

response = connector.graphql_request(mutation, variables)

Official product documentation

docs

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

klarity-connector-0.1.2.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file klarity-connector-0.1.2.tar.gz.

File metadata

  • Download URL: klarity-connector-0.1.2.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for klarity-connector-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5ed6c9c7e0146d0bc1329628fb6babc8557e0a6d68e3046c077eca5ac823d85d
MD5 d2765ebdc8051ee04b8c6101f64ce20a
BLAKE2b-256 4c7e79a8b09c67f99211f34eb96e50a7225fb6f539f213b1fc9edfe31e0f1f62

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