Skip to content

green-coding-solutions/energy-dependency-inspector

Repository files navigation

Energy Dependency Inspector

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

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
  • 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.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •