Skip to content

Parse Canadian FSA information from Canada Post's Official Listing of Forward Sortation Areas

License

Notifications You must be signed in to change notification settings

rahulgoel97/CanadaFSAParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CanadaFSAParser

Parse Canadian FSA information from Canada Post's Official Listing of Forward Sortation Areas

Reqiurements

Python packages used:

  • PyPDF2 - To parse information from the PDF
  • re - To use regular expressions to focus on the FSAs
  • pandas - To store in a dataframe, then excel
  • json - To store as a JSON

Example link

Here is an example document, for which this script works well: https://www.canadapost.ca/assets/pdf/KB/nps/nps_nonlettermail_fsalist_jan2019.pdf

Usage

  1. Place the script in your preferred location
  2. Download the latest Canada Post listing of Forward Sortation Areas (FSAs)
  3. Run the python script, by navigating to the location and using 'python canada_fsa_parser.py' on your shell
  4. Provide the location when prompted. For ease of use, place the PDF in the same directory/folder and supply the full file name. Eg: 'nps_nonlettermail_fsalist_jan2019.pdf'
  5. The script will prompt you to save as an Excel or JSON, and make your selections
  6. The files should appear in the same directory as your script
  7. Voila!

Output

Example of the Excel file
ExcelExample

Other

Feel free to use the JSON text file or Excel file included in the files above

About

Parse Canadian FSA information from Canada Post's Official Listing of Forward Sortation Areas

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages