Code Monkey home page Code Monkey logo

dontforget's Introduction

Don't Forget

Don't forget to do your chores (using Gmail, Toggl and more tools to come).

To install the script:

make install

To start the app on the status bar:

dontforget

Notes

  • This app is based on rumps, it runs in the macOS status bar.
  • It only runs on macOS for now.
  • I considered using Dramatiq for background tasks, but that would need a local RabbitMQ or a Redis instance. Although Docker could be used, it would be too heavy for a local app that is meant to run on the status bar all the time. There will be not enough load to justify a distributed task queue.

dontforget's People

Contributors

andreoliwa avatar dependabot-preview[bot] avatar dependabot[bot] avatar pre-commit-ci[bot] avatar pyup-bot avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dontforget's Issues

Snooze or skip alarm, with a reason

Do this one after #47, #45 and #44.

Some snooze reasons:

  • I don't want to do it now
  • I can't do it now
  • I'm working now

Skip reasons:

  • There is no need to do this now

Reasons:

  • Create a Reason model with columns: id, title, can_snooze (bool), can_skip (bool)
  • A reason can be used on snooze, on skip, or on both; at least of the flags must be set

Telegram bot:

  • Show buttons with reasons to skip or snooze the chore
  • Accept new text as a different reason
  • Examples of reasons: busy, working, don't want to, not needed now, not in the mood

Basic repetition patterns

Main tasks:

  • Get all chores that need alarms in a single query (new and old chores)
  • If current_state is None, it's a new chore: create the first alarm: alarm.next_at = chore.alarm_start
  • Create a repetition column on the Chore model
  • Create a repeat_from_completed column on the Chore model
  • If the chore has no repetition, skip alarm creation
  • If the chore has some repetition, and current_state is not unseen nor displayed, create the next alarm as in:
    alarm.next_at: guess_repetition('Every 3 days').next_date(right_now if chore.repeat_from_completed else last_alarm)
  • Create the guess_repetition function to parse a string
  • Each repetition class should know the strings and regexes they understand. E.g.: r"every \d+ days"

Basic patterns:

  • One time only (no repetition)
  • Daily = Every 1 day
  • Weekly = Every 1 week
  • Biweekly = Every 2 weeks
  • Monthly = Every 1 month
  • Bimonthly = Every 2 months
  • Quarterly = Every 3 months
  • Semiannually = Every 6 months
  • Yearly = Every 12 months
  • Hourly = Every 1 hour
  • Every 3 days, Every 1 month, Every 2 years, Every 16 weeks, Every 1 hour, Every 15 minutes.

Plugin: integration with Gmail

Only after #13.

  • A chore can point to a Gmail label or folder (e.g.: "Inbox" or "Drafts")
  • Store user credentials in a safe way, maybe using keyring
  • If there are e-mails with this configured label, and there is no alarm yet, then create one

Trello: Sort boards, lists and cards

After #28.

From the CLI:

  • --sort
  • Open text file with all boards
  • Wait for a keypress Press ENTER after you have sorted the boards
  • Read text file and apply sorting from it

Sort order criteria:

  • ORDER BY sort_order ASC
  • Add 1 for cards with a due date
  • Add 1 for cards with a member
  • Lists: Add 1 for first, 2 for second, etc.

Multiple daily warnings

As a very forgetful and busy slave, I want to receive multiple warnings for the same bill, so I REALLY don't forget to pay it.

Example: I've payed my cell phone bill many times in delay, so I'd like to be warned 5 days earlier, every single day, until I pay it.

Create alarms for all active/open chores

  • Create Alarm model
  • Suggested fields: state (unseen, skipped, snoozed, completed, finished)... and what else?
  • This model also stores the history of every chore, every interaction
  • Search active/open chores
  • Search next alarms for these chores
  • Create next alarms for those which still don't have one
  • Adapt this to be run as a cron job

