Skip to main content

A script to magically update your obsidian snippets hosted on github.

Project description

Obsidian Snippet Manager is a python script that git pull and move CSS file in your .obsidian/snippet folder.

The goal is to provide a practical way to get semi-auto-update from CSS snippet hosted on GitHub, in waiting of an eventual BRAT update that support that.

Get started

Requirements

  1. Git
  2. Python
  3. pip install Obsidian-Snippet-Manager

GUI

You can use the application with an interface, using (in terminal): snipetter. To get a .app or .exe you can :

  • Wait to my success to create a build using GitHub Actions (you can help)
  • Use pyinstaller on this repo, with pip install pyinstaller && pyinstaller Obsidian_Snippeter/GUI.py --name "Snippeter" --windowed --i Obsidian_Snippeter/src/gui_bin/hand.ico --noconfirm --add-data 'Obsidian_Snippeter/src/gui_bin/*:Obsidian_Snippeter/src/gui_bin/' --distpath app

CLI

Environment

The plugin needs :

  • The absolute path of your vault, as : G:\Drive\Vault
  • A folder that contains all the snippet you want to get the update. This folder can be everywhere on your computer (yes, it can be in .obsidian too.). It will contain all folder of the snippet hosted on GitHub you want to use.
    In case of the folder doesn't exist, the script will create it!

How to use

  1. Adding a new repo : obsnipe clone repository_url
    Additionally, you can exclude a folder from update with adding the --exclude command : obsnipe clone --excluded [repository_url]
  2. Updating everything : obsnipe
  3. Updating only a repository : obsnipe update folder_name The folder name is the folder that you wish to update the snippet!

The script will :

  • Git pull
  • Git move every .css file in your .obsidian/snippet folder.

Other function

  • obsnipe list : List all GitHub Repository you download.
  • obsnipe exclude [folder_name] : Exclude a folder from update. You can exclude multiple value using : obsnipe exclude [folder1] [folder2]

Note : You can exclude a folder from auto-update using the exclude.yml file, placed in your Snippet Manager folder. You need to add the folder name as a yaml list :

- foldername1
- foldername2

Example

Using Obsidian Snippets Collection

  1. Configuration :
    • Vault is in : G:/Drive/vault
    • My Obsidian Manager Folder is in : D:/Documents/Github/Snippets Manager
  2. obsnipe clone https://github.com/Mara-Li/Obsidian-Snippet-collection
  3. Activate the snippets 🎉

To update this specific snippet : obsnipe update Obsidian-Snippet-collection

In obsidian

You can create a command in Obsidian using Obsidian Shell.

Bonus, you can update your snippet every time obsidian start, like BRAT!

⚠️ WARNING : Every edit on a snippet downloaded by this way will break the script. Please, DON'T EDIT these file, and use another snippet. (Or, use a fork and commit before.)

Credit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Obsidian_Snippet_Manager-2.0.5.tar.gz (560.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Obsidian_Snippet_Manager-2.0.5-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file Obsidian_Snippet_Manager-2.0.5.tar.gz.

File metadata

  • Download URL: Obsidian_Snippet_Manager-2.0.5.tar.gz
  • Upload date:
  • Size: 560.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for Obsidian_Snippet_Manager-2.0.5.tar.gz
Algorithm Hash digest
SHA256 f9b2bf0857223c6f755c2ed813123981703dbb80d3addb48d0db2f0910783eb9
MD5 894def850eca6a398dded832266fa6ec
BLAKE2b-256 498f8a4a08d73a57ae9116fd5eb6e0aeb59a68e31e5b5cf42f9ab5708c9b049a

See more details on using hashes here.

File details

Details for the file Obsidian_Snippet_Manager-2.0.5-py3-none-any.whl.

File metadata

  • Download URL: Obsidian_Snippet_Manager-2.0.5-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for Obsidian_Snippet_Manager-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 822d9f2612f775eac8f466d6471dea1bc1783e0389e040ae7511c52971ecefb6
MD5 dc7fea590cd755917eb94702ede3f25b
BLAKE2b-256 373e6d15e8e8141e09722513f94f51085fab8f520a7cc46cdec87aee7c3af033

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page