dayonelib
dayonelib copied to clipboard
DB querying
Support for reading/exporting entries from the SQLite DB.
Need to define use cases
ls -1 ~/Library/Group\ Containers/5U8NS4GX82.dayoneapp2/Data/Documents/
DayOne-DataBuildNumber
DayOne.sqlite
DayOne.sqlite-shm
DayOne.sqlite-wal
DayOne.sqlite.dayonelock
DayOneAudios
DayOneBackup.zip
DayOnePhotos
DayOneVideos
_DataModelInsertionSentinel
html
Use case one.
def dayonelib.export_entry(id, destination, format='json')
"""
Export one entry for the specific id to a location specified by destination (path).
The format is by default JSON.
Future versions may introduce other formats such as md, html, text.
"""
pass
def dayonelib.entries(date=None)
"""
List all entries title and their defined id in the DB.
if a date is specifed, limit the list to this specific date.
"""
pass
would export the file as JSON and images (images are currently contained in a specific folder DayOnePhotos/
at the same level than sequel lite).
That would make it possible to create automation with a script. For example, at the end of the day parse all entries for today and export them as individual files. Then we can convert them in the format of our choice to publish it online in another system.
DayOne is very good for the editing UI, not so much for publishing elsewhere.