issCrewBio
App to generate ISS crew members short bios
https://github.com/piotrr79/issCrewBio
from flask import Flask, jsonify, request
import sys
import os
# Tell syspath where to import modules from other folders in root direcotry
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from model.issCrewModel import issCrew
# Initialize Flask application
app= Flask(__name__)
app.config["DEBUG"] = True
def __init__(self):
self
@app.route('/', methods=['GET'])
def home():
""" Tets method to check api """
return jsonify('Hellow world!')
@app.route("/iss-crew-bio", methods=["GET"])
def issCrewBio():
""" Get iss crew members with their bio """
crewBio = issCrew()
issBio = crewBio.matchCrewWithAstros()
return jsonify('Current ISS crew: ', issBio)
app.run()
App to generate ISS crew members short bios based on open-notify Api and provided wikipedia pages Bios are generated by scraper parsing wikipedia urls. o install and run follow GitHub Readme file.
Once set up just run with
python3 command.py
to get results in command line or run python3 api/api.py
and go to http://localhost:5000/
Api generate crew memenrs bios under http://localhost:5000/iss-crew-bio