azurecost


Nameazurecost JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/toyama0919/azurecost
SummarySimple and easy command line to view azure costs.
upload_time2024-02-17 06:26:03
maintainer
docs_urlNone
authorHiroshi Toyama
requires_python
licenseMIT
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.

Support python3 only.

## 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": "https://github.com/toyama0919/azurecost",
    "name": "azurecost",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "azure cost tool costmanagement",
    "author": "Hiroshi Toyama",
    "author_email": "toyama0919@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/11/87/37d5c3a8b1b3702960b44a94084f0d6287083382af7343d692ebc33910e2/azurecost-0.2.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\nSupport python3 only.\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": "MIT",
    "summary": "Simple and easy command line to view azure costs.",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/toyama0919/azurecost"
    },
    "split_keywords": [
        "azure",
        "cost",
        "tool",
        "costmanagement"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "118737d5c3a8b1b3702960b44a94084f0d6287083382af7343d692ebc33910e2",
                "md5": "f751f25bda6082e444bcf99fdbcfaf90",
                "sha256": "98f0ffddb40eacbd434a314d78c4cd590bf2f753baeae89c480292ef27760668"
            },
            "downloads": -1,
            "filename": "azurecost-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f751f25bda6082e444bcf99fdbcfaf90",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6307,
            "upload_time": "2024-02-17T06:26:03",
            "upload_time_iso_8601": "2024-02-17T06:26:03.424442Z",
            "url": "https://files.pythonhosted.org/packages/11/87/37d5c3a8b1b3702960b44a94084f0d6287083382af7343d692ebc33910e2/azurecost-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-17 06:26:03",
    "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"
}
        
Elapsed time: 0.32456s