Observed since 20 Oct, 17:41 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A lightweight framework for defining arbitrary business metrics as Python code.
A lightweight framework for defining arbitrary business metrics as Python code.
pip install abstract-metrics
compute method that returns your metric.Let's say you want to write a metric that checks if one of your applications follows your organizations application naming standards. We will use the ApplicationMetricBoolean type to do this. All metrics are formated as {subject}Metric{type}. In this case, our subject is an Application and our type is Boolean.
Because Applications are our subject, we need to subclass ApplicationMetricBoolean. This class has a few methods that we can use to help us compute our metric. The most important one is compute. This method is called by the runner and should return a the boolean value. Additionally, we should use the application property (via the Application wrapper) to store any context we need to compute this metric.
from metric import Application, ApplicationMetric
from metric.utils import MatrixRunner
from metric.types import OutputFormat
def main():
# Construct list of basic Application objects
apps = [Application(app) for app in ["myorg-sales-app", "sandbox-dinasour"]]
# Construct a list of our metrics
metrics = [AppNameCompliance]
# This will not only construct our Application Metrics but it will also execute
# them and print them to stdout as a table.
MatrixRunner(format=OutputFormat.OUTPUT_FORMAT_TABLE).run(apps, metrics)
class AppNameCompliance(ApplicationMetricBoolean):
r"""All Application names should start with 'myorg-'."""
def compute(self):
if self.application.name.startswith("myorg-"):
return True
return False
If we run this code, we'll get the following output:
Application AppNameCompliance
myorg-finance-app True
myorg-marketing-service True
myorg-sales-app True
sandbox-dinasour False
pypistats · 48 observations shown. Missing days are unknown. Source category: overall: without mirrors.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-19 – 2026-10-19 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-10-13 – 2026-10-13 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-10-10 – 2026-10-10 | 3 | 2026-10-20T20:54:07.4160035Z |
| 2026-10-09 – 2026-10-09 | 4 | 2026-10-20T20:54:07.4160035Z |
| 2026-10-08 – 2026-10-08 | 3 | 2026-10-20T20:54:07.4160035Z |
| 2026-10-07 – 2026-10-07 | 2 | 2026-10-20T20:54:07.4160035Z |
| 2026-10-06 – 2026-10-06 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-10-05 – 2026-10-05 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-10-01 – 2026-10-01 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-30 – 2026-09-30 | 8 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-29 – 2026-09-29 | 3 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-28 – 2026-09-28 | 4 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-27 – 2026-09-27 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-26 – 2026-09-26 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-25 – 2026-09-25 | 2 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-23 – 2026-09-23 | 11 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-22 – 2026-09-22 | 2 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-21 – 2026-09-21 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-14 – 2026-09-14 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-12 – 2026-09-12 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-10 – 2026-09-10 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-09 – 2026-09-09 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-07 – 2026-09-07 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-06 – 2026-09-06 | 6 | 2026-10-20T20:54:07.4160035Z |
| 2026-09-03 – 2026-09-03 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-31 – 2026-08-31 | 5 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-30 – 2026-08-30 | 2 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-29 – 2026-08-29 | 3 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-28 – 2026-08-28 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-24 – 2026-08-24 | 11 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-23 – 2026-08-23 | 3 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-20 – 2026-08-20 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-18 – 2026-08-18 | 54 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-17 – 2026-08-17 | 8 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-16 – 2026-08-16 | 2 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-14 – 2026-08-14 | 4 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-13 – 2026-08-13 | 2 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-09 – 2026-08-09 | 4 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-06 – 2026-08-06 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-04 – 2026-08-04 | 7 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-03 – 2026-08-03 | 12 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-02 – 2026-08-02 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-08-01 – 2026-08-01 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-07-29 – 2026-07-29 | 4 | 2026-10-20T20:54:07.4160035Z |
| 2026-07-27 – 2026-07-27 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-07-26 – 2026-07-26 | 1 | 2026-10-20T20:54:07.4160035Z |
| 2026-07-24 – 2026-07-24 | 3 | 2026-10-20T20:54:07.4160035Z |
| 2026-07-23 – 2026-07-23 | 2 | 2026-10-20T20:54:07.4160035Z |
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0.dev5 | 20 Sept 2023 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 17:41 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:23d92fce21e80d69f7cb9e94db403d079f177cc091226f6c2f41057fcc30bdb9