Coder Social home page Coder Social logo

dongjunlee / quantified-self Goto Github PK

View Code? Open in Web Editor NEW
144.0 12.0 16.0 7.46 MB

Self-knowledge through numbers

License: MIT License

Python 99.85% Dockerfile 0.15%
kino slack-bot quantified-self personal-assistant data-science machine-learning chatbot self-tracking todoist trello

quantified-self's Introduction

Quantified Self :: Kino

build status Requirements Status Codecov Code Style Codacy


Quantified Self

Quantified Self 란 개인의 일상활동에서 신체적·정신적 상태를 센싱 및 트래킹하여 이를 수치화함으로써 자신의 상태를 분석하고 삶의 질을 개선하기 위한 방법을 연구하여 실생활에 적용하는 활동을 의미합니다. Gary Wolf와 Tom Kelly에 의해 소개되었으며, 2010년 Ted Talk에서 주목을 받아, 그 이후 하나의 운동형태로 커뮤니티가 형성되어 QS 웹사이트를 통해 전개되어 왔다고 합니다. 그들의 미션은 다음과 같습니다.

To improve quality of life by generating and sharing knowledge on Quantified Self (QS)

이 저장소에서는 저 자신에 대한 다양한 데이터들을 수집하고, 분석에 사용했던 코드들과 인사이트를 공유합니다.

Blog

Data Source

현재 수집하는 데이터의 종류와 사용되는 App과 웨어러블 기기의 리스트입니다.

Record

Record는 제 자신에 대한 각종 데이터를 수집하고 분석하기 위한 용도입니다.

Data Value Description Integration Note
Happy 1점 😡, 2점 😔, 3점 🙂, 4점 😆, 5점 😍 질문을 받은 당시의 행복도 지수
Attention 1점 😩, 2점 😞, 3점 😐, 4점 🤔, 5점 👍 하나의 작업을 끝냈을 때의 집중도 지수
Sleep 시작시간, 끝시간 수면시간 데이터 Fitbit python-fitbit
Productivity RescueTime, Github, Toggl, Todoist 종합 생산성 종합 점수 아래 참고
- Task Toggl ID, 시작시간, 끝시간, 카테고리, 작업내용, 집중도 하나의 작업에 대한 데이터 Toggl, Todoist, Trello TogglPy, todoist-python, py-trello
- RescueTime 생산성 점수 Website, App 등의 Time-Tracking Tool RescueTime
- Github 주간커밋 Github의 커밋 수 Github PyGithub
Repeat Task Exercise, BAT, Diary 매일 반복하는 활동들
(운동, 공부정리, 일기)
Total Score 종합점수 Attention, Productive, Happy, Sleep, Repeat Task 를 모두 고려한 종합 점수

Log

Log는 ML 학습을 통해서 자동화를 시키기 위한 데이터 목록입니다.

Data Value Description Note
Message 시간, 명령어 텍스트 kino (Chatbot) 에게 시킨 명령어 텍스트
RSS Feed Category, Title, Pocket 저장여부 다양한 Article 에 대한 데이터
자세히 보고 싶은 글의 경우 Pocket에 저장
feedparser, pocket, python-twitter

Components

크게 다음과 같은 4가지 컴포넌트로 구성이 되어있습니다.

  • Chatbot (kino-bot)

  • Scheduler

  • Webhook

  • Dashboard

Chatbot (kino-bot)

  • Slack을 기반으로 구현

  • 다국어 지원 : Korean, English 템플릿 기반

  • Integrate with Giphy : 정해진 템플릿 이외의 재미를 줄 수 있도록

  • Skill : 직접 구현하여 스킬을 등록하고 Trigger를 설정할 수 있습니다.

Register Skills

