An API to access Boavizta's methodologies and footprint reference data
Project description
Boavizta API
An API to access Boavizta's methodologies and impacts data reference data.
See the documentation for API usage and methodology.
:dart: Objective
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.
:fast_forward: Test it yourself (no installation)
-
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
Run a local instance
:whale: Run API using docker
$ docker run -p 5000:5000 ghcr.io/boavizta/boaviztapi:latest
Access API at http://localhost:5000
Install using pip package
$ pip3 install boaviztapi
Then you can run the server locally with :
$ uvicorn boaviztapi.main:app --host=localhost --port 5000
:computer: Development
Prerequisite
Python 3, poetry recommended
Setup poetry
Install poetry.
$ pip3 install poetry
Install dependencies and create a python virtual environment.
$ make install
$ poetry shell
Launch a development server
Once in the poetry environment
Development server uses uvicorn and fastapi, you can launch development server with the uvicorn
CLI.
$ uvicorn boaviztapi.main:app --host=localhost --port 5000
You can run the tests with pytest
.
Create your own docker image and run it
Build application package
make install
Build 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:latest
Deploy to AWS as serverless application
⚠ 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 deploy
Fisrt packaging/deployment may takes a several minutes
OpenAPI specification (Swagger)
Once API server is launched API swagger is available at httsp://localhost:5000/docs.
:woman: Contributing
See contributing.md
You can build a source distribution (installable with pip) with make build
.
:one: Versioning
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 |
:two: Publishing
You can run :
API_TOKEN=<your_token> make distribute
:scroll: License
GNU Affero General Public License v3.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file boaviztapi-1.0.1.tar.gz
.
File metadata
- Download URL: boaviztapi-1.0.1.tar.gz
- Upload date:
- Size: 128.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.8.18 Linux/6.2.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 457b18d22043574371ee6919081972e2495e67b0b089d051ab11911a01654e98 |
|
MD5 | 27e0c7ad5985bd96e1a965c133fe030a |
|
BLAKE2b-256 | 25b70d3c06e5fca1089581cfa0a42b6c207dd65e88bfc00e5edbd0dfc136749d |
File details
Details for the file boaviztapi-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: boaviztapi-1.0.1-py3-none-any.whl
- Upload date:
- Size: 156.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.8.18 Linux/6.2.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e527273991be502c38ea05e84f8baa2b28525a84fd62e80d7f3a0fe9402ea17 |
|
MD5 | 509b38e4f6779c1be0a3e8c815673247 |
|
BLAKE2b-256 | 2cae5a6130a47da419137aa5f5828e908ae714a73455e784cc0e104a562f6c90 |