A Python library (especially for building CLI tools) for analyzing billing and logs:
- AWS cost usage reports = cur
- AWS CloudTrail entries = trail
- ICA bills
There are basic tests that run against a set of local test data.
uv run pytest
See examples/sample-cli for an example of how to use the library
by creating your own CLI tool(s) specific to a single use case.
If you just need to play with some data to see how the library works - you can edit
tests/adhoc.py. It can be run with uv run tests/adhoc.py. It initialises
various sources pointing to our local test data. Add your own
polars queries and have fun.
Make a local script that pre-configures your data locations.
uv run src/curtrail.py --cur-data-location "s3://abucket/cur" \
--cloudtrail-data-location "s3://anotherbucket/AWSLogsParquet" \
--geolite2-city-data-location "s3://anotherbucket/GeoLite2-City.mmdb" \
$*Or create a curtrail.toml file that specifies your data locations.
[[log]]
data_prefix = "s3://anotherbucket/AWSLogsParquet"
organisation = "o-bbbexample"
[[bill_aws]]
data_prefix = "s3://org-b-cur-bucket"
[[bill_ica]]
data_prefix = "s3://org-b-ica-bucket"