Here's a workaround. A bad one. But a workaround nonetheless.
Use case: you have notes tag with a specific tag and you want the notes in that tag to be sorted by Location (i.e. notebook).
How to: Use the API to get all the notes of that tag, sort them however you want, then update their date created such that when you sort by date created in EN, they are in the desired order. Schedule that script to run every morning. Set up a shortcut or w/e to run the script at any point.
Limitations: Takes a while to run (20-ish seconds). You can't have one of the notes open while running the script.
Sample code:
# import hashlib
# import binascii
import os
from base64 import b64encode
import pandas as pd
import time
from evernote.api.client import EvernoteClient
import evernote.edam.userstore.constants as UserStoreConstants
# import evernote.edam.type.ttypes as Types
from evernote.edam.notestore.ttypes import NoteFilter, NotesMetadataResultSpec
import inspect
if not hasattr(inspect, 'getargspec'):
inspect.getargspec = inspect.getfullargspec
auth_token = "your token..."
sandbox=False
china=False
client = EvernoteClient(token=auth_token, sandbox=sandbox,china=china)
note_store = client.get_note_store()
next_tag_guid = "<tag guid here>"
filter = NoteFilter()
filter.tagGuids = [next_tag_guid]
spec = NotesMetadataResultSpec()
spec.includeTitle = True
spec.includeNotebookGuid = True
# spec.includeTagGuids = True
notes_list = note_store.findNotesMetadata(auth_token, filter, 0, 1000, spec)
notebooks_guid_name_map = {}
for notebook in note_store.listNotebooks(auth_token):
notebooks_guid_name_map[notebook.guid] = notebook.name
notebook_order = ['Notebook 1', 'Notebook 2', 'Notebook 3']
mylist = [{'note_guid': e.guid, 'notebook_guid': e.notebookGuid, 'notebook_name': notebooks_guid_name_map[e.notebookGuid]} for e in notes_list.notes]
df = pd.DataFrame(mylist)
# Check if all elements of the df column are present in the order array
if set(df['notebook_name'].unique()).issubset(set(notebook_order)):
print("All elements of the df column are present in the order array.")
else:
print("Not all elements of the df column are present in the order array.")
# Create a categorical data type with the given order
df['notebook_name'] = pd.Categorical(df['notebook_name'], categories=notebook_order, ordered=True)
df = df.sort_values('notebook_name', ascending=True).reset_index(drop=True)
for ind, row in df.iterrows():
existing_note = note_store.getNote(row['note_guid'], True, True, True, True)
new_date_created = int(round(time.time()*1000)) - (ind*24*60*60*1000)
existing_note.created = new_date_created
note_store.updateNote(existing_note)
In any case, this, among other things, is why I am considering switching to Notion...