Skip to content

Abdur-rahmaanJ/phoning-home

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phoning-home

Phoning home provides out of the box capabilities to phone home for security, analytics, gaming and reporting with in-built consent mechanism. No server setups needed, only Turso atm.

Demo

from phoning_home import ph

# url, token
ph.connect('http://url.turso.io', 't0k3nfh734tr673gqi78rytg3q34786') # use env vars

# Increment counters
@ph.counter('ZIP_DOWNLOAD')
def download_zipfile():
    # code for downloading zip file
    ...
count = ph.fetch('counter', 'ZIP_DOWNLOAD') # [('ZIP_DOWNLOAD', 7)]

# Leaderboard
ph.leaderboard('scrabble-123', 'yus', 100)
leaderboard = ph.fetch('leaderboard', 'scrabble-123') # [('yus', 100)]

# Send a deluge of kv values 
ph.info({
    'version': '1.2.3',
    'os': 'linux'
})
info = ph.fetch('info') # [('version', '1.2.3'), ('os', 'linux')]

# Or namespace it
data = {
    'name': 'Miaw Spoogle',
    'username': 'purr678'
}
ph.namedinfo('USER_INFO', data) # [('name', 'Miaw Spoogle'), ('username', 'purr678')]
namedinfo = ph.fetch('namedinfo', 'USER_INFO')

About

Phoning home, analytics and leaderboard with 0 server setup. Powered by Turso

Topics

Resources

License

Stars

Watchers

Forks

Languages