Skip to main content

MLens Protobuf schemas generated Python package

Project description

MLens Proto

Protobuf schemas and generated packages for simple, fast experiment tracking. Use the prebuilt packages (npm/PyPI) or generate code for your language of choice.

What’s inside

  • Minimal, pragmatic schema (mlens.v1):
    • Experiment and Run metadata
    • Params (string key/value)
    • Scalar metrics (step, timestamp, value)
    • Append-only RunEvent stream (param_set, metric)

File layout:

  • mlens_proto/proto/common.proto
  • mlens_proto/proto/experiment.proto
  • mlens_proto/proto/events.proto

Install (prebuilt packages)

JavaScript/TypeScript:

npm i @melikbugra/mlens-proto

Python:

pip install mlens-proto

QA (pre-release) builds may be published under the next tag for npm and TestPyPI for Python.

Quick usage

TypeScript:

import { ExperimentMeta, RunMeta, RunEvent } from '@melikbugra/mlens-proto';

const exp: ExperimentMeta = { experimentId: 'exp-1', name: 'Demo', createdAt: Math.floor(Date.now()/1000) };

Python:

from mlens_proto.proto import experiment_pb2 as exp_pb

exp = exp_pb.ExperimentMeta(experiment_id='exp-1', name='Demo', created_at=1700000000)

Generate code yourself

Python:

python -m pip install grpcio-tools protobuf
python -m grpc_tools.protoc \
  -I mlens_proto/proto \
  --python_out=src \
  mlens_proto/proto/*.proto

TypeScript (ts-proto):

npm i -D ts-proto protobufjs
protoc \
  -I mlens_proto/proto \
  --ts_proto_out=src/gen \
  --ts_proto_opt=esModuleInterop=true,outputServices=none,env=node \
  mlens_proto/proto/*.proto
npm run build

Versioning and CI/CD

  • develop → QA:
    • Semantic version bump (no tag), build and publish to TestPyPI and npm with next dist-tag (if NPM_TOKEN is provided)
  • main → tag:
    • Creates a git tag (semantic version)
  • tag → Prod publish:
    • Publishes to PyPI (Trusted Publisher) and npm (latest)

Set up:

  • PyPI/TestPyPI Trusted Publisher: Link this repo to PyPI/TestPyPI via OIDC (no tokens needed).
  • NPM publish: Add NPM_TOKEN (Automation token) to repo secrets.

License

MIT

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

mlens_proto-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlens_proto-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file mlens_proto-1.0.0.tar.gz.

File metadata

  • Download URL: mlens_proto-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mlens_proto-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8d807c12598d0c246e2d2f3a186fcef015b7c3a63840bd0a3f4433b1705a9ac2
MD5 ac9381ed57f34fbb92cb536741893beb
BLAKE2b-256 6a756eccd90ecc452380d1f9229254fa1e9062f7926b6d8043203cede2302c6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlens_proto-1.0.0.tar.gz:

Publisher: publish-on-tag.yml on melikbugra/mlens-proto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mlens_proto-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mlens_proto-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mlens_proto-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd4734304eaec26d4e63977a09ebef54ea503909039e4725d6a1deae10ff3526
MD5 9299a7e02b16d063dcff7f9728005f2b
BLAKE2b-256 534630610db13d0a5b92b6c1981598decc5c7e8ff7e6698ce83454fa3ced18fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlens_proto-1.0.0-py3-none-any.whl:

Publisher: publish-on-tag.yml on melikbugra/mlens-proto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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