API Reference¶
deploy.py¶
-
deploy.create_or_update_environment(ssh)[source]¶ Create environment if non-existent, otherwise update the environment using the .yml file
-
deploy.run_app(ssh)[source]¶ - kill existing gunicorn processes
- make daemon bash script executable
- run app as daemon process
- print app’s port number
classes.py¶
-
class
app.classes.LoginForm(formdata=<object object>, **kwargs)[source]¶ Log in fields
-
password_entry= <UnboundField(PasswordField, ('Password',), {'validators': [<wtforms.validators.InputRequired object>]})>¶
-
submit= <UnboundField(SubmitField, ('Submit',), {})>¶
-
username_entry= <UnboundField(StringField, ('Username', [<wtforms.validators.InputRequired object>]), {})>¶
-
-
class
app.classes.SurveyForm(formdata=<object object>, **kwargs)[source]¶ User survey information
-
age_entry= <UnboundField(SelectField, ('Age',), {'choices': [('under18', 'Under 18'), ('18_24', '18 - 24'), ('25_34', '25 - 34'), ('35_44', '35 - 44'), ('45_54', '45 - 54'), ('55_64', '55 - 64'), ('65_74', '65 - 74'), ('75_84', '75 - 84'), ('older_85', '85 or older')], 'validators': [<wtforms.validators.InputRequired object>]})>¶
-
email_entry= <UnboundField(EmailField, ('Email', [<wtforms.validators.InputRequired object>, <wtforms.validators.Email object>]), {})>¶
-
first_name_entry= <UnboundField(StringField, ('First Name', [<wtforms.validators.InputRequired object>]), {})>¶
-
food_entry= <UnboundField(SelectField, ('Rate your interest in "Food and Drinks" experiences: ',), {'choices': [('5', 'Very Interested'), ('4', 'Interested'), ('3', 'Neither'), ('2', 'Not really interested'), ('1', 'Not interested at all')], 'validators': [<wtforms.validators.InputRequired object>]})>¶
-
landmarks_entry= <UnboundField(SelectField, ('Rate your interest in visiting landmarks: ',), {'choices': [('5', 'Very Interested'), ('4', 'Interested'), ('3', 'Neither'), ('2', 'Not really interested'), ('1', 'Not interested at all')], 'validators': [<wtforms.validators.InputRequired object>]})>¶
-
last_name_entry= <UnboundField(StringField, ('Last Name', [<wtforms.validators.InputRequired object>]), {})>¶
-
museums_entry= <UnboundField(SelectField, ('Rate your interest in visiting museums: ',), {'choices': [('5', 'Very Interested'), ('4', 'Interested'), ('3', 'Neither'), ('2', 'Not really interested'), ('1', 'Not interested at all')], 'validators': [<wtforms.validators.InputRequired object>]})>¶
-
music_entry= <UnboundField(SelectField, ('Rate your interest in listening to concerts: ',), {'choices': [('5', 'Very Interested'), ('4', 'Interested'), ('3', 'Neither'), ('2', 'Not really interested'), ('1', 'Not interested at all')], 'validators': [<wtforms.validators.InputRequired object>]})>¶
-
nature_entry= <UnboundField(SelectField, ('Rate your interest in "Nature" experiences: ',), {'choices': [('5', 'Very Interested'), ('4', 'Interested'), ('3', 'Neither'), ('2', 'Not really interested'), ('1', 'Not interested at all')], 'validators': [<wtforms.validators.InputRequired object>]})>¶
-
nightlife_entry= <UnboundField(SelectField, ('Rate your interest in "Night Life" experiences: ',), {'choices': [('5', 'Very Interested'), ('4', 'Interested'), ('3', 'Neither'), ('2', 'Not really interested'), ('1', 'Not interested at all')], 'validators': [<wtforms.validators.InputRequired object>]})>¶
-
password_entry= <UnboundField(PasswordField, ('Password', [<wtforms.validators.InputRequired object>]), {})>¶
-
performing_entry= <UnboundField(SelectField, ('Rate your interest in Performing & Visual Arts: ',), {'choices': [('5', 'Very Interested'), ('4', 'Interested'), ('3', 'Neither'), ('2', 'Not really interested'), ('1', 'Not interested at all')], 'validators': [<wtforms.validators.InputRequired object>]})>¶
-
submit= <UnboundField(SubmitField, ('Submit',), {})>¶
-
username_entry= <UnboundField(StringField, ('Username', [<wtforms.validators.InputRequired object>]), {})>¶
-
-
class
app.classes.Trip(name, where, start_date, end_date, creator)[source]¶ Trip object
-
creator¶
-
end_date¶
-
id¶
-
name¶
-
start_date¶
-
where¶
-
-
class
app.classes.TripForm(formdata=<object object>, **kwargs)[source]¶ Trip survey information
-
end_date_entry= <UnboundField(DateField, ('End Date',), {'format': '%m-%d-%Y'})>¶
-
name_entry= <UnboundField(StringField, ('Trip Name',), {'validators': [<wtforms.validators.InputRequired object>]})>¶
-
party= <UnboundField(StringField, ('party',), {})>¶
-
start_date_entry= <UnboundField(DateField, ('Start Date',), {'validators': [<wtforms.validators.InputRequired object>], 'format': '%m-%d-%Y'})>¶
-
submit= <UnboundField(SubmitField, ('Submit',), {})>¶
-
where_entry= <UnboundField(StringField, ('Where',), {'validators': [<wtforms.validators.InputRequired object>]})>¶
-
routes.py¶
-
app.routes.get_schedule(t_name, suggested=False)[source]¶ query the schedule table to get either suggested schedule (suggested=True) or current schedule (suggested=False)
-
app.routes.insert_recs(engine, e)[source]¶ given a database connection and recommendation, insert into the schedule table
-
app.routes.query_events(start_date, end_date, con)[source]¶ query the events table based on the start_date and end_date
-
app.routes.rule_rec(event_df, user_ratings, N)[source]¶ Create event recommendations based on average of scores event_df: Pandas dataframe of queried events user_ratings: list of user ratings N: number of recommendations we would output output: list of dictionaries containing recommendation info
route unauthorize users to the login page
google_search.py¶
-
api.google_search.insert_attraction(engine, att)[source]¶ given a database connection and a tabular form of a google event, insert into the attractions table
-
api.google_search.make_attraction(engine)[source]¶ given a database connection, create an attraction table
-
api.google_search.make_tabular_google(result)[source]¶ given a json object from google search api, manipulate results into tabular form
-
api.google_search.read_key(fname)[source]¶ reads in secret key from file assumes fname is at base of EC2
eventbrite_search.py¶
-
api.eventbrite_search.get_events(categories)[source]¶ using Eventbrites api given a dictionary:
key: category id (specified by eventbrite) value: category namesreturn list of json files for each category
-
api.eventbrite_search.insert_event(engine, e)[source]¶ given a database connection and a tabular form of a eventbrite event, insert into the events table if event does not exit in table
-
api.eventbrite_search.make_events(engine)[source]¶ given a database connection, create an events table
-
api.eventbrite_search.make_tabular_eb(event, cat_name)[source]¶ given a json object from eventbrite api, manipulate results into tabular form