Skip to main content

MVX Common

common-ci

mvx-common is a Python package with foundation-level infrastructure for MVX Python projects.

Its main public components are MVX Logger and MVX Metrics.

MVX Logger

MVX Logger is a lightweight structured event logging infrastructure for applications and reusable Python libraries that need rich and flexible diagnostic visibility.

Most logging tools focus on formatting, routing, or collecting log records. MVX Logger focuses on the step before that: how code creates structured diagnostic events, controls their diagnostic data, and hands them over for delivery.

Key features

  • log structured events with rich, flexible, and structured diagnostic info instead of hand-written log strings
  • control logging width through event policies without changing calling code, focusing logs on current diagnostic needs
  • keep event diagnostic data well-shaped and clean through centralized payload normalization
  • change logging destination and formatting without changing event-producing code
  • deliver events to standard logging streams, files, async sinks, or custom backends
  • keep the logging path fast and thread-safe while slow backends are handled outside the business flow
  • log standardized business operation lifecycles without writing logging code inside the operation body
  • capture selected call arguments, results, errors, and context fields as structured event diagnostic info
  • keep business logic focused on the operation itself instead of repetitive try/except logging blocks
  • start using it almost as simply as regular logging, then move to deeper structured diagnostics when needed

What MVX Logger is not

MVX Logger is not a replacement for logging, structlog, loguru, or OpenTelemetry.

It is a structured event creation layer that can sit before those tools or other delivery backends.

The goal is not to own the whole observability stack. The goal is to make diagnostic event creation explicit, structured, configurable, and safe to use across project boundaries.

MVX Logger documentation

Overview:

https://mvx-lib.readthedocs.io/en/latest/common/logger/overview.html

Getting started:

https://mvx-lib.readthedocs.io/en/latest/common/logger/getting_started/

Advanced usage:

https://mvx-lib.readthedocs.io/en/latest/common/logger/advanced_usage/

log_invocation guide:

https://mvx-lib.readthedocs.io/en/latest/common/logger/log_components/log_invocation/overview.html

MVX Metrics

MVX Metrics is a lightweight metrics infrastructure for applications and reusable Python libraries that need measurable runtime visibility without binding production code to a specific monitoring backend.

Most monitoring tools focus on collecting, exporting, storing, querying, or visualizing metrics. MVX Metrics focuses on the step before that: how code reports structured domain events, how metrics interpret those events, and how quantitative runtime state is built from them.

Production code should not have to manually update raw counters or know which measurements are derived from a specific operation. It should describe what happened. Metrics decide which events are relevant, how those events affect their dimensions, and how the resulting state is exposed through snapshots.

Key features

  • emit structured metric events instead of manually updating raw counters in production code
  • let production code describe what happened while metrics decide how to interpret events and update quantitative dimensions
  • keep domain-specific metric meaning close to the component that owns the domain, without coupling that component to metric collection, export, storage, or visualization infrastructure
  • keep recorders, runtimes, and adapters generic, so they can collect and deliver metric events without knowing business-specific metric semantics
  • change the final observability backend by replacing recorders or adapters instead of changing event-producing production code
  • keep metric emission lightweight on the production path while aggregation and delivery are handled outside the business operation flow
  • support both synchronous and asynchronous event-producing code through a small recorder contract and runtime boundary
  • safely bridge thread and event-loop boundaries for metric processing
  • expose metric snapshots as stable aggregated runtime state for diagnostics, tests, dashboards, exporters, and higher-level health checks
  • provide clear extension points through snapshots, recorder hooks, custom recorders, and metrics runtime support without turning the core package into a monitoring platform

What MVX Metrics is not

MVX Metrics is not a replacement for Prometheus, OpenTelemetry, StatsD, or monitoring dashboards.

It is a backend-neutral metric event and aggregation layer that can sit before those tools or other export backends.

The goal is not to own the whole observability stack. The goal is to make metric event creation, aggregation, and snapshot exposure explicit, structured, configurable, and safe to use across project boundaries.

MVX Metrics documentation

Overview:

https://mvx-lib.readthedocs.io/en/latest/common/metrics/overview.html

Getting started:

https://mvx-lib.readthedocs.io/en/latest/common/metrics/getting_started/

Architecture:

https://mvx-lib.readthedocs.io/en/latest/common/metrics/architecture/

Other utilities

mvx-common also includes smaller foundation utilities used by MVX packages:

structured errors
public API error normalization helpers
asyncio cancellation helpers

These utilities support predictable public errors, explicit cancellation behavior, and consistent diagnostics.

Requirements

mvx-common requires Python 3.11 or newer.

Python >= 3.11

Installation for development

From the package directory:

cd common
python -m pip install -e ".[dev]"

To install documentation dependencies as well:

python -m pip install -e ".[dev,docs]"

Running checks

From the package directory:

scripts/check.sh

The check script runs:

black --check
ruff check
mypy
pytest with branch coverage

The package requires at least 90% branch coverage.

Documentation

Full documentation:

https://mvx-lib.readthedocs.io/en/latest/

Version history:

https://mvx-lib.readthedocs.io/en/latest/common/version_history/

Building documentation

From the repository root:

scripts/docs.sh

The built HTML documentation is written to:

docs/_build/html/

Project status

mvx-common is an early public package.

The implementation reflects the needs of the project at this stage. The code is covered with tests, CI checks, and documentation that describes both ordinary usage and extension points.

Feedback, bug reports, documentation corrections, and practical feature requests are welcome.

Contributing

Repository-level contribution rules are documented in:

../CONTRIBUTING.md

License

mvx-common is licensed under the Apache License, Version 2.0.

See:

LICENSE
NOTICE

Author

Vladimir Makarov

Contact:

makarovvv.dream@gmail.com

Metadata

Release files for mvx-common 0.3.0

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

Source distribution (sdist)

Source distribution for mvx-common 0.3.0
File Size Uploaded Provenance Actions
mvx_common-0.3.0.tar.gz 147.4 kB With provenance Details for mvx_common-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mvx-common 0.3.0
File Interpreter ABI Platform Actions
mvx_common-0.3.0-py3-none-any.whl Python 3 none any Details for mvx_common-0.3.0-py3-none-any.whl

Total release size: 237.0 kB

Release files / mvx_common-0.3.0.tar.gz

Download URL mvx_common-0.3.0.tar.gz
Size 147.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d28934c4f32f7642ce0da257e89c18bd4dbc9201ffa0e8bb0b287928a4035dee
BLAKE2b-256 checksum
How to use checksums
0fa38a164d10d6316cdaeb3a47b2bb93b671482e8fd526df4303e204434e040a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.

Transparency log

Release files / mvx_common-0.3.0-py3-none-any.whl

Download URL mvx_common-0.3.0-py3-none-any.whl
Size 89.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a08a29bb7ceb84c4d3a4eecbe809a4218759fcbb757eb7dc7836a5bdf40bae22
BLAKE2b-256 checksum
How to use checksums
482f04f9b2d64d21508dca387250eebfb560284fe84f8bfc90c458fa714deabc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.

Transparency log

Security for mvx-common 0.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mvx_common-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.

Transparency log

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