API for the ReMarkable cloud. Based on RemarkableAPI, you can find a detailed API documentation in its wiki.
To use the API you first need to register your device:
Get a authentification code on https://my.remarkable.com/device/desktop/connect and call Remarkable.register("your code here"). This will create a token and save it as .token in your current folder (you can change this by calling Remarkable.register("code", path_to_token = "/home/my/path").
Once this is done create a client with RemarkableClient() which will by default look for a .token file in your current folder or can take directly a token string(check the docs with ?!)
From there you can :
- Access your data!
data = list_items(client)will return aCollectioncontaining all documents and sub folders. You can visualize nicely the structure by callingprint_tree(data). - Get a specific item! You can directly parse the
dataand select the item of you interest. If you know your itemIDyou can also do it viaget_item(client, ID). - Download an item! Just call
download(client, item, local_path). This will download the item as a.zipfile. If you just want the.pdf,download_pdfis also possible. - Upload a pdf! Call
upload_pdf!(client, path_to_pdf, pdf_name, parent)where parent is the folder ID or aCollection. - Delete an item! Call
delete_item!(client, item)and you can say goodbye!
Everything is done with HTTP.request, you can pass any request keyword argument to all functions (for example setting verbose=2) (only avoid query)
Here is a small script getting a list of file, downloading one, renaming it and reuploading it :
client = RemarkableClient()
items = list_items(client)
print_tree(items) |> display
#=
Root
├─ Quick sheets
├─ SVGD Integration
├─ Books
│ └─ entropy-22-01100
├─ Teaching
│ └─ PML 20/21
├─ Derivations
=#
item = items[3][1] # entropy-22...
file_path = download_pdf(client, item, pwd())
mv(file_path, "new_name.pdf")
upload_pdf!(client, "new_name.pdf", "Entropy Book.pdf", items[3]) # We reupload in the same location
delete_item!(client, item) # we delete the old item