Measure is a metrics library that allows the user to swap metrics provider ie. (statsd, cloudwatch). It also provides an abstraction for creating metrics.
import measure
stat = measure.stats.Stats("homepage", measure.Meter("pageviews", "Pageview on homepage"), client=measure.client.PyStatsdClient())
stat.pageviews.mark()#TODO define each of these and their usage / verb|function
TimerTimerDictCounterCounterDictMeterMeterDictGaugeGuageDictSetSetDictFakeStat
This project uses uv and mise for tooling.
# install tooling and create the virtualenv
mise install
mise run sync
# run tests
mise run test
# lint and format
mise run lint
mise run fmt
# type check
mise run typecheck
# build sdist + wheel into dist/
mise run buildReleases are published automatically to PyPI by .github/workflows/release.yaml
whenever the version in pyproject.toml changes on the default branch. The
workflow uses PyPI Trusted Publishing
via OIDC, so no API tokens are needed — configure trusted publishing on PyPI for
the measure project, pointing at this repo, the release.yaml workflow, and
the pypi GitHub environment.
To cut a release:
mise run bump-patch # or bump-minor / bump-major
git commit -am "release: vX.Y.Z"
git pushThe workflow will detect the new version, build, publish to PyPI, push a vX.Y.Z
tag, and create a GitHub release.
