Skip to main content

A tool to calculate the DORA Lead Time metric

Project description

Build and Test PyPI Downloads

DORA Lead Time Metric

DORA Lead Time for Changes

Lead Time for Changes is one of the four key DORA (DevOps Research and Assessment) metrics that measure software delivery performance. It measures the time it takes from when code is committed to when it is successfully running in production. A shorter lead time indicates an organization's ability to respond quickly to customer needs and fix problems rapidly.

This Python package calculates lead time by connecting data from Jira and GitHub. The calculation involves going from Projects → Releases → Stories → Pull Requests → Commits, calculating the lead time for each pull request, and averaging those over a given time period.

How to Use

See Calculate the DORA Lead Time Metric in Python for a detailed explanation of how to use this code. The code is at sualeh/dora-lead-time-metric.

Build

Install

  • Python 3.13 or higher
  • Poetry (Python dependency manager)

Clone the repository:

git clone https://github.com/sualeh/dora-lead-time-metric.git
cd dora-lead-time-metric

Install dependencies using Poetry:

poetry install

Create an .env file in the project root based on .env.example

Activate the Poetry environment:

poetry shell

Run the main application:

python -m dora_lead_time.main

Generate reports with code similar to the following:

from dora_lead_time.lead_time_report import LeadTimeReport

# Initialize the report generator
report = LeadTimeReport("releases.db")

# Generate a monthly report
monthly_data = report.monthly_lead_time_report(
    ["PROJECT1", "PROJECT2"],
    date(2023, 1, 1),
    date(2023, 12, 31)
)

# Visualize the report
plt = report.show_plot(monthly_data, title="Monthly Lead Time", show_trend=True)
plt.savefig('lead_time_trend.png')

With Docker

Build the Docker image:

docker build -t dora-lead-time-metric .

or download it from Docker Hub:

docker pull sualeh.fatehi/dora-lead-time-metric

Run the container:

docker run -it --rm \
  --env-file .env \
  -v "$(pwd)/data:/data" \
  dora-lead-time-metric

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

dora_lead_time_metric-1.0.1.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

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

dora_lead_time_metric-1.0.1-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file dora_lead_time_metric-1.0.1.tar.gz.

File metadata

  • Download URL: dora_lead_time_metric-1.0.1.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dora_lead_time_metric-1.0.1.tar.gz
Algorithm Hash digest
SHA256 882060fd1b819593e5c62d01e6a8cc1e82e03f8839a2205d3a37e9ae4d62a2b2
MD5 155a6504007fd5b7e6d6f350922c99f2
BLAKE2b-256 5072cb6836d6850d83d263bc4f5eda6eb975e6e693be0ffaf3c613d224c21ed9

See more details on using hashes here.

Provenance

The following attestation bundles were made for dora_lead_time_metric-1.0.1.tar.gz:

Publisher: publish-pypi.yml on sualeh/dora-lead-time-metric

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

File details

Details for the file dora_lead_time_metric-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dora_lead_time_metric-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0995324a9989c7bfc892f28c17aa4b8a3cb8e849ce48277f8d37edff0170e350
MD5 1876b33114cdd191cde2b0c7f20a3b4d
BLAKE2b-256 47c52c5578257490ef198b08c97d1cbcbb06e0dc63e22e135bedbb909bfa1b42

See more details on using hashes here.

Provenance

The following attestation bundles were made for dora_lead_time_metric-1.0.1-py3-none-any.whl:

Publisher: publish-pypi.yml on sualeh/dora-lead-time-metric

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