meetup2xibo.updater package

Submodules

meetup2xibo.updater.anti_flapper module

Avoids flapping Xibo events.

class meetup2xibo.updater.anti_flapper.AntiFlapper(recent_limit, current_limit, future_limit)[source]

Bases: object

Avoids flapping caused when Xibo events do not match Meetup events.

Meetup sometimes fails to retrieve current and recent events that should still be displayed. Meetup often fails to retrieve far future events previously seen because newer events have been added with earlier meeting times. Configuration specifies flapping windows around the current time and in the far future. Missing meetup events will not be deleted from Xibo when they fall within the flapping windows.

categorize(xibo_event)[source]

Categorize an event based on its times and the flapping window. Return an event flapping status.

is_future(xibo_event)[source]

Return true if the event ends after the future limit; false otherwise.

is_past(xibo_event)[source]

Return true if the event ends before the anti-flapping window; false otherwise.

is_planned(xibo_event)[source]

Return true if the event is planned between the two flapping windows; false otherwise.

class meetup2xibo.updater.anti_flapper.EventFlappingStatus(action)[source]

Bases: enum.Enum

An event’s status chosen by the anti-flapper.

delete = 'Deleted'
keep = 'Kept'
retire = 'Retired'

meetup2xibo.updater.application_scope module

Application scope holds command line arguments and environment variables needed by the application.

class meetup2xibo.updater.application_scope.ApplicationScope(args, env_vars)[source]

Bases: object

Application scope provides configuration values.

app_name
conflict_places
conflicts
containing_places
debug
default_location
default_places
delete_after_end_seconds
delete_before_start_seconds
delete_until_future_seconds
end_time_column_name
event_dataset_code
event_suppressor(event_suppressor_provider)[source]
ignore_cancelled_after_seconds
location_column_name
log_level
logfile
mappings
meetup_events_wanted
meetup_group_url_name
meetup_id_column_name
more_place_phrase_tuples
more_place_phrases
name_column_name
place_phrase_tuples
place_phrases
site_ca_path
site_url
special_locations
special_locations_dict
start_time_column_name
suppressed_event_ids
timezone
verbose
version
warnings
xibo_client_id
xibo_client_secret
xibo_host
xibo_id_column_name
xibo_page_length
xibo_port
class meetup2xibo.updater.application_scope.PhraseLocation(phrase, place)

Bases: tuple

phrase

Alias for field number 0

place

Alias for field number 1

meetup2xibo.updater.command_line module

Command line options.

meetup2xibo.updater.command_line.parse_args(args=None)[source]

meetup2xibo.updater.event_converter module

Converts individual and lists of Meetup events from JSON dictionaries into event objects.

class meetup2xibo.updater.event_converter.Event(meetup_id, name, location, start_time, end_time, places)

Bases: tuple

end_time

Alias for field number 4

location

Alias for field number 2

meetup_id

Alias for field number 0

name

Alias for field number 1

places

Alias for field number 5

start_time

Alias for field number 3

class meetup2xibo.updater.event_converter.EventConverter(location_chooser, date_time_creator)[source]

Bases: object

Converts Meetup events from JSON dictionaries into event objects.

convert(event_json)[source]

Convert Meetup event JSON to an event tuple.

convert_cancelled(event_json)[source]

Convert Meetup cancelled event JSON to an event tuple.

static edit_name(raw_name)[source]

Extract a condensed name, omitting the accounting code.

static event(partial_event, location)[source]

Return an event combining a partial event and a location.

logger = <Logger EventConverter (WARNING)>
partial_event(event_json)[source]

Convert Meetup event JSON to a partial event tuple.

class meetup2xibo.updater.event_converter.EventListConverter(event_converter, event_suppressor)[source]

Bases: object

Converts a list of Meetup events from JSON dictionaries into event objects.

convert_cancelled_meetup_events(json_events)[source]

Convert a list of cancelled Meetup events.

convert_events_from_json(json_events, convert)[source]

