The 51Degrees Pipeline API is a generic web request intelligence and data processing solution with the ability to add a range of 51Degrees and/or custom plug ins (Engines). This repository contains the geo-location engines for the Python implementation of the Pipeline API.
Project description
51Degrees Geo-Location Engines
v4 Location Python
Introduction
This project contains the geo-location engines for the Python implementation of the 51Degrees Pipeline API.
The Pipeline is a generic web request intelligence and data processing solution with the ability to add a range of 51Degrees and/or custom plug ins (Engines)
Requirements
- Python 3.5+
- The
flask
python library to run the web examples
Installation and Examples
From PyPI
pip install fiftyone-location
You can confirm this is working with the following micro-example.
- Create a resource key for free with the 51Degrees configurator. This defines the properties you want to access.
- On the 'implement' page of the configurator, copy the resource key and replace YOUR_RESOURCE_KEY in the example below. Save this as examplelocation.py
- Run the example with
python examplelocation.py
- Feel free to try different locations and property values.
from fiftyone_location.location_pipelinebuilder import LocationPipelineBuilder
pipeline = LocationPipelineBuilder(resource_key="YOUR_RESOURCE_KEY").build()
fd = pipeline.create_flowdata()
fd.evidence.add("query.51D_Pos_latitude", "40.730610")
fd.evidence.add("query.51D_Pos_longitude", "-73.935242")
fd.process()
print(fd.location.town.value())
For more in-depth examples, check out the examples page in the documentation.
From GitHub
If you've cloned the GitHub repository, you will be able to run the examples directly:
python -m examples.cloud.gettingstarted
To run the web example navigate into Examples folder:
Linux
Execute export FLASK_APP=web
where web
is the example file, and start your application via flask run
.
Windows
Execute $env:FLASK_APP = "web"
where web
is the example file, and start your application via flask run
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fiftyone_location-4.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c7e1b2cc0b5bae910bdccc8b5d73f28d25ca3b61cc33d2cb40bd771792b0b58 |
|
MD5 | e0edd7c3d31ec7943747d660960dd4f5 |
|
BLAKE2b-256 | 59adb3592f87fffdf65a6aeca58cde6330587e7dd97665827cdbe5df3df8f2be |