locationsharinglib package

Submodules

locationsharinglib.locationsharinglib module

Main code for locationsharinglib.

class locationsharinglib.locationsharinglib.Cookie(domain: str, flag: bool, path: str, secure: bool, expiry: int, name: str, value: str = '', rest: ~typing.List = <factory>)[source]

Bases: object

Models a cookie.

domain: str
expiry: int
flag: bool
name: str
path: str
rest: List
secure: bool
to_dict()[source]

Returns the cookie as a dictionary.

Returns:

The dictionary with the required values of the cookie

Return type:

cookie (dict)

value: str = ''
class locationsharinglib.locationsharinglib.Person(data)[source]

Bases: object

A person sharing its location as coordinates.

property accuracy

The accuracy of the gps.

property address

The address as reported by google for the current location.

property battery_level

The battery level of the user’s device.

property charging

Whether or not the user’s device is charging.

property country_code

The location’s country code.

property datetime

A datetime representation of the location retrieval.

property full_name

The full name of the user as set in google.

property id

The internal google id of the account.

property latitude

The latitude of the person’s current location.

property longitude

The longitude of the person’s current location.

property nickname

The nickname as set in google.

property picture_url

The url of the person’s avatar.

property timestamp

The timestamp of the location retrieval.

class locationsharinglib.locationsharinglib.Service(cookies_file=None, authenticating_account='unknown@gmail.com')[source]

Bases: object

An object modeling the service to retrieve locations.

get_all_people()[source]

Retrieves all people sharing their location.

get_authenticated_person()[source]

Retrieves the person associated with this account.

get_coordinates_by_full_name(name)[source]

Retrieves a person’s coordinates by full name.

get_coordinates_by_nickname(nickname)[source]

Retrieves a person’s coordinates by nickname.

get_latitude_by_full_name(name)[source]

Retrieves a person’s latitude by name.

get_latitude_by_nickname(nickname)[source]

Retrieves a person’s latitude by nickname.

get_longitude_by_full_name(name)[source]

Retrieves a person’s longitude by name.

get_longitude_by_nickname(nickname)[source]

Retrieves a person’s longitude by nickname.

get_person_by_full_name(name)[source]

Retrieves a person by full name.

get_person_by_nickname(nickname)[source]

Retrieves a person by nickname.

get_shared_people()[source]

Retrieves all people that share their location with this account.

get_timedate_by_full_name(name)[source]

Retrieves a person’s time in unix format by name.

get_timedate_by_nickname(nickname)[source]

Retrieves a person’s time in unix format by nickname.

locationsharinglib.locationsharinglibexceptions module

Custom exception code for locationsharinglib.

exception locationsharinglib.locationsharinglibexceptions.InvalidCookieFile[source]

Bases: Exception

The cookies file provided could not be parsed for cookies.

exception locationsharinglib.locationsharinglibexceptions.InvalidCookies[source]

Bases: Exception

The cookies provided do not provide a valid session.

exception locationsharinglib.locationsharinglibexceptions.InvalidData[source]

Bases: Exception

The data received do not fit the expected format.

Module contents

locationsharinglib package.

Import all parts from locationsharinglib here