Skip to main content

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

51Degrees v4 Location Python

Developer Documentation

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)

Dependencies

For runtime dependencies, see our dependencies page. The tested versions page shows the Python versions that we currently test against. The software may run fine against other versions, but additional caution should be applied.

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, the following are included with this repository:

| Example | Description | | gettingstarted.py | Demonstrates the basics of using the service to get postal address information from coordinates. | | web.py | Shows how to use the location service as part of a simple website. |

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fiftyone_location-4.4.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fiftyone_location-4.4.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file fiftyone_location-4.4.1.tar.gz.

File metadata

  • Download URL: fiftyone_location-4.4.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.13

File hashes

Hashes for fiftyone_location-4.4.1.tar.gz
Algorithm Hash digest
SHA256 10624fa62595bb0eacf59fd0bd5a3189a089ea0c4c93fba74ad2aa4655b8d2c9
MD5 7108a74a0dcf6659b3da876480ec72a9
BLAKE2b-256 f5d8af6a94ae1e44c9c9fb0033d3877746dedbee874af76c776b1981d8f34b14

See more details on using hashes here.

File details

Details for the file fiftyone_location-4.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fiftyone_location-4.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1144f757b14c45e7e3cfd1a0091fcc9d3ab8f82f342405be577ec2430e36b946
MD5 0fec659ddcd55a3697bde75ddaae9745
BLAKE2b-256 c8e68d0eaf677dc6e5158c2930b71b9761307621b1e1b7d9656414034cf2fe75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page