Name | azurecost JSON |
Version |
0.4.0
JSON |
| download |
home_page | None |
Summary | Simple and easy command line to view azure costs. |
upload_time | 2024-12-30 12:50:47 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
azure
cost
tool
costmanagement
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# azurecost
[![PyPI version](https://badge.fury.io/py/azurecost.svg)](https://badge.fury.io/py/azurecost)
[![Build Status](https://github.com/toyama0919/azurecost/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/toyama0919/azurecost/actions/workflows/ci.yml)
Simple and easy command line to view azure costs.
Supports python 3.8 and above.
## Settings
```sh
az login
```
## Examples
#### show cost monthly
```bash
$ azurecost -s my-subscription
key 2023-08 2023-09
------------------ --------- ---------
total 492.77 80.28
Cognitive Services 492.77 80.28
Bandwidth 0 0
Storage 0 0
```
* You can omit the -s by specifying the environment variable AZURE_SUBSCRIPTION_ID.
```bash
$ export AZURE_SUBSCRIPTION_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$ export AZURE_RESOURCE_GROUP=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$ azurecost
key 2023-08 2023-09
------------------ --------- ---------
total 492.77 80.28
Cognitive Services 492.77 80.28
Bandwidth 0 0
Storage 0 0
```
#### show cost (Multiple Dimensions)
```
$ azurecost -s my-subscription -d ResourceGroup -d ServiceName
key 2023-08 2023-09
------------------------------------ --------- ---------
total 492.77 426.97
RG-1, Cognitive Services 281 366
RG-2, Cognitive Services 211.77 60.97
RG-3, Storage 0 0
RG-4, Storage 0 0
RG-5, Storage 0 0
RG-6, Storage 0 0
RG-7, Bandwidth 0 0
RG-7, Storage 0 0
```
## Python API
```py
subscription = "my-subscription"
core = Azurecost(
False,
"MONTHLY",
["ServiceName"],
subscription_name=subscription,
# resource_group="my-rg"
)
total_results, results = core.get_usage(
ago=2,
)
text = core.convert_tabulate(total_results, results)
print(text)
```
## Installation
```sh
pip install azurecost
```
## CI
### install test package
```
$ ./scripts/ci.sh install
```
### test
```
$ ./scripts/ci.sh run-test
```
flake8 and black and pytest.
### release pypi
```
$ ./scripts/ci.sh release
```
git tag and pypi release.
Raw data
{
"_id": null,
"home_page": null,
"name": "azurecost",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "azure, cost, tool, costmanagement",
"author": null,
"author_email": "Hiroshi Toyama <toyama0919@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/f3/50/1a1fea95ce7b5768e462c88b1acdc72914867cfb6e93f7d3a01b3f502de5/azurecost-0.4.0.tar.gz",
"platform": null,
"description": "# azurecost\n\n[![PyPI version](https://badge.fury.io/py/azurecost.svg)](https://badge.fury.io/py/azurecost)\n[![Build Status](https://github.com/toyama0919/azurecost/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/toyama0919/azurecost/actions/workflows/ci.yml)\n\nSimple and easy command line to view azure costs.\n\nSupports python 3.8 and above.\n\n## Settings\n\n```sh\naz login\n```\n\n## Examples\n\n#### show cost monthly\n\n```bash\n$ azurecost -s my-subscription\nkey 2023-08 2023-09\n------------------ --------- ---------\ntotal 492.77 80.28\nCognitive Services 492.77 80.28\nBandwidth 0 0\nStorage 0 0\n```\n\n* You can omit the -s by specifying the environment variable AZURE_SUBSCRIPTION_ID.\n\n```bash\n$ export AZURE_SUBSCRIPTION_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n$ export AZURE_RESOURCE_GROUP=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n$ azurecost\nkey 2023-08 2023-09\n------------------ --------- ---------\ntotal 492.77 80.28\nCognitive Services 492.77 80.28\nBandwidth 0 0\nStorage 0 0\n```\n\n#### show cost (Multiple Dimensions)\n\n```\n$ azurecost -s my-subscription -d ResourceGroup -d ServiceName\nkey 2023-08 2023-09\n------------------------------------ --------- ---------\ntotal 492.77 426.97\nRG-1, Cognitive Services 281 366\nRG-2, Cognitive Services 211.77 60.97\nRG-3, Storage 0 0\nRG-4, Storage 0 0\nRG-5, Storage 0 0\nRG-6, Storage 0 0\nRG-7, Bandwidth 0 0\nRG-7, Storage 0 0\n```\n\n## Python API\n\n```py\nsubscription = \"my-subscription\"\ncore = Azurecost(\n False,\n \"MONTHLY\",\n [\"ServiceName\"],\n subscription_name=subscription,\n # resource_group=\"my-rg\"\n)\ntotal_results, results = core.get_usage(\n ago=2,\n)\ntext = core.convert_tabulate(total_results, results)\nprint(text)\n```\n\n## Installation\n\n```sh\npip install azurecost\n```\n\n## CI\n\n### install test package\n\n```\n$ ./scripts/ci.sh install\n```\n\n### test\n\n```\n$ ./scripts/ci.sh run-test\n```\n\nflake8 and black and pytest.\n\n### release pypi\n\n```\n$ ./scripts/ci.sh release\n```\n\ngit tag and pypi release.\n",
"bugtrack_url": null,
"license": null,
"summary": "Simple and easy command line to view azure costs.",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/toyama0919/azurecost"
},
"split_keywords": [
"azure",
" cost",
" tool",
" costmanagement"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f3501a1fea95ce7b5768e462c88b1acdc72914867cfb6e93f7d3a01b3f502de5",
"md5": "36cda755f922fee2bed1fdade4b4b373",
"sha256": "144530afdebf420352ee76ccea9766a9e69fef58d491b9efa8628854d4cd26ff"
},
"downloads": -1,
"filename": "azurecost-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "36cda755f922fee2bed1fdade4b4b373",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 6210,
"upload_time": "2024-12-30T12:50:47",
"upload_time_iso_8601": "2024-12-30T12:50:47.700378Z",
"url": "https://files.pythonhosted.org/packages/f3/50/1a1fea95ce7b5768e462c88b1acdc72914867cfb6e93f7d3a01b3f502de5/azurecost-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-30 12:50:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "toyama0919",
"github_project": "azurecost",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "azurecost"
}