Add tags to a chore

  • Start with a simple tag system
  • Strings separated by commas, stored in a single VARCHAR column
  • Use LIKE to check for tags
  • Enforce commas in the beginning and end of the string
  • Generic methods to add one or more tags to a chore
  • Generic method to list all the tags from a chore
  • Generic method to check if one or more tags are present in a chore or not
  • Generic method to get a list of chores with one or more tags
  • Write tests to assert these generic behaviours, so we can change the underlying tag system later

Daily e-mail reminder

As a forgetful person, I want to receive a daily e-mail with all bills due on that date, so I don't forget to pay them.

Alarm adjustment

Previous or next [day type]

Only valid for monthly and yearly reccurrence.
Examples:

  • Monthly on the 20th, adjust to previous workday.
  • Yearly on the 23th of May, adjust to the first Thu before
  • Monthly on the 10th, adjust to the second weekend after
  • Monthly on the 25th, adjust to the 5th workday before

Advanced repetition patterns

Continuation of #30.

Every [number] [unit of time] on [day type]

Units of time:

  • second
  • minute
  • hour
  • day
  • week
  • month
  • year

Day types:

  • any day
  • weekday (Mon to Fri)
  • weekend day (Sat/Sun)
  • day of the week (Mon to Sun, multiple choices)
  • day of the month (1 to 31, multiple choices)

Frequencies with day type :

  • Weekly on [day type]
  • Biweekly on [day type]
  • Monthly on the Nth [day type]
  • Monthly on the last Nth [day type]

Some unit tests to check:

  • On the second monday of each month, On the last Fri of each month, On the 3 Sat of each month.
  • Every Mon, Every Tuesday and Thursday, Every Weekend, Every Weekday, Every Mon, Wed and Fri.
  • Every Month on the 3rd, 11th and 18th
  • Every 2 Months on the first/second/third/fourth/fifth/last day/weekday/week

Generate text files with lists of chores grouped by tag

After #33.

  • Read all active chores with or without alarms
  • Keep this data in a defaultdict(list) of tags (keys) and chores (values)
  • Create a text file for every tag
  • The file location should be configurable (e.g. to store in a Dropbox folder, for instance)

Plugin: integration with Trello

Related directly to #13.

Get Trello cards and save in the database

  • Import cards from Trello into chores
  • Keep the chores in sync with Trello
  • Initially, Trello changes overwrite chores (think about syncing both ways)
  • Entities and its relationships: board, list, card, label, member
  • Save: title, description, labels, due date, members, list, board


oauth2 is broken on Python 3. To fix it:

pip install --upgrade https://github.com/CentricWebEstate/python-oauth2/archive/master.zip
pip install py-trello

Complete an alarm

Basic feature to be used with cocoaDialog first.

  • Save the state completed in Alarm
  • Write a test simulating a click on the "Complete" button, to check if the state was changed

Repetition: Yearly (day X, month Y)

As a forgetful person, I want to register bills for yearly payment in a fixed (numbered) day of a fixed month, so I don't skip the payment.

Example: My vehicle tax has to be payed around February 14, every year.

Skip an alarm

Basic feature to be used with cocoaDialog first.

  • Save the state skipped in Alarm
  • spawn_alarms should accept an Alarm or a Chore instance
  • Spawn the next alarm for the chore, if a repetition exists
  • Don't show the "Skip" button if the chore has no repetition

Trello: Filter/search chores (maybe also useful for other non-Trello chores)

Most of these items might only make sense after #28.

  • Filter cards only from lists Doing and Top --list 2
  • Filter cards without label --no-label or --label 0
  • Filter cards due soon --due soon
  • Filter cards with label Skype --label skype
  • Filter unassigned cards --no-member or --member 0
  • Filter cards with more than one label --label +1
  • Filter to include/exclude organizations, boards and lists, by name and/or id
  • Save filters in the config file? (filter are saved searches)
  • Filter cards due next week --due week
  • Filter cards due next month --due month

Snooze an alarm

