oci-rvtools 1.0.7__tar.gz

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.
@@ -0,0 +1,189 @@
1
+ Metadata-Version: 2.4
2
+ Name: oci-rvtools
3
+ Version: 1.0.7
4
+ Summary: Convert RVTools Excel exports into an Oracle Cloud (OCI) monthly cost estimate workbook.
5
+ License: MIT
6
+ Project-URL: Homepage, https://github.com/kimtholstorf/oci-rvtools-cost-estimator
7
+ Project-URL: Repository, https://github.com/kimtholstorf/oci-rvtools-cost-estimator
8
+ Keywords: oci,oracle,rvtools,vmware,cloud,cost,estimator
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Environment :: Console
13
+ Classifier: Topic :: Utilities
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ Requires-Dist: pandas
17
+ Requires-Dist: openpyxl
18
+
19
+ <div align="center">
20
+ <img src="logo_gh.png" width="345" height="93" alt="Logo"/>
21
+ <h4 align="center">Turn VMware RVTools exports into an Oracle Cloud monthly cost estimate</h4>
22
+ </div>
23
+
24
+ <br>
25
+
26
+ This utility ingests one or more RVTools `vInfo` sheets, pulls the latest Oracle Cloud Infrastructure prices, and generates an Excel workbook with aggregate monthly costs for all included resources.
27
+
28
+ Because OCI pricing scales linearly `oci-rvtools` doesn’t price individual VMs. Instead it calculates the cost of a hypothetical single VM whose vCPU, RAM, and disk match the combined totals of the ingested workloads. That aggregated cost is identical to summing the per-VM prices, but a lot just easier to calculate and present πŸ€“.
29
+
30
+ ---
31
+
32
+ ## πŸš€ Features
33
+
34
+ - **Direct RVTools ingestion** – reads raw `RVTools_export_all.xlsx` files, normalises column names, and ignores housekeeping VMs (`vCLS-*`).
35
+ - **Configurable inclusion filters** – toggle powered-off VMs for CPU/RAM and powered-off disks for storage calculations independently.
36
+ - **Automatic unit handling** – converts MiB totals to GiB, rounds quantities up to whole units, and maps 2 vCPUs to 1 OCPU.
37
+ - **Live pricing lookup** – fetcheslist prices for configurable OCI part numbers via the [OCI pricing API](https://apexapps.oracle.com/pls/apex/cetools/api/v1/products/).
38
+ - **Polished Excel output** – writes `oci_cost_summary.xlsx` with two sheets (Total Disk vs. In Use Disk), metadata header, formulas, advisory text, and Oracle-styled formatting.
39
+ - **Console logging** – prints aggregation totals, pricing inputs, and powered-on/off inclusion choices to the console.
40
+
41
+ ---
42
+
43
+ ## ⚑ Quick start
44
+
45
+ ```bash
46
+ # Install from PyPI
47
+ pip install oci-rvtools
48
+
49
+ # Run the estimator
50
+ oci-rvtools \
51
+ --rvtools ./customer/RVTools_export_all.xlsx \
52
+ --output oci_cost_summary.xlsx
53
+ ```
54
+
55
+ The tool contacts the OCI pricing API at runtime. Ensure the machine has outbound internet access.
56
+
57
+ ---
58
+
59
+ ## πŸ—οΈ Installation options
60
+
61
+ ### PyPI (recommended)
62
+
63
+ ```bash
64
+ pip install oci-rvtools
65
+ ```
66
+
67
+ This installs the `oci-rvtools` command globally (or into your active virtual environment).
68
+
69
+ ### pipx (isolated install)
70
+
71
+ ```bash
72
+ pipx install oci-rvtools
73
+ ```
74
+
75
+ [pipx](https://pipx.pypa.io) installs the tool in its own isolated environment and makes the command available system-wide without affecting other Python packages.
76
+
77
+ ### From source
78
+
79
+ ```bash
80
+ git clone https://github.com/KimTholstorf/oci-rvtools-cost-estimator.git
81
+ cd oci-rvtools-cost-estimator
82
+ python3 -m venv .venv
83
+ source .venv/bin/activate
84
+ pip install .
85
+ ```
86
+
87
+ ### One-off execution with uv
88
+
89
+ ```bash
90
+ uvx oci-rvtools \
91
+ --rvtools ./customer/RVTools_export_all.xlsx
92
+ ```
93
+
94
+ `uv` downloads the package into a cache and runs it without a permanent install.
95
+
96
+ ---
97
+
98
+ ## πŸ“₯ Input expectations
99
+
100
+ - RVTools workbook(s) in `.xlsx` format containing the `vInfo` sheet (default `RVTools_export_all.xlsx`).
101
+ - The script ignores temporary Excel lock files (`~$*.xlsx`) automatically.
102
+ - All calculations default to powered-on VMs, but powered-off VM CPU/RAM and disk capacity can be included via flags.
103
+
104
+ ---
105
+
106
+ ## πŸ“€ Output workbook
107
+
108
+ The generated Excel file (`oci_cost_summary.xlsx` by default) contains:
109
+
110
+ 1. **total_disk** – Monthly costs using the total provisioned disk capacity (TiB β†’ GiB).
111
+ 2. **used_disk** – Monthly costs using the reported β€œIn Use” disk capacity.
112
+
113
+ Each sheet includes:
114
+
115
+ - Banner row stamped with the run date.
116
+ - Metadata block (source files, hours per month, currency, VPU value, powered-on/off inclusion flags).
117
+ - Pricing table with formulas for Part Qty, Instance Qty, Usage Qty, Unit Price, and Monthly Cost.
118
+ - Advisory text and Oracle disclaimer merged across all columns.
119
+
120
+ All quantities are rounded up to whole units before pricing. Block Volume Performance Units (VPU) scale with disk capacity (`VPU per GB` Γ— GB).
121
+
122
+ ---
123
+
124
+ ## πŸ› οΈ CLI reference
125
+
126
+ | Argument | Description |
127
+ | --- | --- |
128
+ | `--version` | Print the script version and exit. |
129
+ | `--rvtools PATH [PATH ...]` | One or more RVTools `.xlsx` files or directories to scan. Required. |
130
+ | `--output FILE` | Destination workbook path. Defaults to `oci_cost_summary.xlsx`. |
131
+ | `--hours HOURS` | Hours per month to bill. Defaults to `730`. |
132
+ | `--currency CODE` | Pricing currency (passed to OCI pricing API). Defaults to `USD`. |
133
+ | `--ocpu-part PART` | OCI part number for OCPU per hour (default `B97384`). |
134
+ | `--memory-part PART` | OCI part number for memory GB per hour (default `B97385`). |
135
+ | `--storage-part PART` | OCI part number for block storage capacity per month (default `B91961`). |
136
+ | `--vpu-part PART` | OCI part number for block volume performance units (default `B91962`). |
137
+ | `--vpu VALUE` | VPUs per GB (clamped 1–120, default `10`). |
138
+ | `--include-poweredoff-vms` | Include powered-off VMs when summing vCPU and RAM. |
139
+ | `--include-poweredoff-disks` | Include powered-off VMs when summing disk usage (default). |
140
+ | `--exclude-poweredoff-disks` | Ignore powered-off VMs when summing disk usage. |
141
+
142
+ Paths can point to folders; the script recursively picks up `.xlsx` files (skipping `~$` temp files). Duplicate files are de-duplicated.
143
+
144
+ ---
145
+
146
+ ## πŸ“ˆ Examples
147
+
148
+ ```bash
149
+ # Baseline run (powered-on VMs only, powered-off disks included)
150
+ oci-rvtools \
151
+ --rvtools ./customer/RVTools_export_all.xlsx
152
+
153
+ # Aggregate multiple exports and change output name
154
+ oci-rvtools \
155
+ --rvtools ./customer/site-a.xlsx ./customer/site-b.xlsx \
156
+ --output reports/oci_cost_summary.xlsx
157
+
158
+ # Include powered-off VM CPU/RAM and exclude their disks
159
+ oci-rvtools \
160
+ --rvtools ./customer/RVTools_export_all.xlsx \
161
+ --include-poweredoff-vms \
162
+ --exclude-poweredoff-disks
163
+
164
+ # Override pricing part numbers and hours per month
165
+ oci-rvtools \
166
+ --rvtools ./customer/RVTools_export_all.xlsx \
167
+ --hours 744 \
168
+ --ocpu-part B12345 \
169
+ --memory-part B67890 \
170
+ --storage-part B54321 \
171
+ --vpu-part B09876
172
+
173
+ # Cap VPU to 120 automatically; explicit value of 0 becomes 1
174
+ oci-rvtools \
175
+ --rvtools ./customer/RVTools_export_all.xlsx \
176
+ --vpu 0 # silently treated as 1
177
+ ```
178
+
179
+ ---
180
+
181
+ ## ⚠️ Notes
182
+
183
+ - The script relies on real-time pricing data; expect run failures if the Oracle pricing API is unreachable.
184
+ - Pricing logic assumes USD list rates identical across regions. Adjust currency or part numbers as needed.
185
+ - Generated workbooks contain formulas and formatting; Excel recalculates automatically when opened.
186
+
187
+ ---
188
+
189
+ Happy estimating! Contributions and pull requests are welcome.
@@ -0,0 +1,171 @@
1
+ <div align="center">
2
+ <img src="logo_gh.png" width="345" height="93" alt="Logo"/>
3
+ <h4 align="center">Turn VMware RVTools exports into an Oracle Cloud monthly cost estimate</h4>
4
+ </div>
5
+
6
+ <br>
7
+
8
+ This utility ingests one or more RVTools `vInfo` sheets, pulls the latest Oracle Cloud Infrastructure prices, and generates an Excel workbook with aggregate monthly costs for all included resources.
9
+
10
+ Because OCI pricing scales linearly `oci-rvtools` doesn’t price individual VMs. Instead it calculates the cost of a hypothetical single VM whose vCPU, RAM, and disk match the combined totals of the ingested workloads. That aggregated cost is identical to summing the per-VM prices, but a lot just easier to calculate and present πŸ€“.
11
+
12
+ ---
13
+
14
+ ## πŸš€ Features
15
+
16
+ - **Direct RVTools ingestion** – reads raw `RVTools_export_all.xlsx` files, normalises column names, and ignores housekeeping VMs (`vCLS-*`).
17
+ - **Configurable inclusion filters** – toggle powered-off VMs for CPU/RAM and powered-off disks for storage calculations independently.
18
+ - **Automatic unit handling** – converts MiB totals to GiB, rounds quantities up to whole units, and maps 2 vCPUs to 1 OCPU.
19
+ - **Live pricing lookup** – fetcheslist prices for configurable OCI part numbers via the [OCI pricing API](https://apexapps.oracle.com/pls/apex/cetools/api/v1/products/).
20
+ - **Polished Excel output** – writes `oci_cost_summary.xlsx` with two sheets (Total Disk vs. In Use Disk), metadata header, formulas, advisory text, and Oracle-styled formatting.
21
+ - **Console logging** – prints aggregation totals, pricing inputs, and powered-on/off inclusion choices to the console.
22
+
23
+ ---
24
+
25
+ ## ⚑ Quick start
26
+
27
+ ```bash
28
+ # Install from PyPI
29
+ pip install oci-rvtools
30
+
31
+ # Run the estimator
32
+ oci-rvtools \
33
+ --rvtools ./customer/RVTools_export_all.xlsx \
34
+ --output oci_cost_summary.xlsx
35
+ ```
36
+
37
+ The tool contacts the OCI pricing API at runtime. Ensure the machine has outbound internet access.
38
+
39
+ ---
40
+
41
+ ## πŸ—οΈ Installation options
42
+
43
+ ### PyPI (recommended)
44
+
45
+ ```bash
46
+ pip install oci-rvtools
47
+ ```
48
+
49
+ This installs the `oci-rvtools` command globally (or into your active virtual environment).
50
+
51
+ ### pipx (isolated install)
52
+
53
+ ```bash
54
+ pipx install oci-rvtools
55
+ ```
56
+
57
+ [pipx](https://pipx.pypa.io) installs the tool in its own isolated environment and makes the command available system-wide without affecting other Python packages.
58
+
59
+ ### From source
60
+
61
+ ```bash
62
+ git clone https://github.com/KimTholstorf/oci-rvtools-cost-estimator.git
63
+ cd oci-rvtools-cost-estimator
64
+ python3 -m venv .venv
65
+ source .venv/bin/activate
66
+ pip install .
67
+ ```
68
+
69
+ ### One-off execution with uv
70
+
71
+ ```bash
72
+ uvx oci-rvtools \
73
+ --rvtools ./customer/RVTools_export_all.xlsx
74
+ ```
75
+
76
+ `uv` downloads the package into a cache and runs it without a permanent install.
77
+
78
+ ---
79
+
80
+ ## πŸ“₯ Input expectations
81
+
82
+ - RVTools workbook(s) in `.xlsx` format containing the `vInfo` sheet (default `RVTools_export_all.xlsx`).
83
+ - The script ignores temporary Excel lock files (`~$*.xlsx`) automatically.
84
+ - All calculations default to powered-on VMs, but powered-off VM CPU/RAM and disk capacity can be included via flags.
85
+
86
+ ---
87
+
88
+ ## πŸ“€ Output workbook
89
+
90
+ The generated Excel file (`oci_cost_summary.xlsx` by default) contains:
91
+
92
+ 1. **total_disk** – Monthly costs using the total provisioned disk capacity (TiB β†’ GiB).
93
+ 2. **used_disk** – Monthly costs using the reported β€œIn Use” disk capacity.
94
+
95
+ Each sheet includes:
96
+
97
+ - Banner row stamped with the run date.
98
+ - Metadata block (source files, hours per month, currency, VPU value, powered-on/off inclusion flags).
99
+ - Pricing table with formulas for Part Qty, Instance Qty, Usage Qty, Unit Price, and Monthly Cost.
100
+ - Advisory text and Oracle disclaimer merged across all columns.
101
+
102
+ All quantities are rounded up to whole units before pricing. Block Volume Performance Units (VPU) scale with disk capacity (`VPU per GB` Γ— GB).
103
+
104
+ ---
105
+
106
+ ## πŸ› οΈ CLI reference
107
+
108
+ | Argument | Description |
109
+ | --- | --- |
110
+ | `--version` | Print the script version and exit. |
111
+ | `--rvtools PATH [PATH ...]` | One or more RVTools `.xlsx` files or directories to scan. Required. |
112
+ | `--output FILE` | Destination workbook path. Defaults to `oci_cost_summary.xlsx`. |
113
+ | `--hours HOURS` | Hours per month to bill. Defaults to `730`. |
114
+ | `--currency CODE` | Pricing currency (passed to OCI pricing API). Defaults to `USD`. |
115
+ | `--ocpu-part PART` | OCI part number for OCPU per hour (default `B97384`). |
116
+ | `--memory-part PART` | OCI part number for memory GB per hour (default `B97385`). |
117
+ | `--storage-part PART` | OCI part number for block storage capacity per month (default `B91961`). |
118
+ | `--vpu-part PART` | OCI part number for block volume performance units (default `B91962`). |
119
+ | `--vpu VALUE` | VPUs per GB (clamped 1–120, default `10`). |
120
+ | `--include-poweredoff-vms` | Include powered-off VMs when summing vCPU and RAM. |
121
+ | `--include-poweredoff-disks` | Include powered-off VMs when summing disk usage (default). |
122
+ | `--exclude-poweredoff-disks` | Ignore powered-off VMs when summing disk usage. |
123
+
124
+ Paths can point to folders; the script recursively picks up `.xlsx` files (skipping `~$` temp files). Duplicate files are de-duplicated.
125
+
126
+ ---
127
+
128
+ ## πŸ“ˆ Examples
129
+
130
+ ```bash
131
+ # Baseline run (powered-on VMs only, powered-off disks included)
132
+ oci-rvtools \
133
+ --rvtools ./customer/RVTools_export_all.xlsx
134
+
135
+ # Aggregate multiple exports and change output name
136
+ oci-rvtools \
137
+ --rvtools ./customer/site-a.xlsx ./customer/site-b.xlsx \
138
+ --output reports/oci_cost_summary.xlsx
139
+
140
+ # Include powered-off VM CPU/RAM and exclude their disks
141
+ oci-rvtools \
142
+ --rvtools ./customer/RVTools_export_all.xlsx \
143
+ --include-poweredoff-vms \
144
+ --exclude-poweredoff-disks
145
+
146
+ # Override pricing part numbers and hours per month
147
+ oci-rvtools \
148
+ --rvtools ./customer/RVTools_export_all.xlsx \
149
+ --hours 744 \
150
+ --ocpu-part B12345 \
151
+ --memory-part B67890 \
152
+ --storage-part B54321 \
153
+ --vpu-part B09876
154
+
155
+ # Cap VPU to 120 automatically; explicit value of 0 becomes 1
156
+ oci-rvtools \
157
+ --rvtools ./customer/RVTools_export_all.xlsx \
158
+ --vpu 0 # silently treated as 1
159
+ ```
160
+
161
+ ---
162
+
163
+ ## ⚠️ Notes
164
+
165
+ - The script relies on real-time pricing data; expect run failures if the Oracle pricing API is unreachable.
166
+ - Pricing logic assumes USD list rates identical across regions. Adjust currency or part numbers as needed.
167
+ - Generated workbooks contain formulas and formatting; Excel recalculates automatically when opened.
168
+
169
+ ---
170
+
171
+ Happy estimating! Contributions and pull requests are welcome.
@@ -0,0 +1,3 @@
1
+ from .core import VERSION as __version__, main
2
+
3
+ __all__ = ["main", "__version__"]
@@ -0,0 +1,4 @@
1
+ import sys
2
+ from .core import main
3
+
4
+ sys.exit(main())