Skip to content
Python library for parsing geospatial relationships from natural language into structured objects
Branch: master
Clone or download
Latest commit ff93e38 Jan 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
georel added foot Jan 26, 2018
.gitignore initial work Jan 26, 2018
.travis.yml initial work Jan 26, 2018
AUTHORS initial work Jan 26, 2018
CONTRIBUTING.rst initial work Jan 26, 2018
LICENSE initial work Jan 26, 2018
MANIFEST.in initial work Jan 26, 2018
README.rst initial work Jan 26, 2018
requirements.txt initial work Jan 26, 2018
setup.cfg initial work Jan 26, 2018
setup.py initial work Jan 26, 2018

README.rst

georel

https://travis-ci.org/spatialcurrent/georel.png Master Documentation Status

Description

A Python library for parsing geospatial relationships from natural language.

Installation

Install via PyPI with:

pip install georel

Or install directly from GitHub with:

pip install git+git://github.com/spatialcurrent/georel.git@master

Usage

Below are some simple use cases. See test.py for more use cases.

from georel import georel

value = georel.parse("2", "m")
# value == {"value": 2, "units": "meter"}

value = georel.parse("2", "km")
# value == {"value": 2, "units": "kilometer"}

value = georel.parse("2", "miles")
# value == {"value": 2, "units": "mile"}

By default, the original units are used, but georel can transform to another unit too.

value = georel.parse("1,000", "meters", "miles")
# value == {"value": 0.621371, "units": "mile"}

Testing

For unit tests, run the following command from the project root folder:

python -m unittest -v georel.test

Contributing

Spatial Current, Inc. is currently accepting pull requests for this repository. We'd love to have your contributions! Please see Contributing.rst for how to get started.

License

This work is distributed under the MIT License. See LICENSE file.

You can’t perform that action at this time.