Convert event tuples from a list of Meetup JSON events with a conversion function.

convert_meetup_events(json_events)[source]

Convert a list of Meetup events.

class meetup2xibo.updater.event_converter.PartialEvent(meetup_id, name, start_time, end_time, venue_name, find_us)

Bases: tuple

end_time

Alias for field number 3

find_us

Alias for field number 5

meetup_id

Alias for field number 0

name

Alias for field number 1

start_time

Alias for field number 2

venue_name

Alias for field number 4

meetup2xibo.updater.event_updater module

Updates the events in the Xibo database to conform to events from Meetup.com.

class meetup2xibo.updater.event_updater.EventUpdater(meetup_events, cancelled_meetup_events, xibo_events, xibo_event_crud, anti_flapper, event_suppressor, special_location_monitor)[source]

Bases: object

Updates events in a Xibo dataset by inserting, updating, or deleting events to make the Xibo events conform to Meetup.com events.

check_flapping_event(xibo_event)[source]

Retire or delete events not flapping.

delete_unknown_events(event_ids)[source]

Delete unknown (to Meetup) events given a set of event IDs.

delete_xibo_event(xibo_event, action)[source]

Delete an event from Xibo, logging an action such as “Retired”.

static event_list_to_dict(events)[source]
insert_new_events(event_ids)[source]

Insert new events given a set of event IDs.

logger = <Logger EventUpdater (WARNING)>
update_cancelled_events(event_ids)[source]

Update changed events given a set of cancelled event IDs.

update_changed_event(xibo_event, meetup_event)[source]

Update the Xibo event with data from the Meetup event if they differ.

update_known_events(event_ids)[source]

Update changed events given a set of event IDs.

update_xibo()[source]

Update the Xibo database by inserting, updating, or deleting events to make the Xibo events conform to Meetup.com events.

meetup2xibo.updater.exceptions module

Descriptive exceptions.

exception meetup2xibo.updater.exceptions.ContainmentLoopError[source]

Bases: Exception

Raised when conflict analysis finds a loop in place containment.

exception meetup2xibo.updater.exceptions.DatasetDiscoveryError[source]

Bases: Exception

Raised when dataset discovery fails.

exception meetup2xibo.updater.exceptions.JsonConversionError[source]

Bases: Exception

Raised when JSON conversion fails.

exception meetup2xibo.updater.exceptions.MissingEnvVarError[source]

Bases: Exception

Raisded when an expected environment variable is missing.

meetup2xibo.updater.http_response_error module

Excepctions that raise when responses contain HTTP errors.

exception meetup2xibo.updater.http_response_error.HttpResponseError[source]

Bases: Exception

Raised when HTTP response status is not ok.

classmethod check_response_status(response)[source]

Raise this exception if the response status is not ok.

logger = <Logger HttpResponseError (WARNING)>
exception meetup2xibo.updater.http_response_error.MeetupApiError[source]

Bases: meetup2xibo.updater.http_response_error.HttpResponseError

Raised when a Meetup HTTP response status is not ok.

logger = <Logger MeetupApiError (WARNING)>
exception meetup2xibo.updater.http_response_error.XiboApiError[source]

Bases: meetup2xibo.updater.http_response_error.HttpResponseError

Raised when a Xibo HTTP response status is not ok.

logger = <Logger XiboApiError (WARNING)>

meetup2xibo.updater.injector module

Test generating the Xibo API.

meetup2xibo.updater.injector.inject_anti_flapper(application_scope)[source]

Return an anti-flapper configured by an application scope.

meetup2xibo.updater.injector.inject_automaton()[source]

Return an Aho-Corasick automaton.

meetup2xibo.updater.injector.inject_cancelled_last_time(application_scope)[source]

Return the last time allowed for cancelled Meetup events configured by an application scope.

meetup2xibo.updater.injector.inject_cert_validation_url(application_scope)[source]

Return the URL for certificate validation configured by an application scope.

