Skip to content

Project to create a database of country specific statistics that can be queried

License

Notifications You must be signed in to change notification settings

joccing/geoguru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geoguru v0.5.3

Project to create a database of country specific statistics that can be queried.

It takes a text file of country specific data and I have writen a Python program to allow command-line query of any country and for any of its attributes, such as population size or density per km2.

Step 1: Prepare country data

I simply copied and paste the data from Worldometer's page on country population statistics, into a text file. The file clean.sh takes two arguments, this raw data file and the raw data file that contains the field names. The output is a cleaned up version, properly formatted to be loaded into the main program. The result will be stored in data.out.

$ cd raw
$ clean.sh world-population.raw fields
$ head data.out

Step 2: Load data file into main DB

The main program currently takes the output of Step 1 and creates a memory store that can be queried by country name and attribute. For instance to query about Uruguay's geo statistics:

$ cmain.py -f raw/data.out Uruguay

or if you can't remember the whole name,

$ cmain.py -f raw/data.out urug

To find all statistics that involve the substring 'pop'

$ cmain.py -f raw/data.out urug pop

About

Project to create a database of country specific statistics that can be queried

Resources

License

Stars

Watchers

Forks

Packages

No packages published