No description
Find a file
hihangeol 4c270a5ae4
Merge pull request #5 from Hangeol-Chang/DOCS-README
[HOTFIX] 파일 경로 오류 수정
2025-01-17 23:57:37 +09:00
docs [DOCS] 한국어 문서 1차 작성 2025-01-17 17:59:07 +09:00
src [RENAME] 카멜 케이스 적용 2025-01-14 20:09:28 +09:00
.editorconfig Initial commit 2024-12-30 20:14:21 +09:00
.eslintignore Initial commit 2024-12-30 20:14:21 +09:00
.eslintrc Initial commit 2024-12-30 20:14:21 +09:00
.gitignore [BUILD, STYLE] style 추가 2025-01-04 17:28:05 +09:00
.npmrc Initial commit 2024-12-30 20:14:21 +09:00
build.sh [TEST] 함수 이름 등록 방식 2025-01-02 00:34:18 +09:00
copy_to_obsidian.py [BUILD, STYLE] style 추가 2025-01-04 17:28:05 +09:00
esbuild.config.mjs [BUILD, STYLE] style 추가 2025-01-04 17:28:05 +09:00
main.ts [STYLE] row adding plugin 일부 수정 2025-01-14 19:37:47 +09:00
manifest.json [VERSION] fix manifest 2025-01-14 20:12:52 +09:00
package-lock.json [BUILD, STYLE] style 추가 2025-01-04 17:28:05 +09:00
package.json [BUILD, STYLE] style 추가 2025-01-04 17:28:05 +09:00
README.md [HOTFIX] 파일 경로 오류 수정 2025-01-17 23:56:27 +09:00
styles.css Initial commit 2024-12-30 20:14:21 +09:00
tsconfig.json [INIT] 2024-12-30 23:20:29 +09:00
version-bump.mjs Initial commit 2024-12-30 20:14:21 +09:00
versions.json Initial commit 2024-12-30 20:14:21 +09:00

Obsidian CSV All-in-One

A plugin for handling .csv files, including creating, editing, and saving CSV data.


Other Language Docs

  • Korean
  • Maybe add more later...

Brief Notice & Description

This plugin is designed to work in conjunction with dataviewjs. Its primary purpose is to create CSV files and add data to them.


Examples

Using Obsidian Command

Creating CSV File

  • Press Ctrl + P -> Search for 'Create CSV Table' Enter the required data as shown below and click Submit. create_csv_table

Search CSV Files

  • UI is subject to updates.
  • Press Ctrl + P -> Search for 'Open CSV Explorer'
  • Move or delete CSV files.

csv_explorer

Using dataviewjs

- View as Table

  • Source Code
const csvPlugin = app.plugins.plugins['csv-allinone'];
const fileName = "HouseKeeping/t/2025-01.csv"; 

csvPlugin.readCSV(app, fileName).then(res => {
	const headers = res.headers.map(item => item[0]);
	dv.table(headers, res.rows);
})
  • Output view_csv_table

- Add New Data (Row)

Requires the buttons plugin.

  • Source Code
const csvPlugin = app.plugins.plugins['csv-allinone'];
const { createButton } = app.plugins.plugins["buttons"];

const fileName = "HouseKeeping/t/2025-01.csv"; 

const openCsvModal = async(app, headers, f) => {
	 csvPlugin.openCsvInputModal(app, headers, f)
}

csvPlugin.readCSV(app, fileName).then(res => {
	const headers = res.headers.map(item => item[0]);
	dv.span(
	    createButton({
			app, el: this.container, 
			args: { name: "open row input Modal", class: "" },
			clickOverride: {
				click: openCsvModal, params: [app, res.headers, fileName]
			}
		})
	)
})
  • Output add_row_to_table

- Add New Column

- Delete Existing Column

Using Templater

  • I dont use Templater, so Im not familiar with it. Sorry!

Usage/Features


APIs

Handle Files

  • readCSV

    • Parameters: (app: App, fileName: string)
    • Returns: Promise<CSVTable | null>

    Reads the specified fileName and returns a CSVTable.

  • saveCSV

    • Parameters: (app: App, fileName: string, table: CSVTable)
    • Returns: void

    Saves the given CSVTable data to the specified fileName.

CSVTable (Class)

  • Functions available in the class will be documented here.

How It Works

When you create a CSV file using this plugin, two files are generated: .csv and .csv.meta.

If you load an existing CSV file, a .csv.meta file will be generated automatically.

The .csv file contains basic table data, while the .meta file stores metadata about the columns, such as their attributes. In the current version (v0.1.0), the .meta file only stores the type of each column, but future updates will include features like data/select values, validity constraints, and more.

Contributing

Any form of contribution is welcome.

License

  • MIT