현재는 총 27 개의 Skill이 구현되어 있습니다.

  • 🏭 air_quality : Air quality forecast. (can use only Korea airkoreaPy)
  • ✍️ attention_question : Attention survey after do task.
  • ✍️ attention_report : Attention Report.
  • 🚍 bus_stop : Bus arrival information. (can use only Korea (gbus api))
  • 🌞 forecast : Weather forecast. (using darksky)
  • :octocat: github_commit : Check Github push count.
  • 😄 happy_question : Happiness survey.
  • 😄 happy_report : Happiness Report.
  • 🍯 honeyjam : Easter Egg - Korea Azae Humor (using honeyjam).
  • 🏗️ jenkins_build : Build a registered project for Jenkins.
  • 📋 kanban_sync : Todoist's tasks and Kanban board's card Syncing.
  • :thinking_face: keep_idea : Keep idea in Trello board's inbox list.
  • :scales: maxim_nietzsche : Nietzsche's Maxim.
  • :thinking_face: remind_idea : Remind Trello's inbox card randomly pick.
  • 📈 rescuetime_efficiency : RescueTime Efficiency Chart
  • 🎼 samhangsi : I am thinking about the Samhangsi with the kor ballad! (using char-rnn-tensorflow)
  • 💬 send_message : Send a text message.
  • 🌆 today_briefing : Today Briefing - brief Todoist tasks
  • 🌃 today_summary : Today summary - todoist_feedback, toggl_report, rescuetime_efficiency, happy_report, attention_report, github_commit
  • 📝 todoist_feedback : Feedback from Todoist activity.
  • 📃 todoist_remain : Show todoist's remaining tasks.
  • 🔔 toggl_checker : Toggl time checker Every 30 minutes.
  • 📊 toggl_report : Toggl task Report.
  • toggl_timer : Toggl Timer.
  • 💹 total_chart : Overall chart - weekly productivity, happiness, overall score chart.
  • 💹 total_score : Overall score - Productivity (RescueTime, Github Commit, Todoist, Toggl), Mean happiness, mean attention, Exercise, Diary.
  • 🔮 translate : Language translation using Naver Papago api.

Scheduler

  • schedule 기반

  • 등록된 Skill 들을 지정한 시간에 맞춰서 동작하도록 설정 가능

    • e.g.) 1시간 마다 미세먼지 알려줘, 매일 8시에 하루 브리핑 해줘

Webhook

  • serverless 를 통해서 AWS API Gateway + Lambda 로 구현
  • IFTTT 또는 Zapier 와 같은 Automation Tool을 연동하기 위한 Webhook (Bot에게 직접 전달)

Dashboard

Daily Schedule

image

Daily Habit

image

Daily Summary

image

Weekly Task Report

image


Prerequisites

Quick Start

먼저 requirements를 설치해줍니다.

pip install -r requirements.txt

다음으로 최소한의 설정이 필요합니다. (config.yml)

bot:
  MASTER_NAME: <name>
  BOT_NAME: Kino
  LANG_CODE: en
  TRIGGER:
    - hey kino
    - 키노야
  ONLY_DIRECT: false   // text startswith Trigger or @kino, or Direct Message
  GIPHY_THRESHOLD: 85  // all responses are random pick number (1~100) to use giphy

slack:
  TOKEN: <token>
  channel:
    DEFAULT: "#general"

다음으로 아래 커맨드를 실행하면, Bot이 실행됩니다.

python main.py

Integration with ML/DL

추후에 ML/DL 을 기반으로 하는 기능들을 더 붙여서 더 똑똑하게 자동화를 시켜줄 수 있도록 만들고 싶습니다.

  • CLaF : Open-Source Clova Language Framework
    • OpenQA: DrQA is a system for reading comprehension applied to open-domain question answering. The system has to combine the challenges of document retrieval (finding the relevant documents) with that of machine comprehension of text (identifying the answers from those documents).

License

See the LICENSE file for license rights and limitations (MIT).

quantified-self's People

Contributors

codacy-badger avatar dongjunlee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quantified-self's Issues

Add feature - Alarm 등록과정

Slack의 Interactive Button 사용.

https://api.slack.com/docs/message-buttons

  1. 원하시는 시간대를 선택해주세요.
    [ XXX ] [ XXX ] [ XXX ] [ XXX ] [ XXX ]
  2. 실행할 함수를 선택 또는 입력해주세요.
    [ XXX ] [ XXX ] [ XXX ] [ XXX ]
  3. 선택하신 함수의 파라미터를 입력해주세요.
  4. 알람의 주기를 선택해주세요.
    [ XXX ] [ XXX ] [ XXX ] [ XXX ]

알람이 등록되었습니다!

Feature: NER 추가

Named Entity Recognition 을 추가해서,
좀 더 자연어를 이해해서 그에 맞는 답을 할 수 있도록.

Add feature - Function 연동

Function Manager를 구현하고, Scheduler기능과 연동.

Func-Scheduler

Function List.

  • send_message, {"text": <보낼 텍스트>}
  • do_somethind, {"param": "hoho", ...}

알람에 특정 Function 을 사용하도록 지정.

설치 중 Java 환경 변수 문제

