Skip to main content

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.

Python tests

: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)

Run a local instance

:whale: Run API using docker

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

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

$ make docker-build

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.

: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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boaviztapi-1.0.0a3.tar.gz (134.6 kB view details)

Uploaded Source

Built Distribution

boaviztapi-1.0.0a3-py3-none-any.whl (161.7 kB view details)

Uploaded Python 3

File details

Details for the file boaviztapi-1.0.0a3.tar.gz.

File metadata

  • Download URL: boaviztapi-1.0.0a3.tar.gz
  • Upload date:
  • Size: 134.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.8.16 Linux/5.15.0-1038-azure

File hashes

Hashes for boaviztapi-1.0.0a3.tar.gz
Algorithm Hash digest
SHA256 02162c93e860fc04eb7dab90b1cc13a7b842210d5a435fa7e6e4301486968400
MD5 efb23eb5231df7b29c9d4a81b5c5c175
BLAKE2b-256 8b244dbc05e4935bd490467cf08be75c11d666849180aa3eef0154a545a10c73

See more details on using hashes here.

File details

Details for the file boaviztapi-1.0.0a3-py3-none-any.whl.

File metadata

  • Download URL: boaviztapi-1.0.0a3-py3-none-any.whl
  • Upload date:
  • Size: 161.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.8.16 Linux/5.15.0-1038-azure

File hashes

Hashes for boaviztapi-1.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 3f2349c60186c040aded9bc4457af95ca5df00deff0d859b37e50419eea46089
MD5 dbdaa211a0d720866a25f6428a63373f
BLAKE2b-256 f5ecf0821d194e85f83dbf39cb98e0496bcfec6e36a2d5085f3c90d85401ecb5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page