Skip to content

๐Ÿ›  Giving access to BOAVIZTA reference data and methodologies trough a RESTful API

License

Notifications You must be signed in to change notification settings

PierreRust/boaviztapi

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Boavizta API


An API to access Boavizta's methodologies and footprint reference data.

See the documentation for API usage and methodology.

Python tests

๐Ÿ’ฌ Join us on our public chat

๐ŸŽฏ Objective

As part of Boavizta's desire to improve the quality of the measurement of the environmental impacts of ICTs in organizations, this project aims at giving access to the group's work to as many people as possible in an automated and industrialized way.

The various data and methodologies integrated by Boavizta are aggregated and made available via an API.

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 is developed in layers according to a bottom-up principle. The first layer implemented is equipment, starting with the servers (MVP). The second layer is the measurement of the impact of digital services or systems. The measurement of the global impact is currently outside the scope.

โฉ Test it yourself (no installation)

Run a local instance

๐Ÿณ Run API using docker

$ docker run ghcr.io/boavizta/boaviztapi:latest

๐Ÿ“ฆ Install using pip package

$ pip3 install boaviztapi

๐Ÿ’ป Development

Prerequisite

Python 3, pipenv recommended

Setup pipenv

Install pipenv globally

$ sudo pip3 install pipenv

Install dependencies and create a python virtual environment.

$ pipenv install -d
$ pipenv shell

Launch a development server

Once in the pipenv 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

docker build --build-arg VERSION=0.2.0 -t boavizta/boaviztapi:0.2.0 .

Run docker image

docker run -p 5000:5000/tcp boavizta/boaviztapi:0.2.0

Deploy to AWS as serverless application

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.

๐Ÿ‘ฉ Contributing

See contributing.md

You can build a source distribution (installable with pip) with python setup.py sdist.

1๏ธโƒฃ 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

๐Ÿ“œ License

GNU Affero General Public License v3.0

About

๐Ÿ›  Giving access to BOAVIZTA reference data and methodologies trough a RESTful API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.3%
  • Other 0.7%