splitinerary package
Submodules
splitinerary.custom_event module
splitinerary.event module
- class splitinerary.event.Event(datetime, users=None)[source]
Bases:
objectEvent object. Each event is sortable among other Events by datetime.
- Attributes:
- datetime (datetime.datetime): when the user wants to arrive at
the event, NOT NECESSARILY when the event starts (e.g. user might arrive at the airport 2 hours before the flight departs).
splitinerary.transportation module
- class splitinerary.transportation.Boat(departure_terminal, arrival_terminal, route=None, *args, **kw)[source]
Bases:
TransportationBoat transportation method.
- class splitinerary.transportation.Car(departure_location, arrival_location, company=None, *args, **kw)[source]
Bases:
TransportationCar transportation method.
- class splitinerary.transportation.Plane(flight_number, departure_terminal=None, arrival_terminal=None, *args, **kw)[source]
Bases:
TransportationPlane transportation method.
- class splitinerary.transportation.Train(departure_station, arrival_station, train_line=None, *args, **kw)[source]
Bases:
TransportationTrain transporation method.
splitinerary.trip module
- class splitinerary.trip.Trip[source]
Bases:
objectTrip object that everything else in Splitinerary gets added to.
- Attributes:
- dates_list (list of datetime.date): sortable list of datetime.date,
used to keep track of which dates have events on them.
- dates_dict (dict of datetime.dateevent.Event):
keys can be used to see if date exists in trip, values are lists (that can be sorted) of each day’s events.
- user_activities (dict of user: {date: [event1, event2]}):
Maps users to their activities on dates
- add_event(event)[source]
Add an Event object to the Trip. This involves adding the date of the event to self.dates_list and adding the event to self.dates_dict[date].
- Args:
event (Event): The event to be added to the Trip.
- add_user_to_event(user, event)[source]
Add a user to an Event in the Trip.
- Args:
user (User): User to add to the Event. event (Event): Event from which User is being added.
- get_all_events()[source]
Returns all events in the Trip in order of start time.
- Returns:
list of Event: sorted list of all events in the trip.
- get_eventful_dates()[source]
- Print all of the dates that have an event on them in order of start
time.
- Returns:
list of datetime.date: sorted list of dates that have events on them if it exists, else None.
- get_events_of_user(user)[source]
Gets the events of a given User.
- Args:
user (User): A User in the Trip.
- Returns:
dict of user: {date: [event1, event2]} : dictionary of user’s events for each day.
- get_events_on_date(date)[source]
Returns of the events on a certain day in order of start time.
- Args:
date (datetime.date): the date whose events are to be returned.
- Returns:
list of (datetime.time, Event): sorted list of tuples of events on the input date if it exists, else None.
- get_next_event()[source]
Returns the next event that will take place for any user.
- Returns:
Event: the next event that will take place for any User if it exists, else None.
- get_users_list()[source]
Gets list of users participating in Trip.
- Returns:
list of Users: A list of users participating in Trip.
splitinerary.user module
Module contents
- class splitinerary.Boat(departure_terminal, arrival_terminal, route=None, *args, **kw)[source]
Bases:
TransportationBoat transportation method.
- class splitinerary.Car(departure_location, arrival_location, company=None, *args, **kw)[source]
Bases:
TransportationCar transportation method.
- class splitinerary.CustomEvent(event_name, description, start_time, end_time, cost=0, *args, **kw)[source]
Bases:
EventCustom Events like concerts, parties, shows, etc.
- class splitinerary.Event(datetime, users=None)[source]
Bases:
objectEvent object. Each event is sortable among other Events by datetime.
- Attributes:
- datetime (datetime.datetime): when the user wants to arrive at
the event, NOT NECESSARILY when the event starts (e.g. user might arrive at the airport 2 hours before the flight departs).
- class splitinerary.Plane(flight_number, departure_terminal=None, arrival_terminal=None, *args, **kw)[source]
Bases:
TransportationPlane transportation method.
- class splitinerary.Train(departure_station, arrival_station, train_line=None, *args, **kw)[source]
Bases:
TransportationTrain transporation method.
- class splitinerary.Transportation(departure_time, arrival_time, cost=0, confirmation_code=None, *args, **kw)[source]
Bases:
EventTransporation object that the vehicle objects inherit from.
- class splitinerary.Trip[source]
Bases:
objectTrip object that everything else in Splitinerary gets added to.
- Attributes:
- dates_list (list of datetime.date): sortable list of datetime.date,
used to keep track of which dates have events on them.
- dates_dict (dict of datetime.dateevent.Event):
keys can be used to see if date exists in trip, values are lists (that can be sorted) of each day’s events.
- user_activities (dict of user: {date: [event1, event2]}):
Maps users to their activities on dates
- add_event(event)[source]
Add an Event object to the Trip. This involves adding the date of the event to self.dates_list and adding the event to self.dates_dict[date].
- Args:
event (Event): The event to be added to the Trip.
- add_user_to_event(user, event)[source]
Add a user to an Event in the Trip.
- Args:
user (User): User to add to the Event. event (Event): Event from which User is being added.
- get_all_events()[source]
Returns all events in the Trip in order of start time.
- Returns:
list of Event: sorted list of all events in the trip.
- get_eventful_dates()[source]
- Print all of the dates that have an event on them in order of start
time.
- Returns:
list of datetime.date: sorted list of dates that have events on them if it exists, else None.
- get_events_of_user(user)[source]
Gets the events of a given User.
- Args:
user (User): A User in the Trip.
- Returns:
dict of user: {date: [event1, event2]} : dictionary of user’s events for each day.
- get_events_on_date(date)[source]
Returns of the events on a certain day in order of start time.
- Args:
date (datetime.date): the date whose events are to be returned.
- Returns:
list of (datetime.time, Event): sorted list of tuples of events on the input date if it exists, else None.
- get_next_event()[source]
Returns the next event that will take place for any user.
- Returns:
Event: the next event that will take place for any User if it exists, else None.
- get_users_list()[source]
Gets list of users participating in Trip.
- Returns:
list of Users: A list of users participating in Trip.