Skip to main content

Fully asynchronous (unofficial) API client for Google Map's location share functionality

Project description

Google Maps location share API

A fully asynchronous API client for Google Map's location share functionality.

Install

You must install the following libraries:

  • aiohttp (asynchronous HTTP)
  • playwright (asynchronous webdriver)
  • undetected-playwright-patch (Bypass Google's bot detection)
  • pickle (session persistence)

It is recommended to install the following libraries:

  • asyncio (Running asynchronous code)

Run pip install gmaps-locationshare-api to install.

How it works

Playwright obtains a session via a manual log-in attempt by the user. The client also has the ability to persist a session between different instances by locally caching session cookies, and session refresh capabilities.

The client then uses said session to call Google's internal location share API to obtain relevant data.

Documentation

Sample usages are in main.py

class Client(persist: bool = False, persist_directory: str = None, timeout: int = 30000)

  • persist: Whether or not the session is locally cached to be used by subsequent invocation of Client in the same or a different program instance.
  • persist_directory: Cache location. Note that the cache location must be consistent for all clients that wishes to use the cached session.
  • timeout: Max allowed time to login before browser timeouts (in milliseconds)

Client.refresh_session(): Refresh session cookies to prevent stale sessions.

Client.get_data() -> [Person]: Get current location share data. Each call represent one reading at the current time, it doesn't not contain historical readings.

Relevant type definitions are in gmaps_locationshare_api/types.py

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

gmaps_locationshare_api-1.0.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

gmaps_locationshare_api-1.0.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file gmaps_locationshare_api-1.0.2.tar.gz.

File metadata

File hashes

Hashes for gmaps_locationshare_api-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f164cb8b514547f842e6033390f9889b05a4ca1caca9c93c3428be9fe4dd4564
MD5 f151d036bc0101667b5b0ee757aea61e
BLAKE2b-256 cd29a0ac14eb03207996d0a1dba532005acd77b8440509936ea63d42dd8fb72b

See more details on using hashes here.

File details

Details for the file gmaps_locationshare_api-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gmaps_locationshare_api-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 769d834c0e391c8711c72de6a4ae9fa980460444b619173c4a7dc52112ae3718
MD5 d5c7160c953732a98b31ef67bbc2c374
BLAKE2b-256 4f5d8ee3af80abd4765aa67434c112c898dfc2c2dec8a8f294ac381ff78d3bf8

See more details on using hashes here.

Supported by

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