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 raw text list of users

Return type:

string

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)[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
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