• Stars
    star
    256
  • Rank 159,219 (Top 4 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Import data from various APIs into InfluxDB

Personal-InfluxDB

Import personal data from various APIs into InfluxDB

Configuration

Open config.py and set your API credentials and InfluxDB server configuration at the top of the file

  • RescueTime: Register for an API key at https://www.rescuetime.com/anapi/manage
  • Foursquare: Register an app at https://foursquare.com/developers/ and generate an OAuth2 access token
  • Fitbit: Register a "Personal" app at https://dev.fitbit.com/ and generate an OAuth2 access token
  • Steam: Register for an API key at https://steamcommunity.com/dev/apikey and look up your SteamID at https://steamidfinder.com/ (use the steamID64 (Dec) value)
  • Nintendo Switch: You'll need to set up mitmproxy and intercept the Nintendo Switch Parent Controls app on an iOS or Android device to grab your authentication tokens and device IDs
  • Xbox Live: Register a profile at https://www.trueachievements.com/ and link it to your Xbox account. You can get your ID number by clicking your "TrueAchievement Points" score on your profile and looking at the leaderboard URL, it will be the findgamerid parameter.
  • Google Play Games: Download your Google Play Games archive from https://takeout.google.com/ and extract it in the same folder as the script
  • Todoist: Access to the API requires a Todoist Premium subscription Create an app at https://developer.todoist.com/appconsole.html and generate a test token
  • GitHub: Create a personal access token at https://github.com/settings/tokens
  • Trakt.tv: Register for an API key at https://trakt.tv/oauth/applications and generate an OAuth2 access token, you'll also need to create an API key at https://www.themoviedb.org/settings/api to download movie / show posters
  • EDSM: Generate an API key at https://www.edsm.net/en/settings/api
  • Exist: Register an app at https://exist.io/account/apps/
  • RetroPie: Place the shell files and python script into user pi's home directory. Created or edit /opt/retropie/configs/all/runcommand-onstart.sh and append the line bash "/home/pi/influx-onstart.sh" "$@". Create or edit /opt/retropie/configs/all/runcommand-onend.sh and append the line bash "/home/pi/influx-onend.sh" "$@"
  • FsHub.io: Generate a personal access token at https://fshub.io/settings/integrations and set your pilot ID to the number in your "Personal Dashboard" URL
  • Stadia: Link your Stadia account to Exophase and then set your Exophase username and Stadia nickname
  • PSN: Link your PSN account to Exophase and then set your Exophase username and PSN nickname
  • LibreLinkUp: Open the Freestyle Libre app and choose Connected Apps from the menu, then send yourself an invite to LibreLinkUp. Install the LibreLinkUp app on your phone and accept the invitation, then set your username and password in the configuration file.

Usage

Check your Python version and make sure version 3.7 or newer is installed on your system:

$ python3 --version

Install required python3 modules:

$ pip3 install pytz influxdb requests requests-cache instaloader trakt.py publicsuffix2 logging colorlog bs4

Run each Python script from the terminal and it will insert the most recent data into InfluxDB.

Notes

  • Each script is designed to write to its own InfluxDB database. Using the same database name between scripts can lead to data being unexpectedly overwritten or deleted.
  • RescueTime provides data each hour, so scheduling the script as an hourly cron job is recommended.
  • Steam provides the recent playtime over 2 weeks, so the first set of data inserted will contain 2 weeks of time. New data going forward will be more accurate as the script will calculate the time since the last run.
  • Google Play doesn't provide total play time, only achievements and last played timestamps
  • Instagram can take a very long time to download, so by default it will only fetch the 10 most recent posts. Set MAX_POSTS to 0 to download everything.
  • Access to the Todoist API requires a premium subscription

Grafana Dashboards

The grafana folder contains json files for various example dashboards. Most dashboards require the grafana-piechart-panel plugin, and the Foursquaure panel also requires the panodata grafana-map-panel plugin:

$ grafana-cli plugins install grafana-piechart-panel
$ grafana-cli --pluginUrl grafana-cli --pluginUrl https://github.com/panodata/grafana-map-panel/releases/download/0.15.0/grafana-map-panel-0.15.0.zip plugins install grafana-map-panel plugins install grafana-map-panel

RescueTime dashboard

Grafana RescueTime Screenshot

Fitbit dashboard

Grafana Fitbit Screenshot

Gaming dashboard

Grafana Gaming Screenshot

Foursquare dashboard

Grafana Foursquare Screenshot

Instagram dashboard

Grafana Instagram Screenshot

Todoist dashboard

Grafana Todoist Screenshot

GitHub dashboard

Grafana GitHub Screenshot

Trakt.tv dashboard

Grafana Trakt.tv Screenshot

EDSM dashboard

Grafana EDSM Screenshot

Exist dashboard

Grafana Exist Screenshot

FsHub.io dashboard

Grafana FsHub.io Screenshot

License

Copyright (C) 2022 Sam Steele. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

lastfm-iphone

This repository is no longer being maintained. Please visit https://github.com/lastfm/lastfm-iphone
Objective-C
550
star
2

AndroidSyncProviderDemo

A sample project that demonstrates how to create a contacts sync provider for Android
Java
69
star
3

DreamZZT

An implementation of the ZZT engine for SEGA Dreamcast, Windows, MS-DOS, Mac, and Nintendo DS
C
40
star
4

srm-to-sav

Convert RetroArch SRM files to raw GBA SAV files and vice versa
Python
18
star
5

AudioClassifier-MQTT

Use the yamnet TensorFlow model to classify live audio from a microphone and publish the predicted results to Home Assistant via MQTT
Python
17
star
6

ha-medisafe

View your medication from Medisafe Cloud in Home Assistant
Python
15
star
7

m5stickc-aerogarden

Monitor the status of an AeroGarden in Home Assistant using a M5StickC-Plus microcontroller and ESPHome
9
star
8

GardenMonitor

Android and Arduino-powered garden monitor
Java
8
star
9

wear-imessage

Push iMessage notifications from Mac OS X to Android Wear
Java
7
star
10

FrotzDC

Interactive fiction interpreter for the SEGA Dreamcast
C
7
star
11

SmartThings

Various projects for Samsung SmartThings home automation system
Groovy
6
star
12

6502snake

A snake game for 6502-based computers that support the cc65 compiler
C
6
star
13

Snake3DS

Snake Game for Nintendo 3DS
Makefile
6
star
14

DCBlap

A 3D pong game for the SEGA Dreamcast
C#
4
star
15

boxee-xPL

an xPL interface for Boxee and XBMC
Python
4
star
16

DCSquares

collect the green squares and avoid the red ones! A game for SEGA Dreamcast, Windows, Mac OS, Android, and Nintendo 3DS
C
4
star
17

IRCCloud-Textual

A plugin for Textual that can connect to IRCCloud
Objective-C
4
star
18

SparkCoreBike

A cycle computer for Spark Core microcontroller
PHP
4
star
19

WhatTheFuckShouldBrianEatForLunchDotCom

PHP
3
star
20

fitbit-librelinkup

Display latest glucose reading from Freestyle LibreLinkUp on a Fitbit OS 5.0 device
TypeScript
3
star
21

PicoSquares

A PICO-8 conversion of DCSquares
Lua
2
star
22

month-in-review

WordPress plugin to automatically generate monthly reports using data exported from InfluxDB
PHP
2
star
23

Todoist-Google-Keep-Shopping-List

Automatically move your Google Assistant shopping list tasks to Todoist
Python
2
star
24

mh-data-sam

my customized MisterHouse code directory
Perl
2
star
25

HS-EventGhostServer

An EventGhost-compatible HTTP server for HammerSpoon
Lua
2
star
26

Todoist-Rescheduler

Automatically reschedule overdue recurring tasks in Todoist
Python
1
star
27

Calories

Log foods to Jawbone Up from Android Wear
Java
1
star
28

PebbleCanvasCalendarPlugin

A calendar plugin for Pebble Canvas
Java
1
star
29

exist-tag-mood-score

Calculate a mood score based on the percentage of positive and negative tags in Exist
JavaScript
1
star
30

wp-instagram-import

Import Instagram posts into WordPress
Python
1
star
31

DexcomShareDashclock

Display current glucose reading from Dexcom Share on Dashclock and Android Wear
Java
1
star
32

ati-status-mqtt

Publish Acronis True Image for Mac backup status notifications to Home Assistant via MQTT
Python
1
star