관련 패키지 설치 중 pip install -r requirements.txt 을 진행하다가 에러가 있어 이슈에 남깁니다.

    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "C:\Users\arsen\AppData\Local\Temp\pip-build-o7lrh0uz\JPype1-py3\setup.py", line 448, in <module>
        config = WindowsJDKFinder()
      File "C:\Users\arsen\AppData\Local\Temp\pip-build-o7lrh0uz\JPype1-py3\setup.py", line 192, in __init__
        java_home = self.find_jdk_home()
      File "C:\Users\arsen\AppData\Local\Temp\pip-build-o7lrh0uz\JPype1-py3\setup.py", line 244, in find_jdk_home
        raise NoJDKError(visited_folders)
    __main__.NoJDKError: No JDK found

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\arsen\AppData\Local\Temp\pip-build-o7lrh0uz\JPype1-py3\setup.py", line 468, in <module>
        .format('\n'.join(ex.possible_homes)))
    RuntimeError: No Java/JDK could be found. I looked in the following directories:



    Please check that you have it installed.

    If you have and the destination is not in the above list, please find out where your java's home is, set your JAVA_HOME environment variable to that path and retry the installation.
    If this still fails please open a ticket or create a pull request with a fix on github: https://github.com/tcalmant/jpype/ 
---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in C:\Users\arsen\AppData\Local\Temp\pip-build-o7lrh0uz\JPype1-py3\
  • 개인적으로 저의 PC의 Java 환경변수를 적절하게 설정하지 못해 발생한 것 같다는 생각이 듭니다
  • JAVA_HOME 환경변수를 추가하고 pip install -r requirements.txt 하였지만 같은 에러 발생나네요
  • 구글링 중 비슷한 내용을 발견해서 링크 걸어둡니다 konlpy/konlpy#20

Summary score: REPEAT_TASK

Need to change standard of score.

  • REPEAT_TASK
    • each task is 20 points
      • morning (1)
      • afternoon (1)
      • evening (1)
      • anytime (2)
    • From 5 tasks to +5 points
  • Todoist - Trello Connect with Label

Channel 세분화

현재 Channel 현황

  • default

수정

  • default : 일반적인 상황 (기본값)
  • feed : 각종 Feed 모음 (블로그, 아티클 등..)
  • sns : SNS 모음 (Twitter, Facebook, Instagram 등..)
  • task : 작업 관련 (Todoist, Toggl, Kanban, Event 등..)
  • report : QS 데이터 리포트 (집중도, 행복도, 종합 점수 등..)

설치 후 실행 중 error

  • main.py를 Anaconda 가상환경에서 실행 과정에서 발생된 error message 입니다
  • error message 중 log 파일은 생성되지 않았습니다
(venv_kino) D:\MyProgramFiles\Anaconda3\workspace\kino-bot>python main.py
Traceback (most recent call last):
  File "main.py", line 6, in <module>
    kino_bot = KinoBot()
  File "D:\MyProgramFiles\Anaconda3\workspace\kino-bot\kino\bot.py", line 21, in __init__
    self.logger = Logger().get_logger()
  File "D:\MyProgramFiles\Anaconda3\workspace\kino-bot\kino\utils\logger.py", line 35, in __init__
    Logger.instance = Logger.__Logger()
  File "D:\MyProgramFiles\Anaconda3\workspace\kino-bot\kino\utils\logger.py", line 22, in __init__
    dirname + "/Kino_" + now.strftime("%Y-%m-%d %H:%M:%S") + ".log")
  File "D:\MyProgramFiles\Anaconda3\envs\venv_kino\lib\logging\__init__.py", line 1025, in __init__
    StreamHandler.__init__(self, self._open())
  File "D:\MyProgramFiles\Anaconda3\envs\venv_kino\lib\logging\__init__.py", line 1054, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
OSError: [Errno 22] Invalid argument: 'D:\\MyProgramFiles\\Anaconda3\\workspace\\kino-bot\\log\\Kino_2017-05-24 04:00:21.log'

(venv_kino) D:\MyProgramFiles\Anaconda3\workspace\kino-bot>

Dashboard and Record structure

  • : refactor record structure
    activity: {
        task: [
            {start_time: ..., end_time: ..., score: ..., }
        ],
        happy: [
            {time: ..., score: ...}
        ],
        sleep: [
            {start_time: ..., end_time: ..., level: ...}
        ],
        ...
    },
    summary: {
         attention: ,
         productivity: ,
         happy: ,
         repeat_task: ,
         diary: ,
         bat: ,
         exercise: ,
         github_count:
         total: 
    }
    
    • : happy and attention score : 1 ~ 100 -> 1 ~ 5 with reaction parse
  • Dashboard with plotly and dash

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.