CSV-backed data table idea

This would also support orthogonality with other tools, i.e. users can use the entire ecosystem of text-manipulation and csv-manipulation tools to work with / update the csv files separately from Obsidian as well, without requiring the Obsidian devs to build in a lot of unnecessary API hooks. (of course allowing it to be updated from within Obsidian would be useful, I just mean it shouldn’t be expected to only be updated through Obsidian)

I watched a video last night where a user was using a Python script to update a table in a note each day with running statistics. This would be easier to manage with the Python script updating the csv and not having to think about the display format, and Obsidian simply rendering the csv as a simple table when called.

5 Likes

Seriously! Lots of bang for the buck in this feature.

I’m crossing fingers for the possibility of my CAD BIM tools seamlessly updating tables in the background for the PDF reports I build and generate with Obsidian, without any additional scripting.

2 Likes

I would love to cee CSV become a second type of note within Obsidian. I use Excel a lot for keeping track of data and ideas and collections. None of this required formulas, just big tables and a bit of formatting. Being able to move all of that into Obsidian would be incredible.

5 Likes

Another reason why this could become phenomenally powerful is it can enable the creation of an entire ecosystem of capabilities around Obsidian as the platform.

Obsidian honestly has the potential to become the 21st century version of emacs when it comes to note taking (not programming) and just look at how insanely powerful emacs is.

Like emacs, Obsidian:

  • works with plain text files
  • has a simple plugin architecture
  • can be easily extended using a relatively easy to learn language

And by being written in JS it can leverage thousands of useful packages and libraries for a nearly endless variety of capabilities and workflows.

Obsidian can become a platform not just a single application if it integrates a simple data capability by including CSVs as a supported data structure.

Obsidian doesn’t need to provide a CSV editor or fancy query access (though queries could come later) but simply supporting the display of CSVs for now could unlock significant capability because we could use any of the thousands of other tools to update/manipulate the CSV.

Personally I’m already starting to use Obsidian as a pseudo dashboard in some ways for my daily tasks/etc and can only imagine the capabilities this type of feature could open up.

3 Likes

Just to update everyone here, I have done some work towards building a CSV viewer/editor plugin. Like @davecan mentioned above:

Which means I have access to a bunch of existing javascript datagrid implementations that already exist with features like filtering and sorting.

I’ve hit some hurdles with the datagrid I was using not working properly inside Obsidian, but I’m hopeful I can either fix these or otherwise drop in a different library with similar capabilities.

9 Likes

Plug: Along with that please see

1 Like

Awesome, thanks @death.au! I’m definitely interested in the evolution of this capability.

4 Likes

Another example use case: Habit tracking and summaries by sections from daily entries on Obsidian (code) : ObsidianMD

Script author is manually building markdown tables.

There is a CLI tool called csvquery which supports a full range of operations, but does introduce external dependencies.

I wonder how difficult it would be to develop a simple lightweight projection-only DSL for use in ```query``` blocks.

Perhaps similar to LINQ syntax:

```csv
from(path...) 
where(
    colA in(
        date(yesterday), date(today)
    )
)
select(colA, colC:newname) 
```

Would need:

  • tokenizer that can recognize parens
  • parser to convert the tokens into semantics
  • execution engine converting the projection into Node.js calls against the CSV
2 Likes

There is a very promising plugin which aims to implement CSV support, too.

1 Like

By the way – I wrote a plugin for scratching a similar itch a while back: GitHub - coddingtonbear/obsidian-csv-table: Have a CSV file you want to render some or all of the data from? This plugin allows you to display that data in your obsidian preview.

6 Likes

This is so great! Thanks @coddingtonbear !

I couldn’t get it to work at first so I’ll offer a couple use notes for other users that can’t get it to work.

  1. The source file name has to be in double quotes regardless of whether or not there are spaces in the file name, like source: "my_csv_file.csv"
    The README demonstrates no quotes, source: my_csv_file.csv
    but in practice, that doesn’t work.
  2. The plugin does not read from the same directory as the current .md that is calling the csv. This plugin reads from your vault’s root directory. That surprised me. I would have expected the standard for relative file referencing, using ../ to move up a directory, and ./ to point to the vault (root) directory.
  3. Also, if you want to keep your CSV in the same directory as the .md file that’s calling it, then you must build out the address with forward slashes
    source: "/Documentation/my_csv_file.csv"
    not the backwards slashes that are default for a windows system.
    source: "\Documentation\my_csv_file.csv"

