Git Product home page Git Product logo

keep-to-markdown's Introduction

keep-to-markdown

A script to convert Google Keep notes into markdown files, for Linux, Mac, and Windows.

Requirements

Example

> python keep-to-markdown.py -i Takeout/Keep/

arguments:
  -i PATH       Relative path to the Google Keep data folder

optional arguments:
  -h, --help    Show this help message and exit
  -t            Use subfolders for tags instead of YAML front-matter

The script outputs to a notes directory. Images will be stored in notes/resources.

If the -t flag is included, the first tag (if present) of each note will be used to create a subfolder. (e.g. notes/code_snippets and notes/code_snippets/resources)

Other data is extracted and written as YAML front-matter:

  • title
  • tags (if the -t flag isn't specified)
  • text content
  • task list
  • web links
  • images

Example

Example of a converted markdown note:

---
title: <Title>
date: <Date> (optional, if title is set)
tags: <tag1>;<tag2>;
---

<textContent>
Example Text ...

<listContent>
*Tasklist*:
- [ ] task1
- [x] task2

<annotations>
*Weblinks:* [link1](http//..); [link2](http://..);

<attachments>
*Attachments:* ![image](resource/image.jpg)

A note's title will be used for its filename. If there is no title available the created timestamp will be used.

Future features

  • OS compatible
  • support folder tags for Nextcloud
  • save modified Timestamp by default
  • use Google keep colors
  • usability for Joplin import

keep-to-markdown's People

Contributors

erikelisath avatar ikesau avatar jmcastagnetto avatar tomglynch 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

Watchers

 avatar  avatar

keep-to-markdown's Issues

Error if title contains path separator

Under windows, If note title contains / it will result in an error. BTW I suppose also : and + are forbidden character for Windows filenames

Example of offending file

{
    "color": "DEFAULT",
    "isTrashed": false,
    "isPinned": false,
    "isArchived": false,
    "textContent": "toto pipo",
    "title": "1: 12/3/24 ",
    "userEditedTimestampUsec": 1548706696486000,
    "createdTimestampUsec": 1548706676397000
}

Error

Traceback (most recent call last):
  File "/c/MyData/temp/keep to md/keep-to-markdown.py", line 194, in <module>
    read_write_notes(args)
  File "/c/MyData/temp/keep to md/keep-to-markdown.py", line 143, in read_write_notes
    with open(f'{notespath}{filename}.md', 'w', encoding='utf-8') as mdfile:
FileNotFoundError: [Errno 2] No such file or directory: 'notes/1: 12/3/24 .md'

Photos / Pictures are not displayed after conversion in Nextcloud Android App and Nextcloud Notes Android App

Hi Erik,

very much thanks for your script to convert HTML to MD and even adding the attached photos worked for me
They are displayed in the Nextcloud Web App in e.g. Brave Browser
allow me just a question, I am not requesting you to fix anything

Did you manage to use an Android App for watching Notes with Attachments?
The Nextcloud Android App and the Nextcloud Notes Android App cannot follow the link ressources/.... for the image tag in MD.

Thank you for your inspiriation and time.

[Bug] Notes with an identical name get overwritten

After the conversion I noticed I was missing around 115 notes and it seems like notes with an identical name get overwritten, google keep takeout names the files as XXXX, XXXX (1) and XXXX (2), so I think this would be solved if your script uses the file name rather than the title from the json, would it be possible to change this?

Edit: The file with the largest number is the final "surviving" one

Output names need sanitization

Get the error when it tries to convert, which to me indicates the colons need sanitized out

Traceback (most recent call last):
File "C:\Users\redacted\Desktop\takeout-20210501T112904Z-001\keep-to-markdown.py", line 137, in
read_write_notes(sys.argv[1])
File "C:\Users\redacted\Desktop\takeout-20210501T112904Z-001\keep-to-markdown.py", line 88, in read_write_notes
with open(f'notes/{title}.md', 'w') as mdfile:
OSError: [Errno 22] Invalid argument: 'notes/2021-05-01 12:52:19 edited.md'

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.