Commit 738e56ef authored by Pyone Thant Win's avatar Pyone Thant Win
Browse files

api testing

parent c895bad3
CREATE DATABASE calorie_estimation;
\ No newline at end of file
CREATE TABLE credentials(
user_id serial PRIMARY KEY,
username VARCHAR(50) UNIQUE NOT NULL,
password VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL,
first_name CHAR(50) NOT NULL,
last_name CHAR(50) NOT NULL);
\ No newline at end of file
import pip._vendor.requests as requests
resp = requests.get("https://developer.nrel.gov/api/alt-fuel-stations/v1/nearest.json?api_key=7cHeCIVy4MqgJTz1VfCNneQlby0FUiYyvPXqVSSY&location=Denver+CO")
if resp.status_code != 200:
raise APIError('GET /tasks/ {}'.format(resp.status_code))
for to in resp.json():
print(to)
CREATE TABLE meal_log(
meal_id serial,
user_id integer NOT NULL,
food CHAR(50) NOT NULL,
calorie int NOT NULL,
time_eaten TIME,
date_eat DATE
);
\ No newline at end of file
CREATE TABLE overview(
user_id int NOT NULL,
date_eaten DATE,
daily_calories int
)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment