Skip to main content

No project description provided

Project description

https://img.shields.io/pypi/v/i8t.svg https://img.shields.io/pypi/pyversions/i8t.svg tests Code style: Black

i8t instruments Python code to send checkpoints to i8t server.

Installation

pip install i8t

Usage

i8t can be used in a few ways:

  1. Instrument all inbound web requests (currently only Flask is supported):

    import flask
    import requests
    from i8t.instrument.flask_introspect import FlaskIntrospect
    
    app = flask.Flask(__name__)
    
    app.route("/test", methods=["POST"])
    def test_route():
        return "Test Response", 200
    
    introspect_client = IntrospectClient(
        session=requests.Session(),
        api_url="https://api.demin.dev/i8t/checkpoints/unique-tenant-id",
        name="app",
    )
    flask_introspect = FlaskIntrospect(introspect_client)
    flask_introspect.register(app)
  2. Instrument all outbound HTTP requests (currently only requests is supported):

    import requests
    from i8t.instrument.requests_introspect import RequestsIntrospect
    
    introspect_client = IntrospectClient(
        session=requests.Session(),
        api_url="https://api.demin.dev/i8t/checkpoints/unique-tenant-id",
        name="app",
    )
    requests_introspect = RequestsIntrospect(introspect_client)
    requests_introspect.register()
  3. Decorate any function to send its inputs and outputs:

    from i8t.client import IntrospectClient, IntrospectDecorator, introspect
    
    @introspect
    def test_func(first, second):
        return first + second
    
    introspect_client = IntrospectClient(
        session=requests.Session(),
        api_url="https://api.demin.dev/i8t/checkpoints/unique-tenant-id",
        name="app",
    )
    decorator = IntrospectDecorator(introspect_client)
    decorator.register()

Once initialized, the inputs and outputs of the instrumented calls are sent to the i8t server, where they can be later fetched at the same URL.

The fetched call checkpoints can be used to set up canned tests.

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

i8t-0.0.3.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

i8t-0.0.3-py2.py3-none-any.whl (9.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file i8t-0.0.3.tar.gz.

File metadata

  • Download URL: i8t-0.0.3.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.19

File hashes

Hashes for i8t-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a28a47c4ccf5304e0ed00e7339a403f1033e7ae856541b545110d6e331ace7e0
MD5 f541f5eeb3e44aab96a029e8071cd88a
BLAKE2b-256 9e0f67939f3d35f27757de2c74e4670f96c13b1ea2db56c25f2d5c1f39160d48

See more details on using hashes here.

File details

Details for the file i8t-0.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: i8t-0.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.19

File hashes

Hashes for i8t-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e7d05f56760b9234482e9c5a978a92d96af948cf4a2dad08402df2e0df808d77
MD5 70ffd3e52c6b6f0c2e7fc669c36b6c3f
BLAKE2b-256 5c59adc349ac6b98596d5da02ba8e1ccd2da4af13f33c3972113b7e86543a92f

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