semvec/pypi-packages huggingface dataset:
eco4cast 0.0.8
This package is designed to reduce CO2 emissions while training neural networks using Google Cloud.
Requires Python: >=3.9,<4.0
Keywords: co2 emission,google cloud,pytorch

# eco4cast

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AIRI-Institute/eco4cast/blob/main/examples/eco4cast_demo/quick_start_guide.ipynb)

+ [About eco4cast :clipboard:](#1)
+ [Installation :wrench:](#2)
+ [Usage examples :computer:](#3)
+ [Citing](#4)
<!-- + [Feedback :envelope:](#6)  -->



## About eco4cast :clipboard: <a name="1"></a> 
This package is designed to reduce CO2 emissions while training neural network models. The main idea of the package is to run the learning process at certain time intervals on certain Google Cloud servers with minimal emissions. A neural network (TCN) trained on the historical data of 13 zones is used to predict emissions for 24 hours ahead.

Currently supported Google Cloud zones: 'southamerica-east1-b', 'northamerica-northeast2-b', 'europe-west6-b', 'europe-west3-b', 'europe-central2-b', 'europe-west1-b', 'europe-west8-a', 'northamerica-northeast1-b', 'europe-southwest1-c', 'europe-west2-b', 'europe-north1-b', 'europe-west9-b',  'europe-west4-b' .

## Installation <a name="2"></a> 
Package can be installed using Pypi:
```
pip install eco4cast
```

## Usage examples <a name="3"></a> 
There are several usage examples you can use to start working with eco4cast package. They are listed in [examples folder](https://github.com/AIRI-Institute/eco4cast/tree/main/examples). 

### Example of using eco4cast with Google Cloud
You can use eco4cast to reduce your carbon footprint with the help of Google Cloud virtual machines and moving between zones to reach minimal emission coefficient. In this Colab notebook you can find step-by-step tutorial on setting up your first training process using eco4cast and Google Cloud [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AIRI-Institute/eco4cast/blob/main/examples/eco4cast_demo/quick_start_guide.ipynb)

### Example of using eco4cast locally
You can use eco4cast to reduce your carbon footprint by training during times with minimal emission in your region. In this Colab notebook you can find step-by-step guide on starting training locally [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AIRI-Institute/eco4cast/blob/main/examples/eco4cast_local_demo/local_quick_start_guide.ipynb). 

Available electricitymaps zones to work locally: 
"BR-CS" (Central Brazil), "CA-ON" (Canada Ontario) , "CH" (Switzerland), "DE" (Germany),
"PL" (Poland), "BE" (Belgium), "IT-NO" (North Italy), "CA-QC" (Canada Quebec), "ES" (Spain), 
"GB" (Great Britain), "FI" (Finland), "FR" (France) "NL" (Netherlands)

## Citing <a name="4"></a>
Paper info


<!-- ## Feedback <a name="6"></a>
email? -->
bottle-suite 0.0.17
bottle.py suite with CORS, SQL, REST, and JWT
Requires Python: >=3.8

# Bottle Suite
Bottle.py suite with CORS, SQL, REST, and JWT

## Installation

```bash
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ bottle-suite --upgrade
```

## Usage
### CLI

#### Create Project
```bash
$ bottle-suite-create
Enter project name. <bottle-suite-project>:
Create a SQLite database? [y/N]:
Attach an SQL database? [y/N]:
Created project bottle-suite-project
    cd bottle-suite-project
    bottle-suite -d -r
```

#### Run
```bash
$ cd bottle-suite-project
$ bottle-suite -d -r
View dashboard @ http://localhost:8000/dashboard
Bottle v0.13-dev server starting up (using WSGIRefServer(dashboard=True))...
Listening on http://localhost:8000/
Hit Ctrl-C to quit.
```

#### Options
```
usage: bottle-suite [-h] [--port PORT] [--host HOST] [--jwt JWT_KEY] [--sqlite [PATH]] [--dbhost DBHOST] [--dbname DBNAME] [--dbuser DBUSER] [--dbpass DBPASS] [--cors CORS] [-r] [-d]

optional arguments:
  -h, --help       show this help message and exit
  --port PORT      Port to listen on
  --host HOST      Host to listen on
  --jwt JWT_KEY    JWT key
  --sqlite [PATH]  Path to SQLite database (default: bottle-suite/src/scripts/tmp.db)
  --dbhost DBHOST  SQL database host
  --dbname DBNAME  SQL database name
  --dbuser DBUSER  SQL database username
  --dbpass DBPASS  SQL database password
  --cors CORS      Enable CORS
  -r               Automatic reloading
  -d               Enable dashboard
```

### Import
app.py
```python
from bottle_suite import BottleSuite

app = BottleSuite()
app.run(reloader=True)
```

## Resources
### Resource Folder
Bottle Suite will attempt to automatically find Resources objects in a resource folder in the working directory and create endpoints for them. By default it will look for a folder named "resources". All ".py" files in the folder will be scanned for Resource objects.

#### Example Project Structure
```
├── src
│   ├── resources
│   │   ├── __init__.py
│   │   ├── resource_a.py
|   |   ├── resource_b.py
│   ├── app.py
```

### Resource Objects
See [Bottle REST Tutorial](https://github.com/thepure12/bottle-rest/blob/main/docs/tutorial.rst)

#### resource_a.py
```python
from bottle_suite import Resource

class ResourceA(Resource):

    def options(self):
        pass

    def get(self):
        return {}
    
    def post(self):
        pass
    
    def put(self):
        pass

    def patch(self):
        pass

    def delete(self):
        pass
```

### Adding Endpoints for Resources
Bottle Suite has a Bottle REST object. Resources can be added by accessing the Bottle REST object and calling ***addResource()***.

#### app.py
```python
from resources.resource_a import ResourceA
from bottle_suite import BottleSuite

app = BottleSuite()
app.rest.addResource(ResourceA, "/resource_a")
app.run(reloader=True)
```