GCP Compute Machines Costs
This project is a python package for scraping and exporting GCP Compute Machines metadata and costs information.
Requirements
- python >= 3.12
- GCP service account with the next assigned permissions:
- compute.machineTypes.list
- compute.regions.list
- compute.zones.list
Installation
pip install gcp-compute-machines
Usage
Create new file scrape.py with the next content and change gcp_project_name and gcp_sa_account_path variables.
API Scraper
from gcp_compute_machines import GCPMachinesScraper
gcp_project_name = 'CHANGE_ME'
gcp_sa_account_path = 'CHANGE_ME'
scraper = GCPMachinesScraper(
gpc_project_name=gcp_project_name,
gcp_sa_account_path=gcp_sa_account_path
)
machines = scraper.fetch_gcp_machines(
# dump=True means that app saves the scrapped SKUs data locally
dump=True,
# Set load=True if you want to use local SKUs data between sequential runs.
load=False
)
scraper.dump_pricing_info(
file_path='./data/flat_gcp_machines_pricing.yaml'
)
Loader for https://gcloud-compute.com/
This code downloads data from the website above and loads it into pydantic model.
from gcp_compute_machines import GCloudComputeMachinesProvider
scraper = GCloudComputeMachinesProvider()
machines = scraper.fetch_gcp_machines()
scraper.dump_pricing_info("./data/flat_gcloud_compute_machines_pricing.yaml")
Keep in mind that:
- All pricing fields are normalized to hourly cost
- Some fields were renamed or dropped
License
This project is under the Apache License, Version 2.0 unless noted otherwise.
Important info
Please note this project is not an official Google product.
That means no warranty in costs data integrity. Use scraped data wisely.
Metadata
Release files for gcp-compute-machines 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gcp_compute_machines-0.1.2.tar.gz | 21.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gcp_compute_machines-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.9 kB
Release files / gcp_compute_machines-0.1.2.tar.gz
| Download URL | gcp_compute_machines-0.1.2.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
895ae5165980201257dfb6c4f6111243c37e865a4390496651be9bf40b4d443a
|
|
BLAKE2b-256 checksum How to use checksums |
14874e09b6ea34dec94e88371d924a73cc254cf133a742b57aac9cc78405589d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 3, 2026.
Transparency logRelease files / gcp_compute_machines-0.1.2-py3-none-any.whl
| Download URL | gcp_compute_machines-0.1.2-py3-none-any.whl |
|---|---|
| Size | 32.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b2125b33a5bfbda57427359fd336a4ea6184a1847dd2e1e080f7fa0e4704ff7
|
|
BLAKE2b-256 checksum How to use checksums |
faa84ae10c8fea9fe1e6681e57d2263c1f8b20581179810b3f1becd3102e6b98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 3, 2026.
Transparency log