Skip to main content

Captures dependency snapshots of software systems for tracking changes across measurements. Originally designed for energy measurement contexts, also usable as a general-purpose dependency resolver.

Project description

Energy Dependency Inspector

PyPI

A tool for capturing dependency snapshots of running systems by querying their package managers directly. Unlike filesystem-scanning approaches, it inspects the actual installed state of packages as reported by the system's package management tools. Originally designed to reveal relevant changes when conducting energy measurements, it can also be used as a general-purpose dependency resolver. By tracking installed packages and their versions, you can identify whether changes in performance, energy consumption, or behavior are due to code modifications or dependency updates.

The tool provides both a command-line interface and a Python library for programmatic use. It supports dependency inspection of Docker containers and host systems, outputting structured JSON with package information, versions, and unique hash values.

Installation

From PyPI:

pip install energy-dependency-inspector

From source:

git clone https://github.com/green-coding-solutions/energy-dependency-inspector
cd energy-dependency-inspector
pip install .

Quick Start

# Analyze host system
python3 -m energy_dependency_inspector

# Analyze Docker container
python3 -m energy_dependency_inspector docker nginx

# Pretty print output
python3 -m energy_dependency_inspector --pretty-print

# Get help with all options
python3 -m energy_dependency_inspector -h

Supported Package Managers

  • apt/dpkg - System packages Ubuntu/Debian
  • apk - System packages of Alpine
  • pip - Python packages
  • npm - Node.js packages
  • composer - PHP packages
  • pecl - PHP extensions
  • maven - Java packages

Also captures Docker container metadata when analyzing containers.

Usage Options

Command Line Interface

For terminal usage with full control over options and environments.

Programmatic Interface

Use as a Python library in other projects:

import energy_dependency_inspector

# Analyze host system
deps = energy_dependency_inspector.resolve_host_dependencies()

# Analyze Docker container
docker_deps = energy_dependency_inspector.resolve_docker_dependencies("nginx")

Documentation

Contributing

For development setup, contribution guidelines, and information about running tests and code quality checks, please see CONTRIBUTING.md.

Requirements and Design

See the complete SPECIFICATION.md for detailed requirements and implementation constraints.

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

energy_dependency_inspector-0.4.1.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

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

energy_dependency_inspector-0.4.1-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file energy_dependency_inspector-0.4.1.tar.gz.

File metadata

File hashes

Hashes for energy_dependency_inspector-0.4.1.tar.gz
Algorithm Hash digest
SHA256 8fb7e602b77ff5e573ea01993908d8568b77d4dcc6b80e6710b8183ad4275b88
MD5 aa83c6a649fb27805d8fe1f6f4fa2aa8
BLAKE2b-256 f4db2b759139a59f9a76e808845a1a8798ab3397b7e46746e5ee0c9ea58aaebf

See more details on using hashes here.

File details

Details for the file energy_dependency_inspector-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for energy_dependency_inspector-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8cb251fe040a99ecda2fc5687fac3561dd2f488fa7abf8d05c73788b6e6eff93
MD5 47fc3fbc325b200a4f979e07309160d4
BLAKE2b-256 4a999a5cb310fab7cecdd0b218434065f14d9c2b67720528da235c693eea49c1

See more details on using hashes here.

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