Skip to main content

CTX

Context package to use data between function calls, use timers and log it.

For example you want have some decision point in your code::

from pyctx.context import Context
ctx = Context('APP')
x = 100
y = (x + 1) * (x - 1)
ctx.log.set_data('isEven', y % 2)
ctx.log.set_data('y', y)
ctx.log.start_timer('timer1')
import time
time.sleep(1)
ctx.log.stop_timer('timer1')
with ctx.log.timeit('timer2_context_manager'):
    time.sleep(5)

ctx.finalize()
# {'type': 'APP', 'ctxId': '0fdecfe0-067e-4bdd-9920-3b7ed46d8a98', 'startTime': '2019-08-06 09:42:31.222184', 'endTime': '2019-08-06 09:42:37.236861', 'data': {'isEven': 1, 'y': 9999}, 'timers': {'timer1': 1.00633, 'timer2_context_manager': 5.002412}}

Release files for pyctx 0.1.3

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

Source distribution (sdist)

Source distribution for pyctx 0.1.3
File Size Uploaded
pyctx-0.1.3.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyctx 0.1.3
File Interpreter ABI Platform
pyctx-0.1.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 9.5 kB

Release files / pyctx-0.1.3.tar.gz

Download URL pyctx-0.1.3.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8dc3678efb0351e326d0482b860201003a71ec67e1f54785c5b0f8677065d638
BLAKE2b-256 checksum
How to use checksums
10c48bf68f7d76ddff2a3449f50d693995735b867638c2b7c30c8493e529f349
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release files / pyctx-0.1.3-py2.py3-none-any.whl

Download URL pyctx-0.1.3-py2.py3-none-any.whl
Size 5.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d0bd22aeeda5dbddeb6906fc491ecc6432c06a380061a3e8e7703f3e91a3ae35
BLAKE2b-256 checksum
How to use checksums
b0627fb3ea76c3a91b6300b221aa7974e82cb1d1f73171fdc729b829a925aab2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release history Release notifications | RSS feed

0.1.10

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

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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