An API to access Boavizta's methodologies and footprint reference data
Project description
An API to access Boavizta's methodologies and data
See the documentation for API usage and methodology.
: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)
-
See our pedagogical front-end app (using the API): https://datavizta.boavizta.org/serversimpact
-
See the OpenAPI specification: https://api.boavizta.org/docs
-
Access the demo API: https://api.boavizta.org
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.
:computer: Development
Prerequisite
- Python >=3.12
- Poetry (see the install instructions)
make
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 testto run all unit tests (using test data)make test-e2eto 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.
: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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boaviztapi-2.0.2.tar.gz.
File metadata
- Download URL: boaviztapi-2.0.2.tar.gz
- Upload date:
- Size: 388.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.12.12 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7e2569bf89bfa287b774c3d5bd7ad3957f58f39c304c013ef53c7d8abf578b3
|
|
| MD5 |
c07e1a08d8d476442cbe2d8c5cfd2ad7
|
|
| BLAKE2b-256 |
97105ed055e90137c5e9125de64d6a56d6bd9d6f0ca9b95dec71ab2d3d149172
|
File details
Details for the file boaviztapi-2.0.2-py3-none-any.whl.
File metadata
- Download URL: boaviztapi-2.0.2-py3-none-any.whl
- Upload date:
- Size: 428.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.12.12 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc4aa1570e382a806f770ede823dc3023b142c2e6c007c2a4aefd9dd0293944d
|
|
| MD5 |
744f5fb8f6023e6607138896984a4210
|
|
| BLAKE2b-256 |
f1ad57d6a41f0ac98a00a15bd29da3520e08e652f0f36941d3f17eac940c870f
|