meetup2xibo.updater.injector.inject_column_name_manager(application_scope)[source]

Return a Xibo column name manager configured by an application scope.

meetup2xibo.updater.injector.inject_conflict_analyzer(application_scope)[source]

Return a conflict analyzer configured by an application scope.

meetup2xibo.updater.injector.inject_conflict_places(application_scope)[source]

Return conflict places configured by an application scope.

meetup2xibo.updater.injector.inject_current_limit(application_scope)[source]

Return the current flapping limit configured by an application scope.

meetup2xibo.updater.injector.inject_date_time_creator(application_scope)[source]

Return a date/time creator configured by an application scope.

meetup2xibo.updater.injector.inject_default_event_location(application_scope)[source]

Return an event location for the default location and places configured by an application scope.

meetup2xibo.updater.injector.inject_enter_logging_application_scope(application_scope)[source]

Return a function configured by an application scope that provides a processor configured by an application scope and a notional logging application scope.

meetup2xibo.updater.injector.inject_enter_xibo_event_crud_scope(application_scope, xibo_session_scope)[source]

Return a function configured by an application scope that provides a Xibo event CRUD processor configured by an application scope and a Xibo session scope.

meetup2xibo.updater.injector.inject_enter_xibo_session_scope(application_scope)[source]

Return a function configured by an application scope that provides a Xibo session processor configured by an application scope and a Xibo session scope.

meetup2xibo.updater.injector.inject_event_converter(application_scope)[source]

Return an event converter configured by an application scope.

meetup2xibo.updater.injector.inject_event_list_converter(application_scope)[source]

Return an event list converter configured by an application scope.

meetup2xibo.updater.injector.inject_event_suppressor(application_scope)[source]

Return an event suppressor configured by an application scope.

meetup2xibo.updater.injector.inject_event_suppressor_provider(application_scope)[source]

Return a function that provides an event suppressor configured by an application session scope.

meetup2xibo.updater.injector.inject_event_updater_provider(application_scope, xibo_session_scope)[source]

Return a function that provides an event updater configured by a Xibo session scope.

meetup2xibo.updater.injector.inject_future_limit(application_scope)[source]

Return the future flapping limit configured by an application scope.

meetup2xibo.updater.injector.inject_location_chooser(application_scope)[source]

Return a location builder configured by an application scope.

meetup2xibo.updater.injector.inject_logging_application(application_scope)[source]

Return a logging application configured by an application scope.

meetup2xibo.updater.injector.inject_logging_context(application_scope)[source]

Return a logging context configured by an application scope.

meetup2xibo.updater.injector.inject_logging_setup_manager(application_scope)[source]

Return a logging setup manager configured by an application scope.

meetup2xibo.updater.injector.inject_meetup2xibo(application_scope)[source]

Return a Meetup to Xibo converter configured by an application scope.

meetup2xibo.updater.injector.inject_meetup_events_retriever(application_scope)[source]

Return a Meetup events retriever configured by an application scope.

meetup2xibo.updater.injector.inject_more_places_phrase_mapper(application_scope)[source]

Return a phrase mapper for more place phrases configured by an application scope.

meetup2xibo.updater.injector.inject_no_trace_exceptions()[source]

Return a tuple listing exception classes that need no traceback.

meetup2xibo.updater.injector.inject_null_conflict_analyzer()[source]

Return a null conflict analyzer.

meetup2xibo.updater.injector.inject_oauth2_session_starter(application_scope)[source]

Return an Oauth2SessionStarter configured by an application scope.

meetup2xibo.updater.injector.inject_phrase_mapper(application_scope, phrase_tuples)[source]

Return a phrase mapper configured by an application scope and a list of tuples containing a phrase and its preferred phrase.

meetup2xibo.updater.injector.inject_phrase_mappers(application_scope)[source]

Return a list of phrase mappers configured by an application scope.

meetup2xibo.updater.injector.inject_place_finder(application_scope)[source]

Return a place finder configured by an application scope.

