Use the code

Getting and parsing user data

archmap.get_users(url='https://wiki.archlinux.org/index.php/ArchMap/List', local='')[source]

This funtion parses the list of users from the ArchWiki and returns it as a string.

Parameters:
  • url (string) -- Link to a URL that points to a ArchWiki ArchMap list (default)
  • local (string) -- Path to a local copy of the ArchWiki ArchMap source
Returns:

The extracted raw text list of users or None if not avaliable

Return type:

string or None

archmap.parse_users(users)[source]

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

Parameters:users (string) -- Raw user data from the ArchWiki
Returns:A list of lists, each sub_list has 4 elements: [latitude, longitude, name, comment]
Return type:list

Output generators

archmap.make_users(parsed_users, output_file, pretty=False)[source]

This function reads the raw text supplied by users, it then 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 text output
  • pretty (bool) -- If set to True, the output "columns" will be aligned and expanded to match the longest element
archmap.make_geojson(parsed_users, output_file)[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
archmap.make_kml(parsed_users, output_file)[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
archmap.make_csv(parsed_users, output_file)[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