An API to access Boavizta's methodologies and data
See the documentation for API usage and methodology.
π¬ Join us on our public chat
Boavizta aims to enhance the assessment of environmental impacts induced by ICTs in organizations by providing widespread access to our work in an automated and efficient manner.
Boavizta integrates various data and methodologies, which are combined and made accessible through this API.
Transparency and the popularization of scientific knowledge are of utmost importance in this project, and key aspects include open-sourcing the code, versioning the impact factors, and thoroughly documenting the project.
In the interest of transparency and scientific popularization, the opening of the code, the versioning of the impact factors and the documentation of the project are critical points.
The system follows a bottom-up approach in its development, organized into layers. The initial layer focuses on equipment. The second layer focues on the impacts of digital services (e.g. cloud instances) or systems. However, assessing the overall global impact of ICT is currently beyond the project's scope.
-
See our pedagogical front-end app (using the API): https://datavizta.boavizta.org/serversimpact
-
See the OpenAPI specification: https://api.boavizta.org/docs
-
Access the demo API: https://api.boavizta.org
$ docker run -p 5000:5000 ghcr.io/boavizta/boaviztapi:latestAccess the API at http://localhost:5000.
$ pip3 install boaviztapiRun the server locally with:
$ uvicorn boaviztapi.main:app --host=localhost --port 5000Python 3 mandatory, Python >=3.10 and Poetry strongly recommended.
Install poetry (see the install instructions for more details):
$ pip3 install poetryInstall dependencies and create a Python virtual environment:
$ make install
$ poetry shellOnce in the poetry environment
The development server uses uvicorn and FastAPI. You can launch the development server with the uvicorn CLI.
$ uvicorn boaviztapi.main:app --host=localhost --port 5000You can run the tests with pytest via make test.
Build application package:
make installBuild Docker image:
# using the makefile (recommended)
make docker-build
# manual build (requires to set version)
docker build --build-arg VERSION=`poetry version -s` .Run Docker image:
docker run -p 5000:5000/tcp boavizta/boaviztapi:`poetry version -s`make docker-build-development
make docker-run-developmentβ This is currently not working , see Deployment as serverless application does not work Β· Issue #153 Β· Boavizta/boaviztapi
Api can be self hosted to your own AWS account using the serverless framework.
# Install the serverless framework and plugins
npm install -g serverless
npm i
# Authenticate
export AWS_PROFILE=your-own-profile
# Deploy to dev
serverless deployFisrt packaging/deployment may takes a several minutes
Once API server is launched API swagger is available at httsp://localhost:5000/docs.
See contributing.md.
You can build a source distribution (installable with pip) with make build.
We use Semantic Versioning 2.0.0
| Type | Description | Command |
|---|---|---|
| MAJOR | version when you make incompatible API changes | make major |
| MINOR | version when you add functionality in a backwards compatible manner | make minor |
| PATCH | version when you make backwards compatible bug fixes | make patch |
You can run:
API_TOKEN=<your_token> make distributeGNU Affero General Public License v3.0