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',
    billing_period='current' | 'previous' # Current is a default billing period
)

# 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.5.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

klarity_connector-0.1.5-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: klarity-connector-0.1.5.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for klarity-connector-0.1.5.tar.gz
Algorithm Hash digest
SHA256 dffbd0884e0e0926e1c3b21ef385a374e28cb326d4af0242cbe007d365b4e24e
MD5 79358b64888bebeae5a3712b38f17c04
BLAKE2b-256 7bd34d87729f06c610e4eb95223d144d69d49839658124c9a7e4d4b5a4acdd9c

See more details on using hashes here.

File details

Details for the file klarity_connector-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for klarity_connector-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e46db5acf138323236de5d4bbd0c44d0e2c876c02f17f1b81ae342b1662a5e69
MD5 bee1a6cd6251fb7e447b5e665d667d8a
BLAKE2b-256 40648796ae9b00858691c45b7229fc0d79a68f356200a195e9251d9ae95d7a4a

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