meetup2xibo.updater.injector.inject_places_phrase_mapper(application_scope)[source]

Return a phrase mapper for place phrases configured by an application scope.

meetup2xibo.updater.injector.inject_recent_limit(application_scope)[source]

Return the recent flapping limit configured by an application scope.

meetup2xibo.updater.injector.inject_selected_conflict_analyzer(application_scope)[source]

Return the conflict analyzer selected by a command-line argument and configured by an application scope.

meetup2xibo.updater.injector.inject_site_cert_assurer(application_scope)[source]

Return a site certificate assurer configured by an application scope.

meetup2xibo.updater.injector.inject_special_location_monitor(application_scope)[source]

Return a special location monitor configured by an application scope.

meetup2xibo.updater.injector.inject_tzinfo(application_scope)[source]

Return timezone info configured by an application scope.

meetup2xibo.updater.injector.inject_user_agent(application_scope)[source]

Return the user agent string for web requests configured by an application scope.

meetup2xibo.updater.injector.inject_xibo_api(application_scope, xibo_session_scope)[source]

Return a Xibo API manager configured by an application scope and a Xibo session scope.

meetup2xibo.updater.injector.inject_xibo_api_url_builder(application_scope)[source]

Return a Xibo API URL builder configured by an application scope.

meetup2xibo.updater.injector.inject_xibo_column_names(application_scope)[source]

Return Xibo event column names configured by an application scope.

meetup2xibo.updater.injector.inject_xibo_dataset_id_finder(application_scope, xibo_session_scope)[source]

Return a Xibo dataset ID finder configured by an application scope and a Xibo session scope.

meetup2xibo.updater.injector.inject_xibo_event_column_id_manager(xibo_event_crud_scope)[source]

Return a Xibo column ID manager configured by a Xibo event CRUD scope.

meetup2xibo.updater.injector.inject_xibo_event_crud(application_scope, xibo_session_scope, xibo_event_crud_scope)[source]

Return a Xibo event CRUD manager configured by an application scope, a Xibo session scope and a Xibo event CRUD scope.

meetup2xibo.updater.injector.inject_xibo_event_crud_processor(application_scope, xibo_session_scope, xibo_event_crud_scope)[source]

Return Xibo event CRUD processor configured by an application scope, a Xibo session scope and a Xibo event CRUD scope.

meetup2xibo.updater.injector.inject_xibo_session_processor(application_scope, xibo_session_scope)[source]

Return a Xibo session processor configured by an application scope and a Xibo session scope.

meetup2xibo.updater.injector.inject_xibo_token_url(application_scope)[source]

Return the URL for retrieving tokens configured by an application scope.

meetup2xibo.updater.location_chooser module

Chooses locations for partial events.

class meetup2xibo.updater.location_chooser.LocationChooser(place_finder, special_locations, default_event_location)[source]

Bases: object

Chooses locations for partial events.

For events with no special location, prefer any computed location over the default.

For events with a special location and no computed location, prefer any special location over the default.

For events with both an special location and a computed location, if the override flag is set, prefer any special location over any computed location over the default; otherwise prefer the computed location over the special location over the default.

choose_location(partial_event)[source]

Choose a location from a partial Meetup event.

find_event_location(partial_event)[source]

Find an event location from a partial Meetup event.

logger = <Logger LocationChooser (WARNING)>
resolve_locations(partial_event, computed_event_location, special_location)[source]

Choose an appropriate event location based on the availability of a special location.

resolve_with_special(computed_event_location, special_location)[source]

Consider the computed event location and the special location (both for a partial event) and the default event location. Return the most appropriate event location.

resolve_without_special(partial_event, computed_event_location)[source]

Consider computed and the default event locations. Return the most appropriate location.

meetup2xibo.updater.logging_context module

Provide a logging context to open and close loggers and handle otherwise unhandled exceptions.

class meetup2xibo.updater.logging_context.LoggingContext(app_name, description, logging_setup_manager, no_trace_exceptions)[source]

