Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Primer

Primer is a lightweight toolkit for debugging and benchmarking Python code.

With only one line inserted, primer improves your coding experience.

from primer import debug, profile, performance

Install

Requirements

  • Python >= 3.5
pip install primer-kit

Debug

Exception hook helps you debug your code whenever exception is raise.

debug.setup_hook()

Call decorator monitors every call to the function and its arguments.

@debug.call
def my_function(args):

Profile

Time and memory profilers measure the duration and memory allocation for some code.

with profile.time(), profile.memory():

They can also be used as decorators over functions. A log frequency of 10 outputs results once per 10 calls.

@profile.time(log_frequency=10)
def my_function(args):

Performance

Slot decorator converts all member variables to static slots, which saves memory and runs faster.

@performance.slot
class MyClass(object):

Shared ndarray can be passed across processes without copy, which saves memory by several times and runs faster.

import numpy as np
import multiprocessing as mp

arrays = [performance.SharedNDArray(np.random.rand(100000)) for _ in range(4)]
results = mp.Pool(4).map(np.sum, arrays)

Metadata

Release files for primer-kit 0.1.1a0

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

Source distribution (sdist)

Source distribution for primer-kit 0.1.1a0
File Size Uploaded Provenance Actions
primer-kit-0.1.1a0.tar.gz 5.4 kB Without provenance Details for primer-kit-0.1.1a0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for primer-kit 0.1.1a0
File Interpreter ABI Platform Actions
primer_kit-0.1.1a0-py3-none-any.whl Python 3 none any Details for primer_kit-0.1.1a0-py3-none-any.whl

Total release size: 11.7 kB

Release files / primer-kit-0.1.1a0.tar.gz

Download URL primer-kit-0.1.1a0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9b50e1c15a9081b11823203e033c9c475ac52d598ad9e8bdce8b2959488480ff
BLAKE2b-256 checksum
How to use checksums
6f8893b47a7a774cbe1a398ce8e58568440c367dd72f985a4f51dc3997900520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / primer_kit-0.1.1a0-py3-none-any.whl

Download URL primer_kit-0.1.1a0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8faa87470dd7fb58c626f2e76325ce99aaeae8eb1cef39a03ae9f56dc59e7dc7
BLAKE2b-256 checksum
How to use checksums
dfcc9aa0984d2ffeb0c608fa0f711b3e7aa3670439519a732fc7ade6ab5d5e1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Security for primer-kit 0.1.1a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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