Calculations and Scripts Execution in Your Notes - Interactivity Plugin Release

Hi there!
I created the Interactivity plugin because I really missed the math and scripting functionality in my notes and thought others might benefit from it too!

Sometimes you need to compute numbers or access data while writing your notes. It’s handy to do this without leaving the Obsidian workspace, using your favorite tools like Python, Perl, Node.js, or others. For example, if you need to quickly calculate a project’s budget while taking notes, you can type the numbers and hit Enter in your Obsidian note to execute the code in the desired REPL:

## Mike's rate is $120. Thus, it will cost us:
@120*8*21*12+8000
249920

This plugin allows you to run shell commands and scripts directly within your notes, providing their output right alongside your written content, making your note-taking process more dynamic and interactive. By default, it supports running JavaScript, but you can also configure it to run any other shell commands.

Python Modules Collection:
My favorite daily tool is Python. This plugin includes several essential modules that enhance productivity while working in Obsidian.

  • chat.py Integrates ChatGPT directly into your notes.
  • tables.py Imports Excel and CSV tables into your notes.
  • plots.py Embeds matplotlib plots directly into your notes for quick visual data representation.

Here’s a demo of how they work with the plugin:
demo

Check out the GitHub repository for detailed instructions, examples, and source code.

I look forward to your feedback and suggestions. Feel free to open issues on GitHub or discuss on this thread.

3 Likes

I suggest a more descriptive name — “Interactivity” conveys nothing about the plugin. I haven’t read the description in detail, but perhaps something like “Calculations and Scripts” (from the title of your announcement post) would work.

2 Likes

Thank you for this suggestion. The plugin is now called ‘Interactivity: Calculations and Scripts’ for a better clarity.

1 Like

It’s an excellent plugin, but I have a few questions. It seems that plot.py, chat.py, and table.py aren’t functioning properly for me. I’ve noticed there are data.json, main.js, manifest.json, and styles.css files in the interactivity folder. I’ve downloaded your py_modules and py_manager.py files and added them to that folder, but it’s still not working. Could you provide some details?

– here is obsidian result
@x=[100,200,300,400]
@y=[1,2,3,4]
@print(x)
[100, 200, 300, 400]
@plot(x,y)
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘plot’ is not defined. Did you mean: ‘float’?

I’m glad that you liked the plugin! About the issue, please check that you have configured the following setting: Shell CLI Arguments

With this setting, you should place the python modules in the py_modules directory, so the path would look like this: ./your_vault/.obsidian/plugins/interactivity/py_modules/*.py.

Thanks for the reply, but I still don’t understand what to do.
What exactly should I enter in the Shell CLI Arguments?
-iq
C:\Obsidian\.obsidian\plugins\interactivity\py_modules/tables.py
C:\Obsidian\.obsidian\plugins\interactivity\py_modules/plots.py
C:\Obsidian\.obsidian\plugins\interactivity\py_modules/chats.py

Is this correct?

No worries, let me explain how it works.
I assume that you have set up Python and have all the necessary Python files in the py_modules directory and py_manager.py in the plugin’s root directory. Next, all you need to do is configure the Shell CLI Arguments setting with the value specified on the GitHub page:

-iq
##plugin##py_manager.py

The plugin will automatically replace ##plugin## with the actual path to its directory. After this, everything should work.

1 Like

Thank you so much for your kind response. the problem is resolved and everything is working well

1 Like

Agreed. Just accidently installed thinking it might interact with my tables and things written in my notes out of the box.