Multi-cloud FinOps Python library for cost analysis
Project description
FinOps Multi-Cloud Python Library
Overview
This Python library is designed to empower FinOps engineers to manage and optimize cloud spending across AWS, Azure, and Google Cloud. It provides real-time cost analysis by querying each cloud's billing APIs, normalizes the data into a common format, and lays the groundwork for future automation features such as anomaly detection, AI/ML-powered forecasting, and policy enforcement.
Key FinOps Principles
- Cost Visibility & Timeliness: Immediate access to up-to-date cost data.
- Accountability: Empowering teams to monitor and own their cloud spending.
- Collaboration: Encouraging cross-functional teamwork between finance, engineering, and operations.
- Centralized Governance: Consolidating cost management and enforcing policies across clouds.
- Optimization & Automation: Continuously identifying and acting on cost-saving opportunities.
High-Level Goals
- Provide a unified multi-cloud view of costs via real-time API queries.
- Offer modular design to support future enhancements such as automation, anomaly detection, and forecasting.
- Enable FinOps engineers to work via a command-line interface (CLI) with a moderate learning curve.
FinOps CLI
A command-line tool for FinOps (Cloud Financial Operations) to analyze, optimize, and report on cloud costs.
Features
- Multi-cloud cost analysis (AWS, Azure, GCP)
- Cost reporting by service, region, and resource
- Cost anomaly detection
- Cost forecasting
- Budget tracking and alerts
- Cost optimization recommendations
- Resource tagging compliance
- Comprehensive cost efficiency scoring
- Resource utilization analysis
- Idle resource detection
- Sustainability reporting and carbon footprint analysis
- Web interface for dashboards and visualizations
Installation
# Clone repository
git clone https://github.com/yourusername/finops-cli.git
cd finops-cli
# Create and activate virtual environment
python -m venv venv
.\venv\Scripts\activate # Windows
source venv/bin/activate # Linux/Mac
# Install dependencies
pip install -r requirements.txt
Usage
# Show help
python -m finops_lib.cli --help
# Generate a cost report
python -m finops_lib.cli report --start-date 2023-01-01 --end-date 2023-01-31 --test
# Check for cost anomalies
python -m finops_lib.cli anomaly-check --start-date 2023-01-01 --end-date 2023-01-31 --test
# Generate a cost forecast
python -m finops_lib.cli forecast --start-date 2023-01-01 --end-date 2023-01-31 --days 30 --test
# Get optimization recommendations
python -m finops_lib.cli optimize --start-date 2023-01-01 --end-date 2023-01-31 --test
# Analyze resource utilization
python -m finops_lib.cli resource-utilization --start-date 2023-01-01 --end-date 2023-01-31 --test
# Detect idle resources
python -m finops_lib.cli idle-resources --start-date 2023-01-01 --end-date 2023-01-31 --test
# Generate comprehensive cost efficiency score
python -m finops_lib.cli cost-efficiency-score --start-date 2023-01-01 --end-date 2023-01-31 --test
# Generate sustainability report
python -m finops_lib.cli sustainability-report --start-date 2023-01-01 --end-date 2023-01-31 --test
# Start web interface
python -m finops_lib.cli web --port 5000
New Commands
The FinOps CLI has been enhanced with the following new commands:
Resource Utilization Analysis
python -m finops_lib.cli resource-utilization --start-date 2023-01-01 --end-date 2023-01-31 --test
Analyzes resource utilization across cloud providers, identifying underutilized resources and calculating potential savings from rightsizing.
Idle Resource Detection
python -m finops_lib.cli idle-resources --start-date 2023-01-01 --end-date 2023-01-31 --test
Detects idle resources across cloud providers by analyzing last activity dates, calculating potential cost savings from removing unused resources.
Cost Efficiency Score
python -m finops_lib.cli cost-efficiency-score --start-date 2023-01-01 --end-date 2023-01-31 --test
Generates a comprehensive FinOps score based on multiple metrics aligned with industry standards, including resource utilization, waste percentage, discount coverage, cost allocation, and forecast accuracy.
Sustainability Report
python -m finops_lib.cli sustainability-report --start-date 2023-01-01 --end-date 2023-01-31 --test
Generates a sustainability report with carbon estimates, sustainability scores, and eco-friendly recommendations based on cloud usage patterns.
Documentation
For detailed documentation, see the docs directory:
Development
# Run tests
python -m unittest discover
# Run specific test
python -m unittest tests.test_commands.test_new_commands
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file finops_lib-1.2.0.tar.gz.
File metadata
- Download URL: finops_lib-1.2.0.tar.gz
- Upload date:
- Size: 34.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75e6da062d140a36d21855a523dbee8554a1e571b49c6d8f55d57394381e0d7c
|
|
| MD5 |
b01e07fa0ca7ef88d419a8d3a33b34cb
|
|
| BLAKE2b-256 |
913786f258268cb7877f6d35ae4931bed4c3a184c86da830a3ef0347d1f6af9e
|
File details
Details for the file finops_lib-1.2.0-py3-none-any.whl.
File metadata
- Download URL: finops_lib-1.2.0-py3-none-any.whl
- Upload date:
- Size: 39.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65c30246ef361d26e3b3c8d1ad73cdc97dd15bbf55d8376bec0eadf67f28aff0
|
|
| MD5 |
97a7f8ee0323c59c97966ef9afb3bc42
|
|
| BLAKE2b-256 |
52e8681ebea39934d3c8fb3157522bc46bd7d2a965fcc25c0a1d3c57189e9a75
|