Anaconda installation and the necessary tools In this example we are gong to install Anaconda, please click here. Anaconda is a free and open-source distribution of the in our example Python programming languages for scientific computing (data science, machine learning applications, large-scale data processing, etc.), that aims to simplify package management and deployment. The Anaconda distribution includes data-science packages suitable for Windows, Linux, and MacOS. Select whether […]
Python
Sqlite Database reading and writing
Writing to Sqlite In this part we are going to learn how to connect Flask to Sqlite Database and we can insert the form data. In this example we going to use the Sqlite Dict Python library. You can use whatever database you want, but in this case we are using Sqlite because use a […]
Further Processing
Print POST Data In any web app, you’ll have to process incoming request data from users. Flask, like any other web framework, allows you to access the request data easily. Next step is going to be to make use of the value: from flask import Flask from flask import render_template app = Flask(__name__) @app.route(“/”), methods=[‘GET’, […]
Data POST and adding Logic
Adding custom data calculation Now let’s do more data calculation. We open “process_data.py” and edit the file with this script: def calculate_coin(price_usd): return (float(price_usd) > 40 def process(): data = get_data(“/v1/ticker/?limit=10”) all_coins = [] for coin in data: coin [“isover40”] = calculate_coin(coin[“price_usd”]) all_coins.append(coin) return all_coins Creating Bootstrap form and submit button In this part we […]
More API and output
Other API Endpoints Let’s continue here with more API and a little bit more of functionality. So we have a URL for another endpoint to get more data. You can edit into your “process_data.py” file: import json def get_data(query_string): import http.client conn = http.client.HTTPSConnection(“api.coinmarketcap.com”) conn.request(“GET”,”{}”.format(query_string”)) res = conn.getresponse() data = res.read() return json.loads(data.decode(“utf-8”)) def process(): […]