Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB querying #2

Open
underscorephil opened this issue Mar 11, 2016 · 1 comment
Open

DB querying #2

underscorephil opened this issue Mar 11, 2016 · 1 comment

Comments

@underscorephil
Copy link
Owner

Support for reading/exporting entries from the SQLite DB.

Need to define use cases

@karlcow
Copy link

karlcow commented Nov 21, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants