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 v4 Location Python

Pipeline 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)

Requirements

  • Python 2.7 or Python 3
  • The flask python library to run the web examples

Installation and Examples

From PyPI

pip install fiftyone_devicedetection

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({"resourceKey": "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:

python3 -m examples.cloud.gettingstarted

To run the web example:

Linux

Execute export FLASK_APP= with the name of the web example file, then flask run.

Windows

Execute $env:FLASK_APP = "x" with the name of the example file, then 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.0.1.tar.gz (3.8 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.0.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fiftyone_location-4.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.3

File hashes

Hashes for fiftyone_location-4.0.1.tar.gz
Algorithm Hash digest
SHA256 f31fe1eaa70ac08b7c849e2f15b2a865346c50b6600dfe8745deabf28a910aa5
MD5 89119f4bfac2d68d0a6e9f2dc6c95451
BLAKE2b-256 6e008f798a7ec7691a67728632260230049217ca662047607f932d8798855bba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fiftyone_location-4.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.3

File hashes

Hashes for fiftyone_location-4.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 794cb53268ea3af51b5a369833d4da8b87aed05ccaf00f7e0f11f1dc0a159872
MD5 daaa097c079f95e0b03f8ba2d3d8cb97
BLAKE2b-256 bc3bef3be6f261778acffc9b386e8a1d12080477617ae042b146c86756bc1ee2

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