{"id":13626458,"url":"https://github.com/coddingtonbear/obsidian-csv-table","last_synced_at":"2025-04-15T11:51:13.228Z","repository":{"id":55061785,"uuid":"370215976","full_name":"coddingtonbear/obsidian-csv-table","owner":"coddingtonbear","description":"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.","archived":false,"fork":false,"pushed_at":"2021-11-29T13:41:59.000Z","size":1426,"stargazers_count":116,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-19T12:37:59.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coddingtonbear.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-24T03:26:41.000Z","updated_at":"2024-10-15T21:03:27.000Z","dependencies_parsed_at":"2022-08-14T10:40:28.992Z","dependency_job_id":null,"html_url":"https://github.com/coddingtonbear/obsidian-csv-table","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coddingtonbear%2Fobsidian-csv-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coddingtonbear%2Fobsidian-csv-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coddingtonbear%2Fobsidian-csv-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coddingtonbear%2Fobsidian-csv-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coddingtonbear","download_url":"https://codeload.github.com/coddingtonbear/obsidian-csv-table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249067182,"owners_count":21207392,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:02:19.463Z","updated_at":"2025-04-15T11:51:13.208Z","avatar_url":"https://github.com/coddingtonbear.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"## Obsidian CSV Table\r\n\r\nHave data in a CSV file that you'd like to render as a table in Obsidian? Now you can.\r\n\r\n## Quickstart\r\n\r\nImagine you have the following CSV file named `countries.csv`:\r\n\r\n```\r\nname,capitol,population\r\nUnited States of America,\"Washington, DC\",328200000\r\nColombia,Bogota,50340000\r\nRussia,Moscow,144400000\r\n```\r\n\r\nThe following code block:\r\n\r\n~~~\r\n```csvtable\r\nsource: countries.csv\r\n```\r\n~~~\r\n\r\nwill render a table like:\r\n\r\n\u003ctable\u003e\r\n    \u003cthead\u003e\r\n        \u003ctr\u003e\r\n            \u003cth\u003ename\u003c/th\u003e\r\n            \u003cth\u003ecapitol\u003c/th\u003e\r\n            \u003cth\u003epopulation\u003c/th\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/thead\u003e\r\n    \u003ctbody\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eUnited States of America\u003c/td\u003e\r\n            \u003ctd\u003eWashington, DC\u003c/td\u003e\r\n            \u003ctd\u003e328200000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eColombia\u003c/td\u003e\r\n            \u003ctd\u003eBogota\u003c/td\u003e\r\n            \u003ctd\u003e50340000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eRussia\u003c/td\u003e\r\n            \u003ctd\u003eMoscow\u003c/td\u003e\r\n            \u003ctd\u003e144400000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/tbody\u003e\r\n\u003c/table\u003e\r\n\r\n## Options\r\n\r\n- `source`: (Required) Path (relative to your vault's root) to the csv file to render within your notes.\r\n- `csvOptions`: Options to use for decoding the referenced CSV file; see https://csv.js.org/parse/options/ for available options.\r\n- `columns`: A list of columns to render. Each item may be either the name of a field to display or an expression (see \"Expressions\" below), and can be re-named. If unspecified, all columns in the referenced CSV  will be rendered. See \"Selecting particular columns\" below for details.\r\n- `filter`: A list of filter expressions (see \"Expressions\" below) or a single filter expression to use for limiting which rows of the referenced CSV will be displayed. If unspecified, all rows of the referenced CSV will be rendered taking into account the value specified for `maxRows` below. See \"Filtering displayed rows\" for details.\r\n- `sortBy`: A list of sort expressions (see \"Expressions\" below) or a single sort expression to use for sorting the displayed rows.  If unspecified, rows will be displayed in the order they appear in the referenced CSV.  See \"Sorting Rows\" for details.\r\n- `columnVariables`: A mapping of variable name to column name allowing you to set a name for use in `filter` or `columns` above to reference the value of a field that is not a valid variable name.\r\n- `maxRows`: The maximum number of rows to display. If unspecified, all unfiltered rows of the referenced CSV will be displayed.\r\n\r\n### Expressions\r\n\r\nThis library uses `filtrex` for expression evaluation; see their documentation to see more information about the expression syntax and what functions are available: https://github.com/m93a/filtrex#expressions.\r\n\r\nSee \"Filtering displayed rows\" for an example of a filter expression in action, but realistically they work exactly as you'd probably expect.\r\n\r\n### Selecting particular columns\r\n\r\nYou can use the `columns` field to control which columns of your CSV file to render, e.g:\r\n\r\n~~~\r\n```csvtable\r\ncolumns:\r\n- name\r\n- population\r\nsource: my_csv_file.csv\r\n```\r\n~~~\r\n\r\n\u003ctable\u003e\r\n    \u003cthead\u003e\r\n        \u003ctr\u003e\r\n            \u003cth\u003ename\u003c/th\u003e\r\n            \u003cth\u003epopulation\u003c/th\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/thead\u003e\r\n    \u003ctbody\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eUnited States of America\u003c/td\u003e\r\n            \u003ctd\u003e328200000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eColombia\u003c/td\u003e\r\n            \u003ctd\u003e50340000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eRussia\u003c/td\u003e\r\n            \u003ctd\u003e144400000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/tbody\u003e\r\n\u003c/table\u003e\r\n\r\nIt's also possible for you to set better names for your columns or use expressions:\r\n\r\n~~~\r\n```csvtable\r\ncolumns:\r\n- expression: name\r\n  name: Country Name\r\n- expression: population  / 1000000\r\n  name: Population (Millions)\r\nsource: my_csv_file.csv\r\n```\r\n~~~\r\n\r\n\u003ctable\u003e\r\n    \u003cthead\u003e\r\n        \u003ctr\u003e\r\n            \u003cth\u003eCountry Name\u003c/th\u003e\r\n            \u003cth\u003ePopulation (Millions)\u003c/th\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/thead\u003e\r\n    \u003ctbody\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eUnited States of America\u003c/td\u003e\r\n            \u003ctd\u003e328.2\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eColombia\u003c/td\u003e\r\n            \u003ctd\u003e50.34\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eRussia\u003c/td\u003e\r\n            \u003ctd\u003e144.4\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/tbody\u003e\r\n\u003c/table\u003e\r\n\r\n### Filtering displayed rows\r\n\r\nMaybe you would like to display only a subset of the rows of your CSV?  If so, you can provide a `filter` expression to limit which rows are shown:\r\n\r\n~~~\r\n```csvtable\r\nsource: my_csv_file.csv\r\nfilter: population \u003c 100000000\r\n```\r\n~~~\r\n\r\n\u003ctable\u003e\r\n    \u003cthead\u003e\r\n        \u003ctr\u003e\r\n            \u003cth\u003ename\u003c/th\u003e\r\n            \u003cth\u003epopulation\u003c/th\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/thead\u003e\r\n    \u003ctbody\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eColombia\u003c/td\u003e\r\n            \u003ctd\u003e50340000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/tbody\u003e\r\n\u003c/table\u003e\r\n\r\nBy default, the parser will attempt to cast the values of each field to an integer, boolean, or date object where appropriate for use in your filter expressions.  Also, note that your filter expression can also be provided as a list; those expressions will be and-ed together, e.g.:\r\n\r\n~~~\r\n```csvtable\r\nsource: my_csv_file.csv\r\nfilter:\r\n- population \u003c 100000000\r\n- name == \"Colombia\"\r\n```\r\n~~~\r\n\r\nNote that the filtering language requires that you use double-quoted strings in comparisons -- if you had entered `name == 'Colombia'` above, the filter would not have returned results.\r\n\r\n### Sorting Rows\r\n\r\nIf you would like to sort the rows of your displayed CSV, you can provide a sort expression:\r\n\r\n~~~\r\n```csvtable\r\nsource: my_csv_file.csv\r\nsortBy: name\r\n```\r\n~~~\r\n\r\n\u003ctable\u003e\r\n    \u003cthead\u003e\r\n        \u003ctr\u003e\r\n            \u003cth\u003ename\u003c/th\u003e\r\n            \u003cth\u003epopulation\u003c/th\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/thead\u003e\r\n    \u003ctbody\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eColombia\u003c/td\u003e\r\n            \u003ctd\u003e50340000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eRussia\u003c/td\u003e\r\n            \u003ctd\u003e144400000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eUnited States of America\u003c/td\u003e\r\n            \u003ctd\u003e328200000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/tbody\u003e\r\n\u003c/table\u003e\r\n\r\nAdditionally, you can specify your `sortBy` expression as a list; the document will be sorted by all specified fields in rank order:\r\n\r\n~~~\r\n```csvtable\r\nsource: my_csv_file.csv\r\nsortBy:\r\n- columnOne\r\n- columnTwo\r\n```\r\n~~~\r\n\r\nIt's also possible for you to sort your displayed data in reverse order if you specify your `sortBy` expression using an extended format allowing you to specify both the expression and direction of sort:\r\n\r\n~~~\r\n```csvtable\r\nsource: my_csv_file.csv\r\nsortBy:\r\n- expression: name\r\n  reversed: true\r\n```\r\n~~~\r\n\r\n\u003ctable\u003e\r\n    \u003cthead\u003e\r\n        \u003ctr\u003e\r\n            \u003cth\u003ename\u003c/th\u003e\r\n            \u003cth\u003epopulation\u003c/th\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/thead\u003e\r\n    \u003ctbody\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eUnited States of America\u003c/td\u003e\r\n            \u003ctd\u003e328200000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eRussia\u003c/td\u003e\r\n            \u003ctd\u003e144400000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n        \u003ctr\u003e\r\n            \u003ctd\u003eColombia\u003c/td\u003e\r\n            \u003ctd\u003e50340000\u003c/td\u003e\r\n        \u003c/tr\u003e\r\n    \u003c/tbody\u003e\r\n\u003c/table\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoddingtonbear%2Fobsidian-csv-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoddingtonbear%2Fobsidian-csv-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoddingtonbear%2Fobsidian-csv-table/lists"}