Skip to main content

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

Project description

BoaviztAPI

An API to access Boavizta's methodologies and data


See the documentation for API usage and methodology.

Python tests

💬 Join us on our public chat

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

Alternative (if you don't have Python or Poetry)

make docker-build-development

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


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.1.0.tar.gz (218.3 kB view details)

Uploaded Source

Built Distribution

boaviztapi-1.1.0-py3-none-any.whl (249.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: boaviztapi-1.1.0.tar.gz
  • Upload date:
  • Size: 218.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.8.18 Linux/6.2.0-1015-azure

File hashes

Hashes for boaviztapi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 42a137b49a72eeebe5c25d2f082adaa76f865b93c9e56ab588304bb94ffd898e
MD5 99530fad1089013c29fbc74e23708d4b
BLAKE2b-256 9426a2249f968c657253ba291f8f83c74aa9097c0691e670985b2ea537e05286

See more details on using hashes here.

File details

Details for the file boaviztapi-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: boaviztapi-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 249.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.8.18 Linux/6.2.0-1015-azure

File hashes

Hashes for boaviztapi-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce6dcebc95d2a04022c4289566a86ea25960807ad5cb8fe5674434867b559b82
MD5 803b7683ca093224d738f9bcf2fcdc02
BLAKE2b-256 147bdfb324901042caf58cc4d5da1e1fce38629f959d16d496f6bef4a1a115ba

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