Skip to main content

Giving access to BOAVIZTA referenced datas and methodologies trought a RESTful api

Project description

Boavizta API


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

See the documentation for API usage and methodology.

Python tests main

:dart: 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.

: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

:computer: 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.

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 python setup.py sdist.

: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

: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-0.2.0.tar.gz (96.7 kB view details)

Uploaded Source

File details

Details for the file boaviztapi-0.2.0.tar.gz.

File metadata

  • Download URL: boaviztapi-0.2.0.tar.gz
  • Upload date:
  • Size: 96.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.9.2 requests/2.28.1 setuptools/65.6.3 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.8.14

File hashes

Hashes for boaviztapi-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f1c31ccbdb090e915628a57633b8e096aa5f23979b4b161099d025440140065a
MD5 cba369626e3debf97d858c0b956435d8
BLAKE2b-256 8fced4f4d72ac57ad23fd014dce5ec2b4579079b870cca6dac2cabf80879ebcd

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