infrawrench-bulk-instances
AWS instance attributes and prices (EC2, RDS, ElastiCache and more), with their full
history, from the bundles Infrawrench publishes at instances-bundles.infrawrench.com.
pip install infrawrench-bulk-instances
import os
from infrawrench_bulk_instances import download_aws_ec2_pricing_data
data = download_aws_ec2_pricing_data(token=os.environ.get("INFRAWRENCH_API_KEY"))
data.keys() # ["m5.large", "t2.micro", ...]
m5 = data.get("m5.large")
assert m5 is not None
m5.attributes["vcpu"] # "2"
m5.attributes_in("US East (N. Virginia)") # with that region's overrides
next(
p.hourly
for p in m5.pricing.on_demand
if p.region_code == "us-east-1" and p.operating_system == "Linux" and p.tenancy == "Shared"
and p.pre_installed_sw == "NA" and p.capacitystatus == "Used"
) # 0.096
m5.attributes_history # every attribute change, oldest first
m5.pricing_history.reserved # every reserved price change, oldest first
Any Infrawrench bearer credential works as token (an iwk_ API key, an agent
credential or a WorkOS access token). It defaults to INFRAWRENCH_API_KEY.
Failures raise AWSPricingDataError, whose status is the HTTP status, if there
was a response. Requires Python 3.10 or later; no dependencies.
Other AWS platforms
download_aws_pricing_data(platform, ...) loads any platform's bundle;
download_aws_ec2_pricing_data(...) is the same as download_aws_pricing_data("ec2", ...).
AWS_PLATFORMS lists them:
| Platform | AWS service |
|---|---|
ec2 |
EC2 |
rds |
RDS |
elasticache |
ElastiCache |
opensearch |
OpenSearch Service |
redshift |
Redshift |
docdb |
DocumentDB |
neptune |
Neptune |
memorydb |
MemoryDB |
dax |
DynamoDB Accelerator |
sagemaker |
SageMaker |
emr |
EMR |
gamelift |
GameLift |
The fields that pick a price differ by platform. data.variant_keys names them, and every
price has a variant mapping keyed by them:
from infrawrench_bulk_instances import download_aws_pricing_data
rds = download_aws_pricing_data("rds")
rds.variant_keys # ("databaseEngine", "databaseEdition", "licenseModel", "deploymentOption", ...)
db = rds.get("db.m5.large")
assert db is not None
next(
p.hourly
for p in db.pricing.on_demand
if p.region_code == "us-east-1" and p.variant["databaseEngine"] == "MySQL"
and p.variant["deploymentOption"] == "Multi-AZ"
)
operating_system, tenancy, license_model, pre_installed_sw and capacitystatus are EC2's
variant fields. On other platforms they are "", unless the platform has a field with that name
(RDS has licenseModel).
Caching
The bundle is downloaded xz-compressed (about 20 MB) and kept decompressed (about
210 MB) in ~/.infrawrench/aws_pricing_data (cache_path), so a cached load skips
decompression. Each load asks the server which bundle is latest and downloads it
only if it is not cached, deleting the older one. If the server cannot be
reached, the newest cached bundle is used instead. Each platform's bundle is cached
under its own name (rds-bundle-…json), so loading one never evicts another. Pass
cache_pricing_data=False to always download and never touch the disk. The cache is
shared with the other Infrawrench bulk-instances SDKs.
Loading decompresses and parses the whole bundle. Instances are decoded lazily:
get only wraps the raw rows, and attributes, attributes_history, pricing
and pricing_history each decode on first access and keep the result. The
returned objects are shared between calls, so they are read-only: prices and
changes are frozen dataclasses, sequences are tuples and mappings are read-only
views (attributes_in returns a new dict).
Prices and regions
regionis the AWS location name (US East (N. Virginia)),region_codeits code (us-east-1) where the price list gives one, elseNone.pricingholds only what is still offered. Inpricing_history, aNonehourlymeans the price stopped being offered atat.- Dates are timezone-aware UTC
datetimes. - Instances AWS no longer lists are still in
keys(), withdeleted_atset and emptypricing.
Metadata
Release files for infrawrench-bulk-instances 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| infrawrench_bulk_instances-1.1.0.tar.gz | 10.0 kB | With provenance | Details for infrawrench_bulk_instances-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| infrawrench_bulk_instances-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for infrawrench_bulk_instances-1.1.0-py3-none-any.whl |
Total release size: 21.9 kB
Release files / infrawrench_bulk_instances-1.1.0.tar.gz
| Download URL | infrawrench_bulk_instances-1.1.0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bda960fd96681d96a3991eb4c6017876ebd7e3b4908c5ec62ab17eca2896dd97
|
|
BLAKE2b-256 checksum How to use checksums |
c6f244309c925859a5e60bb226a5537fb660b86bb476a95223de71d7870b1dc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 30, 2026.
Transparency logRelease files / infrawrench_bulk_instances-1.1.0-py3-none-any.whl
| Download URL | infrawrench_bulk_instances-1.1.0-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52ee9fd60c737e424aa44183495117ebbc5bc4fd0804f20dcf84c6250a913b63
|
|
BLAKE2b-256 checksum How to use checksums |
3dc317cfa2402c2717aa6edb3a3a378987c5a238353dfa75594028ca2d73eda3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 30, 2026.
Transparency logSecurity for infrawrench-bulk-instances 1.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for infrawrench_bulk_instances-1.1.0.tar.gz
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 Oct 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.