{"id":13820839,"url":"https://github.com/lyft/awspricing","last_synced_at":"2025-04-05T05:03:05.065Z","repository":{"id":47377869,"uuid":"81516256","full_name":"lyft/awspricing","owner":"lyft","description":"Python library for AWS pricing.","archived":false,"fork":false,"pushed_at":"2023-06-23T23:33:53.000Z","size":62,"stargazers_count":214,"open_issues_count":11,"forks_count":53,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-29T04:04:28.865Z","etag":null,"topics":["lyft"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lyft.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-10T02:12:04.000Z","updated_at":"2025-03-13T11:55:03.000Z","dependencies_parsed_at":"2024-05-29T12:13:46.465Z","dependency_job_id":"0b428d83-4188-4976-9697-5700e6501aa3","html_url":"https://github.com/lyft/awspricing","commit_stats":{"total_commits":34,"total_committers":9,"mean_commits":"3.7777777777777777","dds":0.4117647058823529,"last_synced_commit":"509f098d3e250908dc65f5f963ca4631a4a296c5"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyft%2Fawspricing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyft%2Fawspricing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyft%2Fawspricing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyft%2Fawspricing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lyft","download_url":"https://codeload.github.com/lyft/awspricing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289409,"owners_count":20914464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lyft"],"created_at":"2024-08-04T08:01:10.076Z","updated_at":"2025-04-05T05:03:05.035Z","avatar_url":"https://github.com/lyft.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"==========\nawspricing\n==========\n\nA Python library for working with the `AWS Price List Query API \u003chttps://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/pricing.html\u003e`_.\n\nAs of version 2.0.0, `awspricing` uses boto3 Price List Query API.\nThis requires Price List Query API IAM roles: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-permissions-ref.html#example-policy-pe-api\n\nVersions before 2.0.0 utilized AWS Price Offer files.\n\nFeatures:\n\n* Service-specific helpers (only EC2 and RDS thus far)\n* Local caching support\n\nInstallation\n------------\n\n.. code-block:: sh\n\n    $ pip install awspricing\n\nUsage\n-----\n\n.. code-block:: python\n\n    import awspricing\n\n    ec2_offer = awspricing.offer('AmazonEC2')\n\n    ec2_offer.search_skus(\n      instance_type='c4.large',\n      location='US East (N. Virginia)',\n      operating_system='Linux',\n    )  # {'4C7N4APU9GEUZ6H6', 'MBQPYDJSY3BY84BH', 'MDKVAJXMJGZFDJUE'}\n\n    ec2_offer.reserved_hourly(\n      'c4.xlarge',\n      operating_system='Linux',\n      lease_contract_length='3yr',\n      offering_class='convertible',\n      purchase_option='Partial Upfront',\n      region='us-east-1'\n    )  # 0.10845205479452055\n\n    rds_offer = awspricing.offer('AmazonRDS')\n\n    rds_offer.search_skus(\n      instance_type='db.m4.large',\n      location='US East (N. Virginia)',\n      database_engine='MySQL',\n      license_model='No license required',\n      deployment_option='Multi-AZ'\n    ) # {'QPZNR6MYN432XTPU'}\n\n    rds_offer.ondemand_hourly(\n      'db.m4.large',\n      'MySQL',\n      license_model='No license required',\n      deployment_option='Multi-AZ',\n      region='us-east-1'\n    ) # 0.35\n..\n\n**Note** : AWS provides the pricing list in json format with no warranty of format change.  If a format change by AWS causes a breaking change; the below mitigation can be used at the cost of \"stale\" pricing.\n\n.. code-block:: python\n\n    import awspricing\n\n    # For finding EC2 price list versions see script below or download https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/index.json\n    ec2_offer_old = awspricing.offer('AmazonEC2', version='some_other_version')\n\n    # For finding RDS price list versions see script below or download https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonRDS/index.json\n    rds_offer_old = awspricing.offer('AmazonRDS', version='some_other_version')\n\n\n.. code-block:: sh\n\n    $ # EC2\n    $ curl https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/index.json | python -m json.tool\n\n    $ # RDS\n    $ curl https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonRDS/index.json | python -m json.tool\n\n\nConfiguration\n-------------\n\nCache\n~~~~~\n\nCache can be configured via the following environment variables:\n\n``AWSPRICING_USE_CACHE``: Whether to use a simple file-based cache. Valid values are ``0|1``. Defaults to ``0`` (false).\n\n``AWSPRICING_CACHE_PATH``: Prefix to write cache files. Defaults to ``/tmp/awspricing``.\n\n``AWSPRICING_CACHE_MINUTES``: Number of minutes to keep cache for. Defaults to ``1440`` (1 day).\n\n\nDeveloping\n----------\n\nEnvironment setup\n~~~~~~~~~~~~~~~~~\n\nRun the following commands (preferably in a virtualenv) to setup your environment:\n\n.. code-block:: sh\n    python setup.py develop\n    pip install -r test-requirements.txt\n\nRunning unit tests\n~~~~~~~~~~~~~~~~~~\n\nSimply run `make test` after environment setup to run unit tests.\n\nRunning mypy (type checker)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe following commands can be used to run type checks. Note that a ``python3``\ninterpreter is required for mypy.\n\n.. code-block:: sh\n\n    pip install mypy\n    make test_mypy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyft%2Fawspricing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flyft%2Fawspricing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyft%2Fawspricing/lists"}