Package: boaviztapi
An API to accessBoavizta'smethodologies and dataSee thedocumentationfor API usage and methodology.💬Join us on our public chat:dart: ObjectiveBoavizta 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/serversimpactSee the OpenAPI specification:https://api.boavizta.org/docsDocumentationAccess the demo API:https://api.boavizta.orgRun a local instance:whale: Run API using docker$dockerrun-p5000:5000ghcr.io/boavizta/boaviztapi:latestAccess API athttp://localhost:5000Install using pip package$pip3installboaviztapiThen you can run the server locally with :$uvicornboaviztapi.main:app--host=localhost--port5000:computer: DevelopmentPrerequisitePython 3, poetry recommendedSetup poetryInstall poetry.$pip3installpoetryInstall dependencies and create a python virtual environment.$makeinstall
$poetryshellLaunch a development serverOnce in the poetry environmentDevelopment server usesuvicornandfastapi, you can launch development server with theuvicornCLI.$uvicornboaviztapi.main:app--host=localhost--port5000You can run the tests withpytest.Create your own docker image and run itBuild application packagemakeinstallBuild docker image# using the makefile (recommended)makedocker-build# manual build (requires to set version)dockerbuild--build-argVERSION=`poetryversion-s`.Run docker imagedockerrun-p5000:5000/tcpboavizta/boaviztapi:latestAlternative (if you don't have Python or Poetry)makedocker-build-developmentDeploy to AWS as serverless application⚠ This is currently not working , seeDeployment as serverless application does not work · Issue #153 · Boavizta/boaviztapiApi can be self hosted to your own AWS account using the serverless framework.# Install the serverless framework and pluginsnpminstall-gserverless
npmi# AuthenticateexportAWS_PROFILE=your-own-profile# Deploy to devserverlessdeployFisrt packaging/deployment may takes a several minutesOpenAPI specification (Swagger)Once API server is launched API swagger is available athttsp://localhost:5000/docs.:woman: ContributingSeecontributing.mdYou can build a source distribution (installable with pip) withmake build.:one: VersioningWe useSemantic Versioning 2.0.0TypeDescriptionCommandMAJORversion when you make incompatible API changesmake majorMINORversion when you add functionality in a backwards compatible mannermake minorPATCHversion when you make backwards compatible bug fixesmake patch:two: PublishingYou can run :API_TOKEN=<your_token>makedistribute:scroll: LicenseGNU Affero General Public License v3.0