Skip to main content

pyuule

UULE's are Google's objects for referencing locations. This Python library allows you to encode and encode UULE's!

What is a UULE anyway?

There are two forms of UULE. The first type, prefixed by a 'w+':

w+CAIQICIhTm90dGluZ2hhbSxFbmdsYW5kLFVuaXRlZCBLaW5nZG9t

can be used to direct searches to a specific location. The "canonical location" name must be drawn from Google's list of place names. A search on Google can then be done with results drawn from the area around this location with a UULE query parameter added, for e.g. the following search is scoped to results near the location of Nottingham in the UK: www.google.com/search?q=restaurants&uule=w+CAIQICIhTm90dGluZ2hhbSxFbmdsYW5kLFVuaXRlZCBLaW5nZG9t

The second type of UULE is often attached to cookies from Google, for e.g.:

a+cm9sZToxCnByb2R1Y2VyOjEyCnByb3ZlbmFuY2U6MAp0aW1lc3RhbXA6MTY4MDg3NzkwNjIzNjczNgpsYXRsbmd7CmxhdGl0dWRlX2U3OjMwMjY2NjY2MApsb25naXR1ZGVfZTc6LTk3NzMzMzMwMAp9CnJhZGl1czotMQo

These encode some metadata, but most interestingly, the radius over which to search, and the latitude and longitude of the searcher.

Usage

This library allows you to encode and decode query parameter UULE's:

>>> import pyuule

>>> pyuule.decode_w("w+CAIQICImV2VzdCBOZXcgWW9yayxOZXcgSmVyc2V5LFVuaXRlZCBTdGF0ZXM")
"Nottingham,England,United Kingdom"

>>> pyuule.encode_w("Saint-Germain-des-Pres,Ile-de-France,France")
"w+CAIQICIrU2FpbnQtR2VybWFpbi1kZXMtUHJlcyxJbGUtZGUtRnJhbmNlLEZyYW5jZQ"

and additionaly allows you to decode cookie UULEs:

>>> pyuule.decode_a("a+cm9sZToxCnByb2R1Y2VyOjEyCnByb3ZlbmFuY2U6MAp0aW1lc3RhbXA6MTY4MDg3NzkwNjIzNjczNgpsYXRsbmd7CmxhdGl0dWRlX2U3OjMwMjY2NjY2MApsb25naXR1ZGVfZTc6LTk3NzMzMzMwMAp9CnJhZGl1czotMQo")
{
    "role": 1,
    "producer": 12,
    "provenance": 0,
    "timestamp": 1680877906236736,
    "latitude": 3.0266666,
    "longitude": -9.77333300,
    "radius": -1,
:   

Acknowledgements

The following blog post was helpful in writing this library: https://valentin.app/uule.html

Metadata

Release files for pyuule 0.1.0

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

Source distribution (sdist)

Source distribution for pyuule 0.1.0
File Size Uploaded
pyuule-0.1.0.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyuule 0.1.0
File Interpreter ABI Platform
pyuule-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.1 kB

Release files / pyuule-0.1.0.tar.gz

Download URL pyuule-0.1.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9b7e9eab61bdd08e2d8ecd3f659a617ef7b5dc648df8df057f0f5897ba5084d9
BLAKE2b-256 checksum
How to use checksums
055d553db5fb5df1078aad639ca78233be515d4c9d61aafe597af1e636046536
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.0 CPython/3.11.3 Darwin/20.6.0

Release files / pyuule-0.1.0-py3-none-any.whl

Download URL pyuule-0.1.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
537bbd98aba6f65cd8c0e7873e78ab2d9312f425c2fe1a3f4f93c7d121cba003
BLAKE2b-256 checksum
How to use checksums
39b9ca83344599a3122f49e44001a452a6f0e8259d752d7da826bcf67f0ea709
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.0 CPython/3.11.3 Darwin/20.6.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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