GithubHelp home page GithubHelp logo

spcat_webapi's Introduction

Web API gap analysis

GitHub release (latest by date)

This repository is a web API developed in Python which is responsible for collecting information from the gap database. It contains the endpoints that will be in charge of obtaining the data of countries, crops and accessions, the get crops endpoint is in charge of obtaining the information of crops, the get countries endpoint is in charge of obtaining the information of countries and the get accessions endpoint is in charge of obtaining all the information of accessions.

Important notes

This web api must be used in conjunction with the ORM that was developed for the project, which you can find in this repository.

Getting Started

To use the wep api, it is necessary to have an instance of MongoDB running, either locally or on a server that is accessible from the internet.

Prerequisites

  • Python 3.x
  • MongoDB

Installation

To use the wep api, it is necessary to have an instance of MongoDB running. It is also recommended to create a virtual environment to work with this project and make sure that the dependencies are installed in the virtual environment instead of the global system.

  1. Clone the repository
git clone https://github.com/CIAT-DAPA/spcat_webapi.git
  1. Create a virtual environment
python -m venv env
  1. Activate the virtual environment
  • Linux
source env/bin/activate
  • windows
env\Scripts\activate.bat
  1. Install the required packages
pip install -r requirements.txt
  1. Running api
python api.py

Usage

Configuration

The parameters to be configured are found in the config.py file. This file has information on how to connect to the database, when deploying the web api on a production server these data must be configured as environment variables. Let's see what it has:

Parameter type Description
DEBUG boolean boolean that defines whether you are in a test environment or in production.
HOST string IP or hostname of the server in which is the wep api. By default is: 0.0.0.0
PORT string Port in which is available the wep api in the server. By default is: 5000
CONNECTION_DB string utl for connection to the database

spcat_webapi's People

Contributors

victor-993 avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.