Skip to main content

Multi-cloud billing data retrieval SDK for Alibaba Cloud, AWS, Azure, and Huawei Cloud with unified API

Project description

Cloud Billing

Python Version Tests

A comprehensive Python package for fetching billing information from Alibaba Cloud, AWS, Azure, and Huawei Cloud.

Supported Cloud Providers

  • Alibaba Cloud - Complete billing data retrieval with Kubernetes billing support
  • AWS - Cost and usage data from AWS Cost Explorer
  • Azure - Billing information from Azure Cost Management
  • Huawei Cloud - Monthly bill summary from Huawei BSS API

Key Features

  • 🌐 Multi-cloud support - Unified interface for multiple cloud providers
  • 📊 Comprehensive billing data - Detailed cost and usage information
  • 🔧 Easy integration - Simple Python API for all cloud providers
  • 📝 Type safety - Full type hints with Pydantic models
  • 🧪 Well tested - Comprehensive test suite

Quick Start

Install the package:

pip install cloud-billing

Get billing data from Alibaba Cloud:

from cloud_billing.alibaba_cloud import AlibabaCloudClient

client = AlibabaCloudClient(
    access_key_id="your_access_key",
    access_key_secret="your_secret_key",
    region_id="cn-hangzhou"
)

billing_data = client.fetch_instance_bill_by_billing_cycle(
    billing_cycle="2024-01"
)

Get cost data from AWS:

from cloud_billing.aws_cloud import AWSCloudClient

client = AWSCloudClient(
    access_key_id="your_access_key",
    secret_access_key="your_secret_key",
)

cost_data = client.get_cost_and_usage(
    time_period={"Start": "2024-01-01", "End": "2024-02-01"},
    granularity="MONTHLY",
    group_by=[{"Type": "DIMENSION", "Key": "SERVICE"}],
)

Get monthly bill from Huawei Cloud:

from cloud_billing.huawei_cloud import HuaweiCloudClient

client = HuaweiCloudClient(
    access_key="your_access_key",
    secret_key="your_secret_key",
    domain_id="your_domain_id",
)

bill_items, error = client.query_monthly_bill_summary(bill_cycle="2024-01")

License

This project is licensed under the GPL-3.0-or-later License - see the LICENSE file for details.

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

cloud_billing-0.1.25.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

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

cloud_billing-0.1.25-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file cloud_billing-0.1.25.tar.gz.

File metadata

  • Download URL: cloud_billing-0.1.25.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cloud_billing-0.1.25.tar.gz
Algorithm Hash digest
SHA256 95f9eac50633c6e3953186e914f89891627fd6ce61f68668b86b39b606777703
MD5 723691d714e8a120bd4bb673beabfced
BLAKE2b-256 fda8b1eba31ffe9236094ae81b00411a4c602a6359720000d5772cc4fa832053

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloud_billing-0.1.25.tar.gz:

Publisher: publish-pypi.yml on Visionary-Future/cloud-billing

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cloud_billing-0.1.25-py3-none-any.whl.

File metadata

  • Download URL: cloud_billing-0.1.25-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cloud_billing-0.1.25-py3-none-any.whl
Algorithm Hash digest
SHA256 2ffd95ac90cfa1338baedb4ddce52fb64be14f90d0e31f9602380460f4687442
MD5 3ede692ecc1d9c8ffed5b38eed0191f1
BLAKE2b-256 4f7357a50bb2d04b54b25f100fd643cae3afe6f53cfd259599725b87aa4388d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloud_billing-0.1.25-py3-none-any.whl:

Publisher: publish-pypi.yml on Visionary-Future/cloud-billing

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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