pylav.utils package#
Subpackages#
Submodules#
pylav.utils.aiohttp_postgres_cache module#
- class pylav.utils.aiohttp_postgres_cache.PostgresCacheBackend(**kwargs)[source]#
Bases:
CacheBackend
Wrapper for higher-level cache operations. In most cases, the only thing you need to specify here is which storage class(es) to use
pylav.utils.localtracks module#
- class pylav.utils.localtracks.LocalTrackCache(client, root)[source]#
Bases:
object
A cache for local tracks.
- property hexdigest_to_query#
The hexdigest to query cache.
- property is_ready#
Whether the local track cache is ready.
- property path_to_query#
The path to query cache.
- property path_to_track#
The path to track cache.
- property root_folder#
The root folder of the local track cache.
pylav.utils.location module#
- async pylav.utils.location.closest(data, compare_to, *, region_pool=None)[source]#
Get the closest region to the given coordinates
- pylav.utils.location.distance(lat1, lon1, lat2, lon2)[source]#
Calculate the distance between two coordinates on the earth
- async pylav.utils.location.get_closest_discord_region(host=None)[source]#
Get the closest discord region to the given host