Bases: object

Logging context configures logging and reports exit exceptions.

log_exception(exc_type, exc_value)[source]

Log all but system exit exceptions. Skip traceback for common exceptions.

log_start_end(verb)[source]

Log the start or end of an application given a verb (Start or End).

meetup2xibo.updater.meetup2xibo module

Retrieve events from Meetup, extract data to display on signs, and update Xibo.

class meetup2xibo.updater.meetup2xibo.Meetup2Xibo(meetup_events_retriever, conflict_analyzer, event_list_converter, site_cert_assurer, oauth2_session_starter, event_suppressor, enter_xibo_session_scope)[source]

Bases: object

Downloads Meetup events into a Xibo database.

convert(meetup_events, cancelled_meetup_events)[source]

Convert Meetup events to Xibo events.

retreive_cancelled_meetup_events()[source]

Retrieve a list of cancelled Meetup events.

retreive_meetup_events()[source]

Retrieve a list of Meetup events.

run()[source]

Run the Meetup to Xibo conversion.

start_xibo_session()[source]

Return a new web session with the Xibo API server.

update_xibo_events(meetup_events, cancelled_meetup_events, xibo_session)[source]

Update events stored in Xibo to match the Meetup events.

class meetup2xibo.updater.meetup2xibo.XiboEventCrudProcessor(xibo_event_crud, provide_event_updater)[source]

Bases: object

Updates events stored in Xibo to match the Meetup events.

run()[source]

Update events stored in Xibo to match the Meetup events.

class meetup2xibo.updater.meetup2xibo.XiboEventCrudScope(event_dataset_id, event_column_ids)

Bases: tuple

event_column_ids

Alias for field number 1

event_dataset_id

Alias for field number 0

class meetup2xibo.updater.meetup2xibo.XiboSessionProcessor(event_dataset_code, dataset_id_finder, column_name_manager, xibo_api, enter_xibo_event_crud_scope)[source]

Bases: object

Retreives event dataset metadata from Xibo.

lookup_dataset_id()[source]

Lookup the dataset ID for a dataset code.

map_dataset_column_names(dataset_id)[source]

Map the dataset column names to IDs for a given dataset.

run()[source]

Retrieve event dataset metadata from Xibo.

update_xibo_events(event_dataset_id, event_column_ids)[source]

Update events stored in Xibo to match the Meetup events.

class meetup2xibo.updater.meetup2xibo.XiboSessionScope(meetup_events, cancelled_meetup_events, xibo_session)

Bases: tuple

cancelled_meetup_events

Alias for field number 1

meetup_events

Alias for field number 0

xibo_session

Alias for field number 2

meetup2xibo.updater.meetup_api module

Access Meetup API to download events.

class meetup2xibo.updater.meetup_api.MeetupEventsRetriever(group_url_name, events_wanted, cancelled_last_time)[source]

Bases: object

build_url()[source]

Build a Meetup API URL to download events.

request_params()[source]

Return a dictionary of request parameters.

retrieve_cancelled_events_json(**kwargs)[source]

Retrieve the JSON cancelled event list, adding keyword arguments to the usual request parameters.

retrieve_events_json(**kwargs)[source]

Retrieve the JSON event list, adding keyword arguments to the usual request parameters.

meetup2xibo.updater.oauth2_session_starter module

Starts an OAuth2 session.

class meetup2xibo.updater.oauth2_session_starter.Oauth2SessionStarter(client_id, client_secret, token_url, user_agent)[source]

Bases: object

Creates and authorizes an OAuth2 web session.

authorize_session(session)[source]

Authorize an OAuth2 session.

create_session()[source]

Create an OAuth2 session.

set_user_agent(session)[source]

Set the user agent for a web session.

start_session()[source]

Start an authorized OAuth2 web session.

exception meetup2xibo.updater.oauth2_session_starter.Oauth2SessionStarterError[source]

Bases: Exception

