Skip to main content

Send custom, realtime logs to Pantomath through the Pantomath Python SDK

Project description

Pantomath SDK

Installation and Setup

  1. Install the Pantomath SDK for Python:

    $ pip install pantomath-sdk
    

    This is the preferred method to install the Pantomath SDK, as it will always install the most recent stable release.

    If you don't have pip installed, this Python installation guide can guide you through the process.

  2. Add configuration ENVs to your runtime:

    PANTOMATH_API_BASE_URL = ******,
    PANTOMATH_API_KEY = ******
    

Example

from pantomath_sdk import PantomathSDK, AstroTask, S3Bucket, SnowflakePipe
from time import sleep


def main():
    # Create an instance of the PantomathSDK
    pantomath_sdk = PantomathSDK(api_key="****")

    # Construct your job
    astro_task = AstroTask(
        name="astro_task_1",
        dag_name="astro_dag_1",
        host_name="astro_host_1"
    )

    # Construct your source and target data sets
    source_data_sets = [
        S3Bucket(s3_bucket="s3://some-bucket-1/file.csv")
    ]

    target_data_sets = [
        SnowflakePipe(
            name="snowpipe_1",
            schema="snowflake_schema_1",
            database="snowflake_database_1",
            port=443,
            host="snowflake_host_1.example.com",
        )
    ]

    # Capture your job run
    job_run = pantomath_sdk.new_job_run(
        job=astro_task,
        source_data_sets=source_data_sets,
        target_data_sets=target_data_sets,
    )
    job_run.log_start(message="Starting Astro task")
    for i in range(5):
        job_run.log_progress(
            message=f"Completed step {i + 1}",
            records_effected=i * 100
        )
        sleep(2)
    job_run.log_success(message="Succeeded!")


if __name__ == '__main__':
    main()

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

pantomath_sdk-0.1.0.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

pantomath_sdk-0.1.0-py3-none-any.whl (46.8 kB view details)

Uploaded Python 3

File details

Details for the file pantomath_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: pantomath_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for pantomath_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 79aaaacee7716cbc1315e23975ebb3991dc878a12511723a7287152814c414db
MD5 fdcabad4fc2538b52d933fbbcfee5d71
BLAKE2b-256 0698db0c99a761df3c7bd97f65e7574a8044203de8c6d321221ba5cd3cfc64ee

See more details on using hashes here.

File details

Details for the file pantomath_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pantomath_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2667bd29b2adf2762d15e0d7f3433878427b956b99376f21cdd36b4898daba91
MD5 ac3181ef63ea5117b0360873eec7d943
BLAKE2b-256 eec205398a889e2a2f2a5167d27049918e27691211287412ea7873c437634136

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page