ditchcarbon-python


Nameditchcarbon-python JSON
Version 0.1.2 PyPI version JSON
download
home_page
SummaryOfficial Python wrapper for the DitchCarbon API
upload_time2023-04-26 15:50:30
maintainer
docs_urlNone
author
requires_python>=3.7
licenseCopyright 2023 DitchCarbon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords ditchcarbon api wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <img src="https://ditchcarbon.com/wp-content/uploads/2021/05/Group-119.svg"><br>
</div>

-----------------

# ditchcarbon-python

![PyPI](https://img.shields.io/pypi/v/ditchcarbon-python?color=5CB381)
![PyPI - Downloads](https://img.shields.io/pypi/dm/ditchcarbon-python?color=5CB381)
![PyPI - License](https://img.shields.io/pypi/l/ditchcarbon-python?color=5CB381)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ditchcarbon-python?color=5CB381)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/ditchthis/ditchcarbon-python?color=5CB381)
[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

## What is it?

**ditchcarbon-python** is the official Python wrapper for the DitchCarbon API. DitchCarbon calculates the carbon impact of almost anything using a combination of GHG protocol approved calculations and an unparalleled database of company and product disclosures.

## Where to get it?

You can install the library via PyPI (hosted [here](https://pypi.org/project/ditchcarbon-python)):

```sh
pip3 install ditchcarbon-python
```

The source code is currently hosted on GitHub, [here](https://github.com/ditchthis/ditchcarbon-python).

## How to use it?

First, import and initialise the library with your API token:

```python
from ditchcarbon_python import Client
ditchcarbon = Client(token="YOUR_TOKEN")
```

Then, use it:

```python
# Activities
ditchcarbon.activities.retrieve(1)
ditchcarbon.activities.retrieve_many(**params)
ditchcarbon.activities.retrieve_assessment(1, **params)
ditchcarbon.activities.retrieve_categories(**params)

# Categories
ditchcarbon.categories.search(**params)

# Expenses
ditchcarbon.expenses.calculate_emissions(**params)

# Products
ditchcarbon.products.calculate_emissions(**params)

# Servers
ditchcarbon.servers.find(**params)
ditchcarbon.servers.retrieve(1)
ditchcarbon.servers.calculate_emissions(1, **params)

# Suppliers
ditchcarbon.suppliers.calculate_emissions(**params)
```

## Documentation and Help
View our API reference [here](https://docs.ditchcarbon.com/reference). For usage questions, feel free to contact us [here](mailto:enquiries@ditchcarbon.com).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ditchcarbon-python",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "ditchcarbon,API,wrapper",
    "author": "",
    "author_email": "DitchCarbon <enquiries@ditchcarbon.com>",
    "download_url": "https://files.pythonhosted.org/packages/6f/49/9068563b3a3bb802c01700caf35fba4439a828581193e04c5f2aaeae850e/ditchcarbon-python-0.1.2.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <img src=\"https://ditchcarbon.com/wp-content/uploads/2021/05/Group-119.svg\"><br>\n</div>\n\n-----------------\n\n# ditchcarbon-python\n\n![PyPI](https://img.shields.io/pypi/v/ditchcarbon-python?color=5CB381)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/ditchcarbon-python?color=5CB381)\n![PyPI - License](https://img.shields.io/pypi/l/ditchcarbon-python?color=5CB381)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ditchcarbon-python?color=5CB381)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/ditchthis/ditchcarbon-python?color=5CB381)\n[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n## What is it?\n\n**ditchcarbon-python** is the official Python wrapper for the DitchCarbon API. DitchCarbon calculates the carbon impact of almost anything using a combination of GHG protocol approved calculations and an unparalleled database of company and product disclosures.\n\n## Where to get it?\n\nYou can install the library via PyPI (hosted [here](https://pypi.org/project/ditchcarbon-python)):\n\n```sh\npip3 install ditchcarbon-python\n```\n\nThe source code is currently hosted on GitHub, [here](https://github.com/ditchthis/ditchcarbon-python).\n\n## How to use it?\n\nFirst, import and initialise the library with your API token:\n\n```python\nfrom ditchcarbon_python import Client\nditchcarbon = Client(token=\"YOUR_TOKEN\")\n```\n\nThen, use it:\n\n```python\n# Activities\nditchcarbon.activities.retrieve(1)\nditchcarbon.activities.retrieve_many(**params)\nditchcarbon.activities.retrieve_assessment(1, **params)\nditchcarbon.activities.retrieve_categories(**params)\n\n# Categories\nditchcarbon.categories.search(**params)\n\n# Expenses\nditchcarbon.expenses.calculate_emissions(**params)\n\n# Products\nditchcarbon.products.calculate_emissions(**params)\n\n# Servers\nditchcarbon.servers.find(**params)\nditchcarbon.servers.retrieve(1)\nditchcarbon.servers.calculate_emissions(1, **params)\n\n# Suppliers\nditchcarbon.suppliers.calculate_emissions(**params)\n```\n\n## Documentation and Help\nView our API reference [here](https://docs.ditchcarbon.com/reference). For usage questions, feel free to contact us [here](mailto:enquiries@ditchcarbon.com).\n",
    "bugtrack_url": null,
    "license": "Copyright 2023 DitchCarbon  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Official Python wrapper for the DitchCarbon API",
    "version": "0.1.2",
    "split_keywords": [
        "ditchcarbon",
        "api",
        "wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fcea2a36b31ba762e9d66fb7ee474cbe7f084e2e398a2e3b5448760ec7262725",
                "md5": "8b692e8c5a5841f422466ceb0074bf38",
                "sha256": "f6bba2e8c325dacedc51ffff00a14d66b88ca4217e3d41821abd7fd796da7516"
            },
            "downloads": -1,
            "filename": "ditchcarbon_python-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8b692e8c5a5841f422466ceb0074bf38",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7558,
            "upload_time": "2023-04-26T15:50:27",
            "upload_time_iso_8601": "2023-04-26T15:50:27.880963Z",
            "url": "https://files.pythonhosted.org/packages/fc/ea/2a36b31ba762e9d66fb7ee474cbe7f084e2e398a2e3b5448760ec7262725/ditchcarbon_python-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6f499068563b3a3bb802c01700caf35fba4439a828581193e04c5f2aaeae850e",
                "md5": "eab6edb89e80ecf8c997ff4f7f9f1933",
                "sha256": "171d3eaf9abdbc0c94fb178dd26ad27a90691202f78ea565f2964d65fb28f2ed"
            },
            "downloads": -1,
            "filename": "ditchcarbon-python-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "eab6edb89e80ecf8c997ff4f7f9f1933",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6469,
            "upload_time": "2023-04-26T15:50:30",
            "upload_time_iso_8601": "2023-04-26T15:50:30.152310Z",
            "url": "https://files.pythonhosted.org/packages/6f/49/9068563b3a3bb802c01700caf35fba4439a828581193e04c5f2aaeae850e/ditchcarbon-python-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-26 15:50:30",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "ditchcarbon-python"
}
        
Elapsed time: 0.06192s