Python wrapper which internally uses dayone-cli. Compatible with Day One 2+.
Project description
dayonewriter
Python wrapper which internally uses dayone-cli. Compatible with Day One 2++.
Make sure that it is installed dayone-cli is installed.
Day One 3 features like audio are not supported.
Installation
pip install dayonewriter
Usage
Creating an Entry with text, photo and tag
from dayonewriter import Entry, dayonewriter, markdown, helper
from datetime import datetime
entry = Entry()
# Providing datetime is compulsary
entry.date = datetime.now()
#optionals
entry.text = 'Hello'
entry.tags = ['Tag 1','Tag2']
entry.photos = ['Photo1','Photo2'] # needs to be maximum 10. If more then checkout helper.list_subset
entry.journal = 'Journal Name'
entry_id = dayonewriter(entry) #sends to dayone using cli
Entry
class
each new entry and has these attributes by default:
class Entry:
text: str = ''
tags: list = []
date: datetime = None
photos: list = []
journal: str = None
starred: bool = False
# below attributes are not tested
coordinate: list = []
timezone: list = None
Note:
date
attribute inNone
by default and needs a datetime object.- you can use [{photo}] in entry text to position photo.
helper
Helper contains only 1 method list_subset to create groups of 10 from list.
Helpful when photos are more than 10.
numbers = [1,2,3,4,5,6,7,8,9,10,11,12,13] # works with any data type
print('Without subset ', numbers)
print('With subset' ,helper.list_subset(numbers))
markdown
contains methods which make writing markdown text easier:
- bold
- bullet
- bullet_list
- number_list
- italic
- dayone_link
- photo
- header
- checklist
- online_image
- online_link
- quote
Links:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dayonewriter-1.0.tar.gz
(3.8 kB
view details)
Built Distribution
File details
Details for the file dayonewriter-1.0.tar.gz
.
File metadata
- Download URL: dayonewriter-1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6ddb535e70edc7d40a84314c3f4bd46011a7a3ad05e45291b20f2741a6b3d4a7
|
|
MD5 |
2013fe737143e9d88bcb0f5ce63e612c
|
|
BLAKE2b-256 |
f92d6ef272dd11f2038ec3a8374456b47f84e87294989f15edfee56b470bf59a
|
File details
Details for the file dayonewriter-1.0-py3-none-any.whl
.
File metadata
- Download URL: dayonewriter-1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5e8f0bc504ca415062d8249ed56a6a1bd861a2b30912f768ab1873f8dc2cdee0
|
|
MD5 |
f519ca48da38f14f4e47d65a0c10baf0
|
|
BLAKE2b-256 |
38932293bfa0533adbc54f3a7639b2efef6e0b617ee22554a05a57010515bee3
|