Skip to content

A Python application that sync Github Gists and save them to Evernote notebook as screenshots.

License

Notifications You must be signed in to change notification settings

leemengtw/gist-evernote

Repository files navigation

Gist-Evernote

A Python application that sync your Github Gists and save them to your Evernote notebook as screenshots. With the app, you can search your work (Jupyter notebooks, Markdown files, Python scripts, etc) all in one place with pretty result. 😎 📓

Demo

A simple use case for search notebooks including subplot:

demo-subplots

Background

As a heavy Evernote user and a data scientist, I wondered won't it be wonderful to be able to search all my Jupyter notebooks directly inside Evernote. Thanks to the OCR technology built by Evernote, this become possible. Without further ado, try it yourself 😉

Getting Started

This project is written in Python and tested only on macOS currently. To start synchronizing your gist to Evernote, follow the instruction below to setup the application.

Prerequisites

Python 2.7

python --version
Python 2.7.14 :: Anaconda, Inc.

This is due to Evernote API's limited support of Python3, but will try to migrate in near future.

Latest version is recommended. After downloading, put the driver under path like /usr/local/bin.

Check whether the driver is in the path:

ls /usr/local/bin | grep chromedriver
chromedriver

Make sure the path where the driver locate is accessible via $PATH environment variable:

echo $PATH
... :/usr/local/bin: ...

If the path is not included in $PATH, you can add the path to $PATH temporarily:

export PATH=$PATH:/usr/local/bin

brew and dependencies

brew install portmidi pygobject pkg-config cairo gobject-introspection

path setting

Make sure to include necessary path in ~/.bash_profile:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib:/usr/local/opt/libffi/lib/pkgconfig

To grant the app to retrieve your gists, you have to give the app a access token. You can read more about the token here.

Allow following permission when creating the token:

admin:org_hook, gist, notifications, read:gpg_key, read:public_key, read:repo_hook, repo, user

After creating the token, you should save the token for later usage:

github-token

To grant the app to create/update notes to your Evernote notebooks, create a Production Token and save for later usage.

evernote-token

Installation

First clone the repo and get into the root folder:

git clone https://github.com/leemengtaiwan/gist-evernote.git
cd gist-evernote

To install all the dependencies, Conda is recommended:

conda env create -n gist-evernote -f environment.yaml
source activate gist-evernote

Or use pip instead:

pip install -r requirements.txt

Setup

Tell the app about your Github and Evernote tokens acquired [previously](#Github Personal Access Token):

python setup.py

You will be asked to provided your tokens and the name of notebook you want your gists to be sync. Alternative, you can modify the settings.py directly:

GITHUB_AUTH_TOKEN = ""
EVERNOTE_PROD_TOKEN = ""
EVERNOTE_SANDBOX_TOKEN = ""
NOTEBOOK_TO_SYNC = "gist-evernote"

Start to sync your gists

Finally, after input our credentials, now we can run the sync app:

python app.py

If anything go well, it will start to fetch your gists, take screenshots of them and save them as new notes in Evernote. Have a coffee before it finish 😎☕

To reflect modification to synced gists to Evernote, just run the app again and it will try to do its best:

python app.py

Contributing

There are still many things left to be improved. Any advice or pull request is highly appreciated. Notes that the Python Docstrings of this repo follow Numpy Style.

Authors

License

This project is licensed under the MIT License - see the LICENSE.txt for details.

Acknowledgements

Future Work

About

A Python application that sync Github Gists and save them to Evernote notebook as screenshots.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages