All Projects → danymat → Obsidian-Markdown-Parser

danymat / Obsidian-Markdown-Parser

Licence: MIT License
This repository will give you tools to parse and fetch useful informations of your notes in your Obsidian vault.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Obsidian-Markdown-Parser

obsidian-publish-mkdocs
A Template to Publish Obsidian/Foam Notes on Github Pages (uses MkDocs)
Stars: ✭ 219 (+584.38%)
Mutual labels:  vault, obsidian, obsidian-md, obsidian-vault
keep-it-markdown
Convert Google Keep notes dynamically to markdown for Obsidian and Notion using the unofficial Keep API
Stars: ✭ 125 (+290.63%)
Mutual labels:  obsidian, zettelkasten, obsidian-md
obyde
A minimal tool to convert a "standardly" configured Obsidian vault to a Jekyll or Hugo blog.
Stars: ✭ 38 (+18.75%)
Mutual labels:  obsidian, obsidian-md, obsidian-vault
life-disciplines-projects
Life-Disciplines-Projects (LDP) is a life-management framework built within Obsidian. Feel free to transform it for your own personal needs.
Stars: ✭ 130 (+306.25%)
Mutual labels:  obsidian, obsidian-md, obsidian-vault
cryptorious
CLI Password Manager
Stars: ✭ 15 (-53.12%)
Mutual labels:  yaml, vault
obsidian-pangu
为 Obsidian 笔记加上「盘古之白」,排版强迫症者的福音。 | A small plugin aims to add space between Chinese Characters and English Alphabet, and it is a boon for typographically compulsive people.
Stars: ✭ 40 (+25%)
Mutual labels:  obsidian, obsidian-md
obsidian-core-search-assistant-plugin
An Obsidian plugin to enhance built-in search: keyboard interface, card preview, bigger preview
Stars: ✭ 59 (+84.38%)
Mutual labels:  obsidian, obsidian-md
obsidian-url-into-selection
Paste URLs into selected text "notion style"
Stars: ✭ 129 (+303.13%)
Mutual labels:  obsidian, obsidian-md
obsidian-spaced-repetition
Fight the forgetting curve by reviewing flashcards & entire notes on Obsidian.md
Stars: ✭ 667 (+1984.38%)
Mutual labels:  obsidian, obsidian-md
obsidian-embedded-note-titles
No description or website provided.
Stars: ✭ 50 (+56.25%)
Mutual labels:  obsidian, obsidian-md
zotero-obsidian-citations
Zotero plugin that links your Markdown database to Zotero. Jump directly from Zotero Items to connected Markdown files. Automatically tags Zotero Items so you can easily see which papers you've made notes for.
Stars: ✭ 129 (+303.13%)
Mutual labels:  obsidian, obsidian-md
obsidian-search-on-internet
Add context menu items in Obsidian to search the internet.
Stars: ✭ 79 (+146.88%)
Mutual labels:  obsidian, obsidian-md
obsidian-query2table
Represent files returned by a query as a table of their YAML frontmatter (for obsidian.md)
Stars: ✭ 24 (-25%)
Mutual labels:  obsidian, obsidian-md
obsidian-metatemplates
Take advantage of YAML front-matter in generating notes from templates (for obsidian.md)
Stars: ✭ 68 (+112.5%)
Mutual labels:  obsidian, obsidian-md
Bubble-Space-Theme
A theme for https://obsidian.md/ inspired by Bubbles for Light Mode and Outer Space for Dark Mode!
Stars: ✭ 86 (+168.75%)
Mutual labels:  obsidian, obsidian-md
obsidian-journey-plugin
Discover the story between your notes in Obsidian
Stars: ✭ 93 (+190.63%)
Mutual labels:  vault, obsidian-md
obsidian-california-coast-theme
A minimalist obsidian theme inspired by macOS Big Sur
Stars: ✭ 421 (+1215.63%)
Mutual labels:  obsidian, obsidian-md
obsidian-advanced-appearance
Change Obsidian colors, fonts and other cosmetic settings
Stars: ✭ 35 (+9.38%)
Mutual labels:  obsidian, obsidian-md
obsidian-smart-typography
Converts quotes to curly quotes, dashes to em dashes, and periods to ellipses
Stars: ✭ 81 (+153.13%)
Mutual labels:  obsidian, obsidian-md
obsidian-convert-url-to-iframe
Plugin for Obsidian.md to convert a selected URL to an iframe.
Stars: ✭ 132 (+312.5%)
Mutual labels:  obsidian, obsidian-md

Obsidian Markdown Parser

(Github All Releases)

This repository will give you tools to parse and fetch useful informations of your notes in your Obsidian vault.

Motives

I like to do some python scripts with my vault, so this repository is the tool I needed in order to parse my Markdown files.

State of the Art

At the moment, I have implemented a basic parsing library.

Parser

Usage

from src.Parser import Parser
parser = Parser('/path/to/vault')

By default, the parser will ignore .git and .obsidian sub-directories.

If you want to specify which directories to ignore, it has to be done at instanciation.

parser = Parser('/path/to/vault', ignoredDirectories=['directory1', '.obsidian', '.git'])

Be careful, it will rewrite .git and .obsidian, so please add them back in the ignoredDirectories if you want to ignore them plus the ones you specified.

Attributes

  • mdFiles Array of MarkdownFile in vault

Methods

  • findSubFilesForFiles(files) returns a set of MarkdownFile linked with the set of MarkdownFile specified
  • searchFilesWithTag(tag) returns a set of MarkdownFile with a specified tag

YamlParser

Usage

from src.yamlParser import YamlParser, YAML_METHOD

# the file contents need to be read
file = MarkdownFile
file = self._openFile()
self.fStream = file.read()
file.close()

findYAMLTags = YamlParser(self.fStream)
# find all values for a particular key
# this will return a set with the values that have "tags" as key
values = findYAMLTags.findAllYAML(YAML_METHOD.FIND_VALUE, "tags")


yamlIterator = YamlParser(self.fStream)
# return all keys and values as a dictionary with the key as string and its values as set
print(yamlIterator.findAllYAML(YAML_METHOD.ITERATE))

Methods

  • .findAllYAML() with the parameters YAML_METHOD.FIND_VALUE and "{key}" with {key} as the YAML key returns the associated values as a set
  • .findAllYAML() with the parameter YAML_METHOD.ITERATE will return all key-value pairs in YAML as a dictionary with the key as a string and its associated values as a set

Currently, the YAML parser is limited (see the comments for details).

MarkdownFile

Attributes

  • fileName file name (string) of the current markdown file, with .md extension (e.g 'file.md')
  • path relative path (string) of the current markdown file (e.g 'testVault/file.md')
  • tags set of tags in current file (e.g {'tag2', 'tag3'})
  • links set of links in markdown files (e.g {'file2'})

Examples

parser = Parser('test/testVault')
  • Find all fileNames that doesn't have a tag
fileWithoutTags = [file.fileName for file in parser.mdFiles if len(file.tags) == 0]
  • Find all files that have tag1 in them
filesWithSpecificTag = [file for file in parser.mdFiles if 'tag1' in file.tags]
# OR
filesWithSpecificTag = parser.searchFilesWithTag('tag1')

Roadmap

New features I intend to add:

  • Add more tests
  • Ignore .obsidian/ folder

Contributing

If you would like to add shiny new features, or correct bugs I unfortunately added, please fork this repository, and create a pull request from it. Below is the list of all contributors for this repository, if you contributed please consider adding your name !

Contributors:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].