Skip to content
jmbenedettoPublic

About

Pythonic wrapper for LogSeq APIs

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

logpyseq

Pythonic wrapper for LogSeq APIs

This package uses code from gist https://gist.github.com/ksqsf/c3f254545cd8f5e597fc67c1014da9ac

Code available at https://github.com/jmbenedetto/logpyseq.git.

Installation

To install the package, use the following command:

pip install logpyseq

Usage

  • The entire LogSeq API is available as methods of the logseq object.
  • Some complementary functions are also available as part of the logpyseq module: upsert_page_properties.

Connecting to LogSeq graph

from logpyseq import logseq, upsert_page_properties
logseq_token = "your_logseq_token"
mygraph = logseq(logseq_token, host="127.0.0.1", port="12315")

Create a new page

mygraph.Editor.createPage("APITest")

Append blocks to the page

mygraph.Editor.appendBlockInPage("APITest", "Block 1")
mygraph.Editor.appendBlockInPage("APITest", "Block 2")

Show a message

mygraph.App.showMsg("Hello!")

Upsert page properties

page_uuid = "your_page_uuid"
target_properties = {
    "property_name": "property_value",
    "property_name2": "property_value2"
    }
upsert_page_properties(mygraph, page_uuid, target_properties)

Delete a page

mygraph.Editor.deletePage("APITest")

About

Pythonic wrapper for LogSeq APIs

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages