surgeo.app package

Submodules

surgeo.app.surgeo_cli module ———————~~~~~~~

Script containing a basic command line program.

class surgeo.app.surgeo_cli.SurgeoCLI

Bases: object

A CLI application class to function as an executable

This script adds surgeo to path and runs a simple command line script. The class pulls in a parser, parses the command line arguments as needed, loads the data, processes the data, and sends the output to a file. It uses the “main()” function and then uses other methods as helpers.

Example

main()

This is the public interface function for this CLI.

In summary, this function triggers various routines that:

  1. Read arguments;
  2. Take a user defined path argument and load an Excel or CSV into a dataframe;
  3. Route that dataframe to a speciic processing function based on the “type” function argument (e.g. first_name, surname, geocoding, bifsg, or surgeo);
  4. Optional specifies the column names to analyze (if not using the default “zcta5”, “name”, or “first_name” headers);
  5. Runs the appropriate algorithm and returns a new dataframe;
  6. Writes the resulting data to a new CSV based to output path specified by user.
Raises:surgeo.utility.SurgeoException – Raised if 1) file endings are not correct, 2) inappropriate columns are specified, 3) an incorrect model type is supplied, or 4) an inappropriate outputs are not specified.

surgeo.app.surgeo_gui module ———————~~~~~~~

Script containing a basic GUI program.

class surgeo.app.surgeo_gui.SurgeoGUI

Bases: object

A GUI application class to function as an executable

This script creates a single window tkinter application. This application allows a user to specify inputs/outputs, specify which model that they want to run, and then define the column headers for the ZCTA, first name, and surname fields as applicable. It then runs the model and stores the results in a file.

It also has various helper functions to integrate the surgeo logic within the program.

It currently supports .xlsx, .xls, and .csv inputs; it currently supports .xlsx and .csv outputs.

main()

This is the entry point for the GUI program.

It calls a function to create a root window, then adds widgets to that root window, and then finally triggers the tkinter main loop.

Module contents

Applications built on Surgeo