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 the API at http://localhost:5000.

Install using pip package

$ pip3 install boaviztapi

Run the server locally with:

$ uvicorn boaviztapi.main:app --host=localhost --port 5000

:computer: Development

Prerequisite

Setup poetry

Install dependencies and check the environment is set up correctly:

$ make install
$ make test
$ make lint

Launch a development server

The development server uses uvicorn and FastAPI. You can launch the development server with the uvicorn CLI.

# Using uvicorn
$ make run

# Using Python directly (adds watcher)
$ make run-py

Tests

You can run the tests with pytest via:

  • make test to run all unit tests (using test data)
  • make test-e2e to run end-to-end tests (using "real" data)

Create your own docker image and run it

Build Docker image:

# Using the makefile (recommended)
make docker-build-development
make docker-run-development

# Manual build
docker build . -t boavizta-test
docker run -p 5000:5000 boavizta-test

Deploy to AWS as serverless application

You can self-host BoaviztAPI as an AWS Lambda function using Serverless Framework.

You must first configure:

Once done, you can deploy the API with:

serverless deploy

When the deploy succeeds, it will show you the URLs for the deployed function, and you can call the API as normal, e.g.

# Replace the base URL with your own
curl -s "https://k9wllbzcc2.execute-api.eu-west-1.amazonaws.com/v1/server/?archetype=dellR740"

You can check your Lambda URL at any time with:

serverless info

OpenAPI specification (Swagger)

Once API server is launched API swagger is available at httsp://localhost:5000/docs.

:handshake: Adopters

BoaviztAPI is used by several open-source projects and tools. See ADOPTERS.md for the full list.

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

See the Release Process wiki.

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

boaviztapi-2.1.0-py3-none-any.whl (443.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: boaviztapi-2.1.0.tar.gz
  • Upload date:
  • Size: 401.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.12.13 Linux/6.17.0-1008-azure

File hashes

Hashes for boaviztapi-2.1.0.tar.gz
Algorithm Hash digest
SHA256 9ad5f4a93903555d30b1053ab28376e4f160b597e0f78e6d00a72ee9004d767a
MD5 f4b6d6737b12abbd39bc7ee292093810
BLAKE2b-256 ea01d1c2a2f7a4850f5f0751ebdd913132c1936d511cb3d99988ac386d97e811

See more details on using hashes here.

File details

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

File metadata

  • Download URL: boaviztapi-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 443.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.12.13 Linux/6.17.0-1008-azure

File hashes

Hashes for boaviztapi-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c1607e5ae307896d05216fd4c49ebe76b420698787ba37ced1c5362319126f1
MD5 57c5b7a31e3ef0bfbcc5a15acc62ab91
BLAKE2b-256 10f5a2f0f0a7bf8f94f0887b1d220ae161cfd1ea24bec913520142c92e735ff4

See more details on using hashes here.

Supported by

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