GithubHelp home page GithubHelp logo

imclab / geonamescache Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yaph/geonamescache

0.0 1.0 0.0 3.91 MB

geonamescache - a Python library for quick access to a subset of GeoNames data.

Home Page: https://pypi.python.org/pypi/geonamescache

License: MIT License

geonamescache's Introduction

Geonames Cache

https://badge.fury.io/py/geonamescache.png https://travis-ci.org/yaph/geonamescache.png?branch=master

A Python library that provides functions to retrieve names and codes of continents, countries and US states as Python dictionaries.

Geonames data is obtained from GeoNames.

Installation

To install geonamescache, run:

$ sudo pip install geonamescache

Or, if necessary:

$ sudo easy_install geonamescache

Usage

A simple usage example:

import geonamescache

gc = geonamescache.GeonamesCache()
countries = gc.get_countries()
# print countries dictionary
print(countries)
# you really wanna do something more useful with the data...

Methods

Currently geonamescache provides the following methods, that all return dictionaries with the requested data:

  • get_continents()
  • get_countries()
  • get_us_states()
  • get_cities()
  • get_countries_by_names()
  • get_us_states_by_names()
  • get_cities_by_name(name)

TODOs

  • analyze performance of get_cities_by_name
  • call get_dataset_by_key with name of dataset, so there is no need for *_by_names methods

Contributing

  1. Fork the repository on GitHub
  2. Commit your changes to the develop branch
  3. Write test(s) for any new feature
  4. Push your changes and send a pull request

geonamescache's People

Contributors

yaph avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.