Skip to main content

Overview

The tracking_lib is a python module that is used by the PA development team to orchestrate the control messages that are sent in the Control Channel. It uses the Web Frameworks' (Flask, FastAPI) feature to keep a state in the request lifecycle in order to maintain and communicate a transaction id among different services. The following section describes the supprted features.

Features

  • Create and store a Transaction id
  • Sent status messages for SUCCESS or FAILURE

Installation

pip install tracking-lib

How to use it

import os

from tracking_lib.config import Config
from tracking_lib.transaction import Transaction
from flask import Flask, jsonify

app = Flask(__name__)


def interactor_runc():
    # print(f"transaction_id in interactor func: {Transaction.read_transaction_id()}")
    return Transaction.read_transaction_id()


@app.route("/")
def hello_world_success():
    Transaction.init(Config(
         downstream_service="TVDI_CONFIGS_MANAGER",
        control_channel_project_id=os.getenv("CONTROL_CHANNEL_PROJECT_ID"),
        control_channel_topic_id=os.getenv("CONTROL_CHANNEL_TOPIC_ID")

    ))
    Transaction.set_transaction_id("123456")
    tr_id = interactor_runc()
    Transaction.set_transaction_status(src_event_name="AN_SRC_EVENT_NAME")
    return jsonify(message=tr_id)

Metadata

Release files for tracking-lib 0.1.30

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tracking-lib 0.1.30
File Size Uploaded
tracking_lib-0.1.30.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tracking-lib 0.1.30
File Interpreter ABI Platform
tracking_lib-0.1.30-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / tracking_lib-0.1.30.tar.gz

Download URL tracking_lib-0.1.30.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c4695d246d7e585af0ec9d4e1ded957bd035967cf538e883ca87c9c1ca0d0b74
BLAKE2b-256 checksum
How to use checksums
c5e4e536e251f05f0702622d6904c03956390cd80c2cf4d5824c787ed67e60f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / tracking_lib-0.1.30-py3-none-any.whl

Download URL tracking_lib-0.1.30-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3bc7eb9940fbe86aa25af2709aa23b7e0ef3647da15926a3f334df4dca19830
BLAKE2b-256 checksum
How to use checksums
ca1113ff0f830497f4e25a6222acf1f627fcff8f5915872fee1146247c043ac0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.1.30 This release

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page