GithubHelp home page GithubHelp logo

matiascodesal / py-obsidianmd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from selimrbd/py-obsidianmd

0.0 0.0 0.0 6.38 MB

Python interface to your Obsidian notes

License: BSD 3-Clause "New" or "Revised" License

Shell 0.12% Python 96.22% Jupyter Notebook 3.66%

py-obsidianmd's Introduction

py-obsidianmd

A python library for modifying Obsidian notes in batch.

See the full documentation

โš ๏ธ Consider backing up your vault before using the library, to avoid any risk of data loss. You can test the library on this example vault

Presentation video

Watch the video

Quickstart

pip install py-obsidianmd
from pathlib import Path
from pyomd import Notes
from pyomd.metadata import MetadataType

path_dir = Path('/path/to/obsidian/folder')
notes = Notes(path_dir)

move metadata between frontmatter and inline

notes.metadata.move(fr=MetadataType.FRONTMATTER, to=MetadataType.INLINE)
notes.update_content(inline_inplace=False, inline_position="top", inline_tml="standard") #type: ignore
notes.write()

regroup inline metadata inside a callout

notes.update_content(inline_inplace=False, inline_position="top", inline_tml="callout") #type: ignore
notes.write()

add and remove metadata

notes.filter(has_meta=[("tags", "type/book", MetadataType.INLINE)])

notes.metadata.add(k="type", l="[[book]]", meta_type=MetadataType.INLINE)
notes.metadata.remove(k="tags", l="type/book", meta_type=MetadataType.INLINE)

notes.update_content(inline_inplace=False, inline_position="top", inline_tml="callout") #type: ignore
notes.write()

License

BSD 3

Contributing

Contributions are welcome ! Different ways you can contribute:

  • Write an issue: report a bug, suggest an enhancement, ...
  • Submit a pull request to solve an open issue

For more details, see the contribution guidelines.

Support

If you found this library useful and wish to support it's development, you can do so using the links below (paypal or Ko-fi). Thanks a bunch !


py-obsidianmd's People

Contributors

selimrbd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.