Create a RESTfull API using Python and Flask (Part 1)

RESTfull API ??



Let’s Go


python --version
pip --version
pip install flask

Why do we need an API?

Our Project

mkdir myfirst_api
cd myfirst_api
mkdir api
import flask

app = flask.Flask(__name__)
app.config["DEBUG"] = True

@app.route('/', methods=['GET'])
def home():
return '''<h1>Welcome to New Project</h1>
<p>A prototype API for distant reading of Music Albums and Playlists.</p>'''
cd myfirst_api/api

Software Engineer at Pearson Lanka || Former Associate Software Engineer at hSenid Software International

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store