gpt4 book ai didi

python - 在 Evernote API 中设置 NoteFilter

转载 作者:行者123 更新时间:2023-11-28 21:22:39 25 4
gpt4 key购买 nike

我已经像这样设置了我的 Python 页面(摘录):

import evernote.edam.userstore.constants as UserStoreConstants
import evernote.edam.type.ttypes as Types
from evernote.api.client import EvernoteClient

client = EvernoteClient(token=auth_token, sandbox=False)
note_store = client.get_note_store()

问题来自这段代码:

filter = note_store.NoteFilter
filter.setOrder(NoteSortOrder.UPDATED.getValue())

然后我会继续使用 note_store.findNotesMetadata。但是,我收到错误:

AttributeError: 'module' object has no attribute 'setOrder'

我做错了什么?我试图根据给定的示例改编 here

最佳答案

这是一个工作示例:

from evernote.api.client import EvernoteClient
from evernote.edam.notestore.ttypes import NoteFilter, NotesMetadataResultSpec
from evernote.edam.type.ttypes import NoteSortOrder

auth_token = 'your-token'
client = EvernoteClient(token=auth_token)
note_store = client.get_note_store()

updated_filter = NoteFilter(order=NoteSortOrder.UPDATED)
offset = 0
max_notes = 10
result_spec = NotesMetadataResultSpec(includeTitle=True)
result_list = note_store.findNotesMetadata(auth_token, updated_filter, offset, max_notes, result_spec)

# note is an instance of NoteMetadata
# result_list is an instance of NotesMetadataList
for note in result_list.notes:
print note.title

关于python - 在 Evernote API 中设置 NoteFilter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18532862/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com