All Projects → Albert-Gao → world-cities-mongodb

Albert-Gao / world-cities-mongodb

Licence: other
A free world cities database

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to world-cities-mongodb

china regions
Ruby Library for China Regions
Stars: ✭ 23 (-20.69%)
Mutual labels:  countries, cities
top-regional-repositories
🌍 The most-relevant repositories for all countries and many cities worldwide.
Stars: ✭ 18 (-37.93%)
Mutual labels:  countries, cities
world
A Laravel package which provides a list of the countries, states, cities, currencies, timezones and languages.
Stars: ✭ 479 (+1551.72%)
Mutual labels:  countries, cities
geo-sql-database
Continents, Sub-Continents, Countries, States, Cities, Timezones, Currencies SQL database.
Stars: ✭ 30 (+3.45%)
Mutual labels:  countries, cities
countriesNowAPI
CountriesNow is an Open source API for retrieving geo-information for countries, including their states, cities, population, etc. 🌎
Stars: ✭ 78 (+168.97%)
Mutual labels:  countries, cities
Geographer
PHP library that knows how countries and cities are called in any language
Stars: ✭ 714 (+2362.07%)
Mutual labels:  geolocation, countries
oracle-geo-data
demo.insum.ca/ords/f?p=131
Stars: ✭ 20 (-31.03%)
Mutual labels:  countries, cities
Country Ip Blocks
CIDR country-level IP data, straight from the Regional Internet Registries, updated hourly.
Stars: ✭ 100 (+244.83%)
Mutual labels:  geolocation, countries
Nager.Country
Worldwide Country Informations (ISO-3166-1 Alpha2, ISO-3166-1 Alpha3, ISO 639-1)
Stars: ✭ 68 (+134.48%)
Mutual labels:  countries
FakeGPS
[NOT MAINTAINED] FakeGPS driver for Windows
Stars: ✭ 85 (+193.1%)
Mutual labels:  geolocation
rescue-me
Light-weight and minimalistic system for push-based location requests.
Stars: ✭ 13 (-55.17%)
Mutual labels:  geolocation
totalopenstation
Total Open Station downloads and exports survey data from your total station
Stars: ✭ 51 (+75.86%)
Mutual labels:  geolocation
database-of-embassies
Database of embassies and consulates. Download as CSV, no registration, public domain. Powered by Wikidata.
Stars: ✭ 33 (+13.79%)
Mutual labels:  countries
ip2location-lua
Use IP2Location geolocation database to lookup the geolocation information with IP2Location Lua Package. It can be used to determine country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation, usage type, address type and IAB category that any IP address …
Stars: ✭ 14 (-51.72%)
Mutual labels:  geolocation
Geocoding-with-Map-Vector
Resources for the ACL 2018 publication "Which Melbourne? Augmenting Geocoding with Maps", published in July 2018.
Stars: ✭ 24 (-17.24%)
Mutual labels:  geolocation
Frontend-Learning-Journey
Tutorials, definitions, frameworks and some of the projects i made when starting to learn frontend web developement
Stars: ✭ 28 (-3.45%)
Mutual labels:  geolocation
captAR
Augmented Reality Geolocation Capture-the-Flag Mobile Game Capstone Project
Stars: ✭ 24 (-17.24%)
Mutual labels:  geolocation
tinygeoip
🐉 tiny geoip microservice
Stars: ✭ 13 (-55.17%)
Mutual labels:  geolocation
ir-city-select
List of Iran provinces and cities to use in HTML forms. ( ~2.3KB gzipped )
Stars: ✭ 22 (-24.14%)
Mutual labels:  cities
df-aggregator
Networked DFing software that can handle multiple DOA receivers.
Stars: ✭ 47 (+62.07%)
Mutual labels:  geolocation

world-cities-mongodb

Do you want a database which contains most of cities in the world as well as the countries? This app will save 2 collections to your mongodb:

  1. cities(23328 in total)
  2. countries(252 in total)

Even better, the

Why use it

  • Language agnostic because it's not a lib. Consume the result database using any language you like.
  • Source data from GeoNames.org is under active updates. And this app will let you update in few seconds.
  • No other 3rd party libs dependencies but official pymongo
  • python main.py to generate the database from source data
  • python update.py to update the source data from GeoNames
  • Remove any fields you don't need in settings.py
  • Support currency symbol which not included in the GeoNames (like $ for USD)
  • Easy to add support for other database. See FAQ part.
  • Could filter countries which only speak certain languages. (see setting.py)
  • Could add "duplicate" data to prevent more queries in MongoDB (see settings.py)

Python version

  • Python 3
  • Python 2 should be fine, but haven't tried.

How to use

  1. git clone https://github.com/Mr-Binary/world-cities-mongodb.git

  2. pip install pymongo

  3. Open settings.py, set up your database settings.

  4. python main.py

  5. Enjoy :)

  • To update the source data in data folder: python update.py

Folder Structure

  • [data]: [Folder] Raw data from GeoNames
  • [models]: [Folder] database model for city and country
  • [utils]: [Folder] Helper function
  • settings.py: Settings
  • main.py: Main file to generate the database
  • update.py: Update the source data from GeoNames

About the data

  • The data is from GeoNames.

  • The cities contains cities which population greater than 15000.

  • How to update the data

    • python update.py
  • The URL of source data from GeoNames:

FAQ

What will happen if I run the app twice

  • Every execution will drop the previous collection and generate new one.

How about support other database

  • It's very easy, you just need to refactor the save_cities() and save_countries() in mongodb.py, then it will be called at run time with the list of data to insert.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].