location: add all.py, using takeout/gpslogger/ip (#237)

* location: add all.py, using takeout/gpslogger/ip, update docs
This commit is contained in:
seanbreckenridge 2022-04-26 13:11:35 -07:00 committed by GitHub
parent 66a00c6ada
commit 2cb836181b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 488 additions and 46 deletions

29
my/ip/all.py Normal file
View file

@ -0,0 +1,29 @@
"""
An example all.py stub module that provides ip data
To use this, you'd add IP providers that yield IPs to the 'ips' function
For an example of how this could be used, see https://github.com/seanbreckenridge/HPI/tree/master/my/ip
"""
REQUIRES = ["git+https://github.com/seanbreckenridge/ipgeocache"]
from typing import Iterator
from my.core.common import Stats, warn_if_empty
from .common import IP
@warn_if_empty
def ips() -> Iterator[IP]:
yield from ()
def stats() -> Stats:
from my.core import stat
return {
**stat(ips),
}