Use the code

Logging

archmap.message(message, verbosity, systemd=False)[source]

This function is used by others for message printing.

Parameters:
  • message (string) -- The text used for logging messages.
  • verbosity (int) -- If set to be >= 1 it will print out the string passed to message()
  • systemd (bool) -- If not False (the system uses the systemd journal), it will log to it using message.

Getting and parsing user data

archmap.get_users(output_file, verbosity)[source]

This funtion parses users from the ArchWiki and writes it to output_file

Parameters:
  • output_file (open) -- Location to save the raw user data from the ArchWiki
  • verbosity (int) -- If set to be >= 1 it will print out the string passed to message()
archmap.parse_users(users_file, verbosity)[source]

This function parses the wiki text from users_file into it's components.

Parameters:
  • users_file (open) -- Raw user data from the ArchWiki
  • verbosity (int) -- If set to be >= 1 it will print out the string passed to message()
Returns:

A list of lists, each sub_list has 4 elements: [latitude, longitude, name, comment]

Return type:

list

Output generators

archmap.make_geojson(parsed_users, output_file, verbosity)[source]

This function reads the user data supplied by parsed_users, it then generates GeoJSON output and writes it to output_file.

Parameters:
  • parsed_users (list) -- A list of lists, each sub_list should have 4 elements: [latitude, longitude, name, comment]
  • output_file (open) -- Location to save the GeoJSON output
  • verbosity (int) -- If set to be >= 1 it will print out the string passed to message()
archmap.make_kml(parsed_users, output_file, verbosity)[source]

This function reads the user data supplied by parsed_users, it then generates KML output and writes it to output_file.

Parameters:
  • parsed_users (list) -- A list of lists, each sub_list should have 4 elements: [latitude, longitude, name, comment]
  • output_file (open) -- Location to save the KML output
  • verbosity (int) -- If set to be >= 1 it will print out the string passed to message()
archmap.make_csv(parsed_users, output_file, verbosity)[source]

This function reads the user data supplied by parsed_users, it then generates CSV output and writes it to output_file.

Parameters:
  • parsed_users (list) -- A list of lists, each sub_list should have 4 elements: [latitude, longitude, name, comment]
  • output_file (open) -- Location to save the CSV output
  • verbosity (int) -- If set to be >= 1 it will print out the string passed to message()