Basic feature to be used with cocoaDialog first.

  • Show a list of fixed snooze times (5/10/15/30 minutes, 1/2/6 hours, etc.)
  • Or maybe show an input text and accept a repetition pattern ("1 day", "2 hours", "10 minutes")
  • Accept repetition patterns without "Every " in front (improvement of #30)
  • Accept abbreviated patterns like "1d", "2h", "15m", "20min", "2mo" (improvement of #30)
  • Global timeout of 10 seconds
  • In case of timeout, reset the unseen state (or snooze for 1 minute? or accept the default item or text?)
  • Save in Alarm the chosen snooze time (original? normalised?)
  • Suggest the last snooze when displaying the new alarm

Allow one or multiple alarms for a chore

As a forgetful person, I want to receive different early warnings for different bills, a specified number of days before their due dates, so I can pay attention to those I forget more.

Example: my cable TV's due date is on day 10, I'd like to be warned by e-mail 2 days before.
But, for my vehicle tax, I'd like to be warned 5 days before, cause I regularly forget to pay this one.


[number] [day type]
Examples of "before" reminders: 1 day, 2 weekdays, 1 weekend, 1 Thursday, every 2 days, every hour, every 15 minutes

The reminders should keep going until the task is marked as done or skipped

Repetition: Monthly (day X)

As a forgetful person, I want to register bills for monthly payment in a fixed (numbered) day of the month, so I don't skip the payment.

Example: Cable TV has to be payed every day 10 of the month.

Create a simple plugin system for integration with external sources of chores

Chores could have a callback repetition, pointing to a method with a fixed name, in a Python module.

A directory plugins with one module for each integration:

  • gmail.py
  • lastfm.py
  • trello.py

Possible features:

  • Plugins can (somehow) receive parameters that would be configured in each chore.
  • An alarm will be created for a chore, if a callback function returns True, and if there are no alarms already.

Add a chore using the CLI

  • Return a list of similar chores, if some were found
  • Allow adding a chore after similar chores were found
  • Option --new to add a new chore anyway
  • How to edit and overwrite a chosen chore on the CLI?

Kill an alarm

Basic feature to be used with cocoaDialog first.

  • Maybe show an extra item in the select list, or use "kill" in the input text
  • Save the state killed in Alarm

When adding a new chore, search by similar words

  • Create Chore model with some suggested fields: id, name, description, labels, repetition, next at, created at, modified at, starts at, ends at
  • Method search_similar() to search similar chores by keywords
  • Ignore words with less than 3 characters (make it an argument)
  • Return a list of chores that were found

Display GUI desktop notifications for due chores

See #21 for mobile/other notifications.

Basic UI interface for the notification window:

  • Consider alternatives for Mac and Linux
  • On Linux, zenity can be used to show dialog boxes and get user responses
  • Find a corresponding zenity for Mac, to show popups like Reminders, but with (way) more custom buttons and options
  • cocoaDialog
  • wxWidgets/Phoenix

Some inspiration for UI:

App flow and automated tests:

  • Create some chores
  • Spawn alarms for the chores
  • Display notification windows for all unseen alarms with cron.display_unseen_alarms()
  • Change the alarm state to displayed right after displaying a window
  • Create a base class for the UI window on dontforget.ui
  • Mock this UI window on the tests
  • Assert that the UI window was called for every unseen alarm
  • Assert every alarm has the displayed state while the window is open
  • Allow modules on dontforget.ui, one for each desired UI: cocoa_dialog.py, zenity.py, etc.

Weekend due date

As a rightful tax payer, when a due date falls on weekends, I want to choose to pay before of after the weekend, so I don't pay the bill late.

Some government taxes must be payed on Fridays if the due date is on Saturday or Sunday.
Most private sector bills can be payed on Monday, if the due date is on Saturday or Sunday.

Plugin: integration with Pocket

Related directly to #13.

  • Create a chore when the number of unread articles with a certain tag is above a certain number
  • Create a chore from one specific article
  • Create a chore when you have untagged articles waiting to be tagged

Trello: ToDo Dashboard

After #28.

  • Get the favorite Trello boards
  • Get the first two lists from each board
  • Show the cards in the dashboard

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.