I’m using Windows 10

The interactivity @death.au has integrated is amazing. If you ever fiddle with this code again, please give us a way to embed the csv table in our .md files when in preview mode.

I still believe that this feature is so powerful that it should be a core feature in Obsidian.

Until that happens, it would be amazing if @death.au and @coddingtonbear could somehow join forces and get death.au’s dynamic features into coddingtonbear’s .md preview mode integration.

4 Likes

Hi all, this thread has been quiet for a long time. I have a project that would use Obsidian for linking and making sense of data about companies (currently all in a CRM). The data can (will be) exported to .csv

I’m looking for an easy (no programming required) way to have every record be a note in Obsidian and then add tags based on what some fields contain (e.g., member of another group?)

Any help greatly appreciated!

1 Like

+1 This would be amazing.
For me, just to embed a csv. file, preview it and ability to indendt/outdent would be amazing. Tables are such a great way to display things.

1 Like

Is it possible to convert the csv into native Obsidian notes and links?

1 Like

This plugin is really useful. Thanks for sharing it!

Is there any chance that you will update it to do any kind of markdown handling? For example, linking to another file. In a basic table I have things like [[someFile]] in many areas. When included via the .csv file, that renders exactly as shown above, rather than creating a link to someFile.

I’m trying to move this table to a .csv file so I can manage it with LibreOffice. The ability to include the file as a .csv is really, really, handy. However, if I lose the ability to link to other files within the table, then the table itself will lose most of the purpose of existing in the first place.

Perhaps this functionality already exists, and I’m just missing it?

When created directly in a table:

When imported via a .csv file using your (lovely) plugin:

So for me rendering a csv works using dataview, however sadly with this I csnnot edit the csv and also both the graph and excalibrain dont visualize the connections to other pages that are marked with [[brackets]] in the original csv document (i added them through libre office)

1 Like

Unfortunately, deathau’s plugin ceased to work (after 11k and counting downloads!!) On newer versions of Obsidian (v1.2+) and no other plugin offers exactly same features, like to translate csv contents without the need to create extra files with pseudo embeds - on top his plugin allows to edit csv as well, just amazing what deathau’s plugin does. Exactly how csv files should be handled by Obsidian.

…I just can’t understand why Obsidian doesn’t support csv files out of the box as csv files are interlinked with tables and are tables, just comma or tab delimited entries.
Would somebody be so kind to fork and update deathau’s original plugin, please?

2 Likes

Here’s a general outline of how you might approach developing such a plugin:

  1. Plugin Initialization:
    a. Set up the plugin framework for Obsidian.
    b. Define a function to detect and parse CSV file embeds.

  2. CSV Rendering:
    a. Use a library or build a parser to read CSV data from the embedded file.
    b. Generate HTML markup for rendering the CSV data as a table.
    c. Allow customization for rendering options (e.g., headers, formatting).

  3. Markdown Parsing:
    a. Utilize Obsidian’s Markdown parser to process cell contents.
    b. Handle internal links, formatting, and other embedded content within cells.

  4. Table Editor:
    a. Implement a table editor interface for users to edit CSV files.
    b. Enable users to add, remove, and modify rows and columns.
    c. Consider adding basic spreadsheet-like formulas and cell references.

  5. Formula Calculation:
    a. Implement a formula engine to handle spreadsheet-like formulas and use b2b data enrichment tools.
    b. Define syntax for formulas and handle dependencies.
    c. Recalculate formulas on demand or during rendering.

  6. User Interface:
    a. Design a user-friendly interface for embedding CSV files and editing tables.
    b. Consider integrating the table editor into the Obsidian workspace.

  7. Testing:
    a. Test the plugin with various CSV files and scenarios to ensure robustness.
    b. Gather user feedback to identify improvements and additional features.

  8. Documentation:
    a. Provide clear documentation on how to use the plugin.
    b. Include examples, customization options, and troubleshooting information.

  9. Community Engagement:
    a. Engage with the Obsidian community to gather feedback.
    b. Consider open-sourcing the plugin to allow for contributions.

  10. Updates and Maintenance:
    a. Stay informed about Obsidian updates and adapt the plugin accordingly.
    b. Address bug reports and enhance features based on user feedback.