Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Boavizta/boaviztapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

You can run the tests with pytest via make test.

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:`poetry version -s`

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

make docker-build-development

make docker-run-development

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.

πŸ‘© 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

About

πŸ›  Giving access to BOAVIZTA reference data and methodologies trough a RESTful API

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors 26