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_introspection import FlaskIntrospection
    
    app = flask.Flask(__name__)
    
    app.route("/test", methods=["POST"])
    def test_route():
        return "Test Response", 200
    
    introspection_client = IntrospectionClient(
        session=requests.Session(),
        api_url="https://api.demin.dev/i8t/checkpoints/unique-tenant-id",
        name="app",
    )
    flask_introspection = FlaskIntrospection(introspection_client)
    flask_introspection.register(app)
  2. Instrument all outbound HTTP requests (currently only requests is supported):

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

    from i8t.client import IntrospectionClient, IntrospectionDecorator, introspect
    
    @introspect
    def test_func(first, second):
        return first + second
    
    introspection_client = IntrospectionClient(
        session=requests.Session(),
        api_url="https://api.demin.dev/i8t/checkpoints/unique-tenant-id",
        name="app",
    )
    decorator = IntrospectionDecorator(introspection_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.2.tar.gz (14.0 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.2-py2.py3-none-any.whl (8.6 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for i8t-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4161f63baae12f3b594bf5c8177d8116bc96c71213499290f4917a56c2967b60
MD5 9c59f08a59b1d6514d39ef04e610f592
BLAKE2b-256 a2cae1c42e19f06476f4f5b66b2074358fb1aab86f5a166dbe45743d383a989c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for i8t-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 69054228bc9e2fea319d32f66425d7d4b4f8c00274a5fdab1fc545ef19962410
MD5 b4f4c94263eeb9059a862dea8c5baa01
BLAKE2b-256 9207a28901bc590fa48b0201a2215e3fece151dd528588acb07a0b74e5d4ab4e

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