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

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 configuration page. 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 --port 5151.

Windows

Execute $env:FLASK_APP = "web" where web is the example file, and start your application via flask run --port 5151.

A Flow Data cannot be used by two threads at once, so the web example creates a Flow Data for each request, uses it only in the code that handles that request, and closes it before the request ends. To hand work to another thread or task, read the values it needs from the Flow Data first and pass those values, not the Flow Data.

Find out more

Metadata

Release files for fiftyone-location 4.6.2

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.6.2
File Size Uploaded Provenance Actions
fiftyone_location-4.6.2.tar.gz 13.1 kB Without provenance Details for fiftyone_location-4.6.2.tar.gz

Built distribution (wheel)

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

Total release size: 18.9 kB

Release files / fiftyone_location-4.6.2.tar.gz

Download URL fiftyone_location-4.6.2.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4d58212ed5ddc232379b44df412829a910efeeb39aacb3e2d6a19ae744fb1cc5
BLAKE2b-256 checksum
How to use checksums
72b2f7980bd4101b934006e3229dff510d8cf025b3568cbd329a43d2d3d961e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

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

Download URL fiftyone_location-4.6.2-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94bd7023dd60ce745ea93b8f143abe45d1f9fc98d12d20900184013cad2e157a
BLAKE2b-256 checksum
How to use checksums
f08b2fd467aa22a3bce002cf45732a3631cc4f948f16b11772a6d560749a676f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for fiftyone-location 4.6.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.6.2 This release

2 release files No provenance

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