Skip to main content

Retrieves data from aws cost explore as a pandas dataframe.

Project description

cepan

test lint Code style: black Code style: black License: MIT

Retrieves data from aws cost explore as a pandas dataframe.

Main features

  • Support for input with type hints
  • Retrieving results as pandas.Dataframe

Installation

pip install cepan

Usage

from datetime import datetime

import cepan as ce

df = ce.get_cost_and_usage(
    time_period=ce.TimePeriod(
        start=datetime(2020, 1, 1),
        end=datetime(2020, 1, 2),
    ),
    granularity="DAILY",
    filter=ce.And(
        [
            ce.Dimensions(
                "SERVICE",
                ["Amazon Simple Storage Service", "AmazonCloudWatch"],    
            ),
            ce.Tags("Stack", ["Production"]),
        ]
    ),
    metrics=["BLENDED_COST"],
    group_by=ce.GroupBy(
        dimensions=["SERVICE", "USAGE_TYPE"],
    ),
)
print(df)

All paginated results will be returned as a Dataframe.

          Time                        SERVICE  BlendedCost
0   2020-01-01  Amazon Simple Storage Service   100.000000
1   2020-01-01               AmazonCloudWatch    10.000000

List of currently supported APIs

  • get_dimension_values
  • get_tags
  • get_cost_and_usage

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cepan-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cepan-0.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file cepan-0.1.0.tar.gz.

File metadata

  • Download URL: cepan-0.1.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Darwin/19.6.0

File hashes

Hashes for cepan-0.1.0.tar.gz
Algorithm Hash digest
SHA256 445b2e104c2cbfef2d03696de446d988e67ec750ace1a3b74e7621a50c67bd54
MD5 a5a2ca4de8609fbbc584ee7bb2e84df4
BLAKE2b-256 70f5995eb089e7216ef6674dec6d03e31ab49618e640c5e09de190327d895373

See more details on using hashes here.

File details

Details for the file cepan-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cepan-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Darwin/19.6.0

File hashes

Hashes for cepan-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a33c9d4ad54fe5360681fa9d45bb27b0db75a8656e3d597c4aefc6f3767a0550
MD5 e698b4aff89663c7241928c4279ef72e
BLAKE2b-256 1f12090e5b1ce49485a65f42e8bf18850450f31a9b17a47415c3820dd95607e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page