aws-cost-calculator-cli 1.2.0__py3-none-any.whl → 1.8.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of aws-cost-calculator-cli might be problematic. Click here for more details.
- aws_cost_calculator_cli-1.8.2.dist-info/METADATA +437 -0
- aws_cost_calculator_cli-1.8.2.dist-info/RECORD +15 -0
- cost_calculator/api_client.py +85 -0
- cost_calculator/cli.py +714 -105
- cost_calculator/cur.py +244 -0
- cost_calculator/drill.py +323 -0
- cost_calculator/executor.py +291 -0
- cost_calculator/forensics.py +321 -0
- aws_cost_calculator_cli-1.2.0.dist-info/METADATA +0 -246
- aws_cost_calculator_cli-1.2.0.dist-info/RECORD +0 -10
- {aws_cost_calculator_cli-1.2.0.dist-info → aws_cost_calculator_cli-1.8.2.dist-info}/WHEEL +0 -0
- {aws_cost_calculator_cli-1.2.0.dist-info → aws_cost_calculator_cli-1.8.2.dist-info}/entry_points.txt +0 -0
- {aws_cost_calculator_cli-1.2.0.dist-info → aws_cost_calculator_cli-1.8.2.dist-info}/licenses/LICENSE +0 -0
- {aws_cost_calculator_cli-1.2.0.dist-info → aws_cost_calculator_cli-1.8.2.dist-info}/top_level.txt +0 -0
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: aws-cost-calculator-cli
|
|
3
|
-
Version: 1.2.0
|
|
4
|
-
Summary: AWS Cost Calculator CLI - Calculate daily and annual AWS costs across multiple accounts
|
|
5
|
-
Home-page: https://github.com/yourusername/cost-calculator
|
|
6
|
-
Author: Cost Optimization Team
|
|
7
|
-
Author-email:
|
|
8
|
-
Project-URL: Documentation, https://github.com/yourusername/cost-calculator/blob/main/README.md
|
|
9
|
-
Keywords: aws cost calculator billing optimization cloud
|
|
10
|
-
Classifier: Development Status :: 4 - Beta
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: Intended Audience :: System Administrators
|
|
13
|
-
Classifier: Topic :: System :: Monitoring
|
|
14
|
-
Classifier: Topic :: Utilities
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
-
Requires-Python: >=3.8
|
|
22
|
-
Description-Content-Type: text/markdown
|
|
23
|
-
License-File: LICENSE
|
|
24
|
-
Requires-Dist: click>=8.0.0
|
|
25
|
-
Requires-Dist: boto3>=1.26.0
|
|
26
|
-
Dynamic: author
|
|
27
|
-
Dynamic: classifier
|
|
28
|
-
Dynamic: description
|
|
29
|
-
Dynamic: description-content-type
|
|
30
|
-
Dynamic: home-page
|
|
31
|
-
Dynamic: keywords
|
|
32
|
-
Dynamic: license-file
|
|
33
|
-
Dynamic: project-url
|
|
34
|
-
Dynamic: requires-dist
|
|
35
|
-
Dynamic: requires-python
|
|
36
|
-
Dynamic: summary
|
|
37
|
-
|
|
38
|
-
# AWS Cost Calculator (cc)
|
|
39
|
-
|
|
40
|
-
A CLI tool to quickly calculate AWS costs across multiple accounts.
|
|
41
|
-
|
|
42
|
-
## Installation
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
cd ~/cost-calculator
|
|
46
|
-
pip install -e .
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Quick Start
|
|
50
|
-
|
|
51
|
-
### 1. Login to AWS SSO
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
aws sso login --profile my_aws_profile
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**Note:** You need to do this before running cost calculations. The SSO session typically lasts 8-12 hours.
|
|
58
|
-
|
|
59
|
-
### 2. Initialize a profile
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
cc init --profile myprofile \
|
|
63
|
-
--aws-profile my_aws_profile \
|
|
64
|
-
--accounts "123456789012,234567890123,345678901234"
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### 3. Calculate costs
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
# Default: Today minus 2 days, going back 30 days
|
|
71
|
-
cc calculate --profile myprofile
|
|
72
|
-
|
|
73
|
-
# Specific start date
|
|
74
|
-
cc calculate --profile myprofile --start-date 2025-11-04
|
|
75
|
-
|
|
76
|
-
# Custom offset and window
|
|
77
|
-
cc calculate --profile myprofile --offset 2 --window 30
|
|
78
|
-
|
|
79
|
-
# JSON output
|
|
80
|
-
cc calculate --profile myprofile --json-output
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### 4. Analyze cost trends
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
# Analyze last 3 weeks (default)
|
|
87
|
-
cc trends --profile myprofile
|
|
88
|
-
|
|
89
|
-
# Analyze more weeks
|
|
90
|
-
cc trends --profile myprofile --weeks 5
|
|
91
|
-
|
|
92
|
-
# Custom output file
|
|
93
|
-
cc trends --profile myprofile --output weekly_trends.md
|
|
94
|
-
|
|
95
|
-
# JSON output
|
|
96
|
-
cc trends --profile myprofile --json-output
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### 5. List profiles
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
cc list-profiles
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## How It Works
|
|
106
|
-
|
|
107
|
-
### Date Calculation
|
|
108
|
-
- **Start Date**: Defaults to today, or specify with `--start-date`
|
|
109
|
-
- **Offset**: Days to go back from start date (default: 2)
|
|
110
|
-
- **Window**: Number of days to analyze (default: 30)
|
|
111
|
-
|
|
112
|
-
Example: If today is Nov 4, 2025:
|
|
113
|
-
- With offset=2, window=30: Analyzes Oct 3 - Nov 2 (30 days)
|
|
114
|
-
|
|
115
|
-
### Cost Calculation
|
|
116
|
-
1. **Operational Costs**: Sum of daily costs ÷ window days
|
|
117
|
-
2. **Support Allocation**:
|
|
118
|
-
- Gets support cost from the analysis month
|
|
119
|
-
- Divides by 2 (50% allocation)
|
|
120
|
-
- Divides by days in that month
|
|
121
|
-
3. **Daily Rate**: Operational + Support per day
|
|
122
|
-
4. **Annual Projection**: Daily rate × 365
|
|
123
|
-
|
|
124
|
-
### Filters Applied
|
|
125
|
-
- **Billing Entity**: AWS only (excludes marketplace)
|
|
126
|
-
- **Excluded**: Tax, Support (calculated separately)
|
|
127
|
-
- **Metric**: Net Amortized Cost
|
|
128
|
-
|
|
129
|
-
## Configuration
|
|
130
|
-
|
|
131
|
-
Profiles are stored in: `~/.config/cost-calculator/profiles.json`
|
|
132
|
-
|
|
133
|
-
Example:
|
|
134
|
-
```json
|
|
135
|
-
{
|
|
136
|
-
"myprofile": {
|
|
137
|
-
"aws_profile": "my_aws_profile",
|
|
138
|
-
"accounts": ["123456789012", "234567890123", "345678901234"]
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## Examples
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
# Quick daily check
|
|
147
|
-
cc calculate --profile myprofile
|
|
148
|
-
|
|
149
|
-
# Historical analysis
|
|
150
|
-
cc calculate --profile myprofile --start-date 2025-10-01
|
|
151
|
-
|
|
152
|
-
# Export to JSON for processing
|
|
153
|
-
cc calculate --profile myprofile --json-output > costs.json
|
|
154
|
-
|
|
155
|
-
# Different window size
|
|
156
|
-
cc calculate --profile myprofile --window 60
|
|
157
|
-
|
|
158
|
-
# Weekly cost trends analysis
|
|
159
|
-
cc trends --profile myprofile
|
|
160
|
-
|
|
161
|
-
# Analyze last 8 weeks
|
|
162
|
-
cc trends --profile myprofile --weeks 8
|
|
163
|
-
|
|
164
|
-
# Monthly cost trends analysis
|
|
165
|
-
cc monthly --profile myprofile
|
|
166
|
-
|
|
167
|
-
# Analyze last 12 months
|
|
168
|
-
cc monthly --profile myprofile --months 12
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
## Trends Report
|
|
172
|
-
|
|
173
|
-
The `trends` command generates a markdown report with **two types of analysis**:
|
|
174
|
-
|
|
175
|
-
### 1. Week-over-Week (WoW)
|
|
176
|
-
Compares each week to the previous week - good for catching immediate spikes and changes.
|
|
177
|
-
|
|
178
|
-
### 2. Trailing 30-Day (T-30)
|
|
179
|
-
Compares each week to the same week 4 weeks ago - filters out noise and shows sustained trends.
|
|
180
|
-
|
|
181
|
-
**Features:**
|
|
182
|
-
- **Service-level aggregation**: Shows total cost per service (not individual usage types)
|
|
183
|
-
- **Top 10 Increases/Decreases**: For each comparison period
|
|
184
|
-
- **Total rows**: Sum of top 10 changes for quick assessment
|
|
185
|
-
- **Filters**: Only shows changes >$10 and >5%
|
|
186
|
-
|
|
187
|
-
Example output:
|
|
188
|
-
```
|
|
189
|
-
Week of Oct 19 → Week of Oct 26 (WoW)
|
|
190
|
-
Increases: 4, Decreases: 10
|
|
191
|
-
Top: EC2 - Other (+$949.12)
|
|
192
|
-
|
|
193
|
-
Week of Oct 26 vs Week of Sep 28 (T-30)
|
|
194
|
-
Increases: 10, Decreases: 10
|
|
195
|
-
Top: EC2 - Other (+$886.39)
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
The report is saved to `cost_trends.md` by default and includes:
|
|
199
|
-
- Service name
|
|
200
|
-
- Previous/baseline cost
|
|
201
|
-
- Current cost
|
|
202
|
-
- Change amount and percentage
|
|
203
|
-
- Total of top 10 changes
|
|
204
|
-
|
|
205
|
-
## Monthly Report
|
|
206
|
-
|
|
207
|
-
The `monthly` command generates month-over-month cost comparisons:
|
|
208
|
-
|
|
209
|
-
**Features:**
|
|
210
|
-
- **Service-level aggregation**: Shows total cost per service
|
|
211
|
-
- **Calendar month comparisons**: October vs September, September vs August, etc.
|
|
212
|
-
- **Top 10 Increases/Decreases**: For each month comparison
|
|
213
|
-
- **Total rows**: Sum of top 10 changes
|
|
214
|
-
- **Filters**: Only shows changes >$50 and >5%
|
|
215
|
-
|
|
216
|
-
Example output:
|
|
217
|
-
```
|
|
218
|
-
October 2025 → November 2025
|
|
219
|
-
Increases: 1, Decreases: 10
|
|
220
|
-
Top: Savings Plans for AWS Compute usage (+$231,161.46)
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
The report is saved to `monthly_trends.md` by default.
|
|
224
|
-
|
|
225
|
-
## Output
|
|
226
|
-
|
|
227
|
-
```
|
|
228
|
-
Analyzing: 2025-10-03 to 2025-11-02 (30 days)
|
|
229
|
-
AWS Profile: my_aws_profile
|
|
230
|
-
Accounts: 3
|
|
231
|
-
|
|
232
|
-
Fetching cost data...
|
|
233
|
-
Fetching support costs...
|
|
234
|
-
============================================================
|
|
235
|
-
Period: 2025-10-03 to 2025-11-02
|
|
236
|
-
Days analyzed: 30
|
|
237
|
-
============================================================
|
|
238
|
-
Total operational cost: $450,000.00
|
|
239
|
-
Daily operational: $14,516.13
|
|
240
|
-
Support (month): $15,000.00
|
|
241
|
-
Support per day (÷2÷days): $241.94
|
|
242
|
-
============================================================
|
|
243
|
-
DAILY RATE: $14,758.07
|
|
244
|
-
ANNUAL PROJECTION: $5,386,695
|
|
245
|
-
============================================================
|
|
246
|
-
```
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
aws_cost_calculator_cli-1.2.0.dist-info/licenses/LICENSE,sha256=cYtmQZHNGGTXOtg3T7LHDRneleaH0dHXHfxFV3WR50Y,1079
|
|
2
|
-
cost_calculator/__init__.py,sha256=PJeIqvWh5AYJVrJxPPkI4pJnAt37rIjasrNS0I87kaM,52
|
|
3
|
-
cost_calculator/cli.py,sha256=fQPSDb-vp6qEpCgNGiyEt2FXdFJE6wtjRg5r67hLYDU,26639
|
|
4
|
-
cost_calculator/monthly.py,sha256=6k9F8S7djhX1wGV3-T1MZP7CvWbbfhSTEaddwCfVu5M,7932
|
|
5
|
-
cost_calculator/trends.py,sha256=k_s4ylBX50sqoiM_fwepi58HW01zz767FMJhQUPDznk,12246
|
|
6
|
-
aws_cost_calculator_cli-1.2.0.dist-info/METADATA,sha256=dEgROlV7F3TkZkQEFAE_Ppw_0htCkHQ2vhk6Zh31BUA,6406
|
|
7
|
-
aws_cost_calculator_cli-1.2.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
8
|
-
aws_cost_calculator_cli-1.2.0.dist-info/entry_points.txt,sha256=_5Qy4EcHbYVYrdgOu1E48faMHb9fLUl5VJ3djDHuJBo,47
|
|
9
|
-
aws_cost_calculator_cli-1.2.0.dist-info/top_level.txt,sha256=PRwGPPlNqASfyhGHDjSfyl4SXeE7GF3OVTu1tY1Uqyc,16
|
|
10
|
-
aws_cost_calculator_cli-1.2.0.dist-info/RECORD,,
|
|
File without changes
|
{aws_cost_calculator_cli-1.2.0.dist-info → aws_cost_calculator_cli-1.8.2.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{aws_cost_calculator_cli-1.2.0.dist-info → aws_cost_calculator_cli-1.8.2.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{aws_cost_calculator_cli-1.2.0.dist-info → aws_cost_calculator_cli-1.8.2.dist-info}/top_level.txt
RENAMED
|
File without changes
|