Skip to main content

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.

Metadata

Release files for fiftyone-location 4.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fiftyone-location 4.5.4
File Size Uploaded
fiftyone_location-4.5.4.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fiftyone-location 4.5.4
File Interpreter ABI Platform
fiftyone_location-4.5.4-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / fiftyone_location-4.5.4.tar.gz

Download URL fiftyone_location-4.5.4.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
997822378a9e49a64b40054bd2348113d53efac9872339e05a1810b2dcb34631
BLAKE2b-256 checksum
How to use checksums
1a793b91be4e2617bfc1154be503eb6fac97bbef3673534c25be4eea712c6800
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / fiftyone_location-4.5.4-py3-none-any.whl

Download URL fiftyone_location-4.5.4-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e596d6bc9ddf80d0eba2f9ea9f30bf6a3695be4677c1903294cd33a9d8fd071e
BLAKE2b-256 checksum
How to use checksums
4630e6ad6ebebbac20e133dc5fc2ce75b5eb29bd80dad3ca5ae99ea5850a3acc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page