Coder Social home page Coder Social logo

massens / alfred-notion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevinjalbert/notion-toolbox

0.0 1.0 0.0 4.06 MB

A tailored Alfred Workflow that performs tasks using notion-py within the context of a specific Notion Template.

Home Page: https://kevinjalbert.com/integrating-notion-with-alfred/

License: MIT License

Python 100.00%

alfred-notion's Introduction

A tailored Alfred Workflow that performs tasks using notion-py within the context of a specific Notion Template as described in this blog post.

Setup

There is a bit of setup required to make this project work as intended.

  1. Have a Notion account
  2. Have Alfred 3+ with access to workflows (i.e., powerpack)
  3. Have Python 3 installed on the system
  4. Have Specific Notion Template as described in this blog post
  5. Your Notion Token
  6. URLs for Several Notion Object

Install alfred-notion

Get the workflow in Alfred

There are two options:

  1. Create a Blank Workflow and dump the contents of this repository into it.
  2. Download the Exported Workflow (from latest releases) and import it into Alfred.

In either case, you'll mostly end up with the workflow added to Alfred.

Python

There are certain Python dependencies that are required for the scripts to work correctly. You need to navigate to the workflow's directory so that you can execute pip3 install -r requirements.txt from your terminal. Alternatively, you can manually install what is defined in the ./requirements.txt.

Finding your Notion Token

The first thing you'll need to do is get your Notion Token (156 character value) from your browser's cookies. Depending on what browser you are using this process will vary slightly. The following diagram demonstrates how to find it using Chrome on MacOS.

Finding your Notion URLs

We need to identify the Notion URLs for the:

  • Tags Database
  • Wins Database
  • Tasks Database
  • Year Page

These are can be acquired by finding the correct resource in your Notion and using the Copy Link found in the context menu (i.e., right click or the left-clicking ...).

Configure Data Files

Given the information we've taken note of in the last 2 sections, we can now configure our data files.

  1. Find ./data/tags.sample.json, and rename to ./data/tags.json.
  2. Find ./data/config.sample.json, and rename to ./data/config.json.
  3. Fill the value out in ./data/config.json with the Notion Token and Notion URLs:
  {
    "NOTION_TOKEN": "your-notion-token",
    "TAGS_DATABASE_URL": "your-notion-tags-database-url",
    "TASKS_DATABASE_URL": "your-notion-tasks-database-url",
    "WINS_DATABASE_URL": "your-notion-wins-database-url",
    "YEAR_PAGE_URL": "your-notion-year-page-url"
  }

Features

Navigation

:week

This keyword will open Notion to the current week.

  • The week page needs to exist.
  • Notion will become the forefront application and will open the current week.
  • After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.

:day

This keyword will open Notion to the current day.

  • The day page needs to exist under the current week.
  • Notion will become the forefront application and will open the current day.
  • After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.

Tags

:tag

This keyword allows you to create a new tag in your tags database.

  • After the tag has been added, a secondary action will run :update), updating the locally cached data file holding our tags.
  • You will likely want to add an icon after the fact on the newly added tag.

:update

This keyword allows you to update your local tags data file with what your database has.

  • This is done so we have a local cache to speed things up.
  • After making a new tag, this is done this automatically.

Wins

:win

This keyword allows you to create a new win in your wins database.

  • You can optionally open the Notion page for this win if you cmd + enter when entering the title.
    • After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
  • After entering the win's title you will be able to add multiple tags.
    • You can finish adding tags by selecting the Done option.

Tasks

:task

This keyword allows you to create a new task in your tasks database.

  • You can optionally open the Notion page for this task if you cmd + enter when entering the title.
    • Notion will become the forefront application.
    • After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
  • After entering the task's title you will be able to add multiple tags.
    • You can finish adding tags by selecting the Done option.
  • After entering the task's tags you can select the status.

:search

This keyword allows you to search your current day's tasks, and be able to open it in Notion or change its status.

  • Uses the filters of your current day's Linked Database of tasks.
  • Searches the word boundaries of title/tags/status of a task.
  • When selecting a task it will open its Notion page.
    • Notion will become the forefront application.
    • After Notion opens, you lose the history (i.e., ability to go back) of that Notion's session. History works afterwards.
  • You can optionally select the task with cmd + enter to change its status.
    • If the status changes to Completed the Completed On attribute of the task will be updated to the current time.

Notes

:note

This keyword allows you to append a text block at the end of your current day's notes section.

alfred-notion's People

Contributors

kevinjalbert avatar

Watchers

 avatar

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.