Skip to main content

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

🎯 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.

⏩ Test it yourself (no installation)

Run a local instance

🐳 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

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

Work on docs

API documentation is build with mkdocs and maintained under the docs directory.

See how to work on documentation

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.

🤝 Adopters

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

👩 Contributing

See contributing.md.

You can build a source distribution (installable with pip) with make build.

1️⃣ 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

2️⃣ Releasing

See the Release Process wiki.

📜 License

GNU Affero General Public License v3.0

Metadata

Release files for boaviztapi 2.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for boaviztapi 2.4.1
File Size Uploaded
boaviztapi-2.4.1.tar.gz 406.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for boaviztapi 2.4.1
File Interpreter ABI Platform
boaviztapi-2.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 856.6 kB

Release files / boaviztapi-2.4.1.tar.gz

Download URL boaviztapi-2.4.1.tar.gz
Size 406.7 kB
Tags Source
SHA-256 checksum
How to use checksums
18830f28051eb0af3e890e8f5d6fd9e035c0683d3f500fa46dc40b898245a4f0
BLAKE2b-256 checksum
How to use checksums
c8690324f7f58934be742d0411a2623f7a62100c751001ecc479d72b4369c5b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.14 Linux/6.17.0-1022-azure

Release files / boaviztapi-2.4.1-py3-none-any.whl

Download URL boaviztapi-2.4.1-py3-none-any.whl
Size 449.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da73a254a9ee27d43a2bd602c362af4f6a1d6b9c1305d136b1a2c788869938cb
BLAKE2b-256 checksum
How to use checksums
03bab4f27acba95533d24cfe1c548c8a5c263a7b1e3c5a352c5914a6723ec2f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.12.14 Linux/6.17.0-1022-azure

Release history Release notifications | RSS feed

This release

2.4.1 This release

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.3.15

2 release files

1.3.14

2 release files

1.3.12

2 release files

1.3.11

2 release files

1.3.10

2 release files

1.3.9

2 release files

1.3.8

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.2

1 release file

0.2.0

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.3

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page