Raised when an Oauth2 session cannot be started.

meetup2xibo.updater.phrase_mapper module

Map phrases to preferred phrases.

class meetup2xibo.updater.phrase_mapper.PhraseMapper(automaton, phrase_tuples)[source]

Bases: object

Rewrites a string, mapping phrases to preferred phrases.

logger = <Logger PhraseMapper (WARNING)>
map_phrases(text)[source]

Return a list of phrases preferred to those found in the text.

setup()[source]

Setup and return the phrase mapper.

class meetup2xibo.updater.phrase_mapper.PhraseMapping(preferred_phrase, phrase_length)

Bases: tuple

phrase_length

Alias for field number 1

preferred_phrase

Alias for field number 0

class meetup2xibo.updater.phrase_mapper.SortableMatch(start, descending_phrase_length, end, preferred_phrase)

Bases: tuple

descending_phrase_length

Alias for field number 1

end

Alias for field number 2

preferred_phrase

Alias for field number 3

start

Alias for field number 0

meetup2xibo.updater.phrase_mapper.is_valid_match(match, text)[source]

True unless the match starts or ends in the middle of a word.

meetup2xibo.updater.phrase_mapper.longest_non_overlapping_matches(sorted_matches)[source]

Return a generator of the longest non-overlapping matches from a sorted list of matches.

meetup2xibo.updater.phrase_mapper.match_to_sortable_match(match)[source]

Return a sortable match given a match tuple. Matches will be sorted by start position and decending by phrase length.

meetup2xibo.updater.phrase_mapper.normalize_text(text)[source]

Normalize a text by converting it to lower case and removing excess white space.

meetup2xibo.updater.site_cert_assurer module

Assures that Python Requests recognizes a site’s certificate.

class meetup2xibo.updater.site_cert_assurer.SiteCertAssurer(sys_ca_path, site_ca_path, site_url, user_agent)[source]

Bases: object

Assures that Python Requests recognizes a site’s certificate.

append_site_cert()[source]

Append the site-specific certificate authority file to the Python Requests certificate authority file.

assure_site_cert()[source]

Assure that the site at URL has a valid SSL certificate we recognize.

cert_message()[source]

Return a formatted message for the certificate authority file.

have_valid_cert()[source]

Check that we have a valid SSL certificate for the site URL.

logger = <Logger SiteCertAssurer (WARNING)>
meetup2xibo.updater.site_cert_assurer.assure_site_cert(site_ca_path, site_url)[source]

Assure that the site’s certificate authority is available for accessing the URL.

meetup2xibo.updater.special_location_monitor module

Monitors special locations and reports when they are not needed.

class meetup2xibo.updater.special_location_monitor.SpecialLocationMonitor(special_locations)[source]

Bases: object

Monitors special locations and reports when they are not needed.

deleted_event(xibo_event)[source]

Log a warning when a deleted Xibo event has a corresponding special location.

logger = <Logger SpecialEventsMonitor (WARNING)>

meetup2xibo.updater.xibo_api module

Access Xibo API to update events.

class meetup2xibo.updater.xibo_api.XiboApi(session, xibo_api_url_builder, page_length)[source]

Bases: object

Hides details of accessing the Xibo API.

delete(url, **payload)[source]

Request deletion at a URL and return the response.

delete_dataset_data_by_id(dataset_id, row_id)[source]

Delete the dataset row.

get_about()[source]

Get the JSON representing the Xibo API version and other “about” information.

get_dataset_column_by_id(dataset_id)[source]

Get a JSON list of dataset column metadata, searching by the dataset id.

get_dataset_data_by_id(dataset_id)[source]

Get a JSON list of dataset data, searching by its id.

get_datasets_by_code(dataset_code)[source]

Get a JSON list of metadata about a dataset, searching by its code.

get_json(url, **payload)[source]

Request a URL and return the JSON result.

get_json_pages(url, **payload)[source]

Return a generator of JSON pages requested from the URL.

