Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

Python library for parsing geospatial relationships from natural language into structured objects

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages