Skip to main content

Python SDK for Optic

Project description

Optic Python Sdk

Build status

The code library standardizing data capture for Optic in Python applications. We have a list of middleware available for some frameworks, if we are missing the framework join our community and suggest the next framework or develop it with us.

Requirements

The library requires @useoptic/cli to be installed, instructions on installing it are available https://www.useoptic.com/docs/.

Install

pip install optic-sdk

Usage

The library provides apis to interact with optic cli. This library does not provide ecs converters and should be used along with framework specific optic libraries

Configuration

Environment variables can also be used to set the values.

  • ENABLE: boolean (defaults to True) Programmatically control if capturing data and sending it to Optic
  • UPLOAD_URL: string (defaults to os.environ['OPTIC_LOGGING_URL']) The URL to Optics capture URL, if left blank it will expect OPTIC_LOGGING_URL environment variable set by the Optic CLI
  • CONSOLE: boolean (defaults to False) Send to stdout/console for debugging
  • framework: string Additional information to inform Optic of where it is capturing information
  • LOG: boolean (defaults to False) Send to log file
  • LOG_PATH: boolean (defaults to ./optic.log) Log file path
  • LOCAL: boolean (defaults to True) Send to optic cli

Example

    from optic import OpticConfig, Optic
    def send_to_optic_cli(ecs_object):
        """
        ecs_object: Json serializble ecs object
        """
        config = OpticConfig(framework="<insert name>", CONSOLE=True)
        optic = Optic(config)
        optic.send_to_local_cli(ecs_object) //send to optic cli
        optic.send_to_file(ecs_object) //save to file
        optic.send_to_console(ecs_object) //send to stdout

License

This software is licensed under the MIT license.

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

optic-sdk-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

optic_sdk-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file optic-sdk-0.1.0.tar.gz.

File metadata

  • Download URL: optic-sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.7.11 Linux/5.8.0-1039-azure

File hashes

Hashes for optic-sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 908eaf726bf8b316df94882f800ba51eca0e1eb451392423d1878b2439c7ab42
MD5 e1f3526973d308b89736b348e3264487
BLAKE2b-256 92414dd256fdca8abf489c0e0d1af0183ae0cb7188fdeccf4520fea252d3b00e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: optic_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.7.11 Linux/5.8.0-1039-azure

File hashes

Hashes for optic_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae777daed7afed64054be4eddd4e92c584c13f62d63301fa4a491a32aca8ef41
MD5 0ec3dad411aa7432136a0854ea281bd6
BLAKE2b-256 64039d6e6d49aedfe77e79784897b5f5583f87e08d8b475b5b03f6d7e81ee2a9

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