get_paged_json(url, **payload)[source]

Request a URL and return an iterable of all paged JSON results.

get_response(url, **payload)[source]

Request a URL and return the response.

get_xibo_api_version()[source]

Return the Xibo API version string.

insert_dataset_data(dataset_id, columns)[source]

Insert a row of data into the Xibo database.

logger = <Logger Xibo_API_Connection (WARNING)>
post(url, **payload)[source]

Request posting at a URL and return the response.

put(url, **payload)[source]

Request puting at a URL and return the response.

update_dataset_data(dataset_id, row_id, columns)[source]

Update a row of data in the Xibo database.

meetup2xibo.updater.xibo_api_url_builder module

Builds URLs for the XIBO API.

class meetup2xibo.updater.xibo_api_url_builder.XiboApiUrlBuilder(hostname, port=None)[source]

Bases: object

Builds URLs for Xibo API methods.

about_url()[source]

Return the URL for API version information.

access_token_url()[source]

Return the URL to access a token.

cert_validation_url()[source]

Return the URL for validating certificates.

dataset_column_url(dataset_id)[source]

Return the URL for retrieving column descriptions from the specified dataset.

dataset_data_row_url(dataset_id, row_id)[source]

Return the URL for the specified row from the specified dataset.

dataset_data_url(dataset_id)[source]

Return the URL for data from the specified dataset.

dataset_url()[source]

Return the URL for retrieving dataset metadata.

meetup2xibo.updater.xibo_dataset_id_finder module

Finds Xibo dataset IDs.

class meetup2xibo.updater.xibo_dataset_id_finder.XiboDatasetIdFinder(xibo_api)[source]

Bases: object

Finds Xibo dataset IDs.

datasets_problem(dataset_code, datasets)[source]

Return a message describing the problem with the list of datasets for a dataset code.

find_dataset_id(dataset_code)[source]

Find a dataset’s ID given the dataset code configured in the Xibo CMS.

get_xibo_datasets(dataset_code)[source]

Get a list of Xibo datasets given a dataset code.

static multiple_dataset_problem(dataset_code, datasets)[source]

Return a message describing the multiple datasets for a dataset code.

meetup2xibo.updater.xibo_event module

Event representations in Xibo.

class meetup2xibo.updater.xibo_event.XiboEvent(meetup_id, name, location, start_time, end_time, xibo_id)

Bases: tuple

end_time

Alias for field number 4

location

Alias for field number 2

meetup_id

Alias for field number 0

name

Alias for field number 1

start_time

Alias for field number 3

xibo_id

Alias for field number 5

class meetup2xibo.updater.xibo_event.XiboEventColumnIdManager(column_ids)[source]

Bases: object

Manages event conversion based on column IDs.

event_to_columns(event)[source]

Convert an event to a dictionary of columns keyed by column ID.

class meetup2xibo.updater.xibo_event.XiboEventColumnNameManager(column_names)[source]

Bases: object

Manages event conversion based on column names.

json_to_column_ids(json_columns)[source]

Convert JSON metatadata about Xibo dataset columns into a XiboEvent loaded with column IDs.

json_to_xibo_event(json_event)[source]

Convert a JSON event dictionary (or other mapping) to a XiboEvent named tuple.

meetup2xibo.updater.xibo_event_crud module

Create, read, update, and delete events in Xibo.

class meetup2xibo.updater.xibo_event_crud.XiboEventCrud(xibo_api, dataset_id, column_name_manager, column_id_manager)[source]

Bases: object

Create, read, update, and delete events in Xibo.

delete_xibo_event(xibo_event, action='Deleted')[source]

Delete a Xibo event and log the action.

get_xibo_events()[source]

Get a list of events from Xibo.

insert_meetup_event(meetup_event)[source]

Insert a Meetup event into the database.

logger = <Logger XiboEventCrud (WARNING)>
update_xibo_event(xibo_event, meetup_event)[source]

Update a Xibo event with a Meetup event.

Module contents