{"id":13484968,"url":"https://github.com/blacksmithgu/obsidian-dataview","last_synced_at":"2025-05-12T13:21:36.309Z","repository":{"id":37249302,"uuid":"329202727","full_name":"blacksmithgu/obsidian-dataview","owner":"blacksmithgu","description":"A data index and query language over Markdown files, for https://obsidian.md/.","archived":false,"fork":false,"pushed_at":"2025-04-08T10:52:19.000Z","size":3578,"stargazers_count":7798,"open_issues_count":619,"forks_count":454,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-05-12T13:21:20.654Z","etag":null,"topics":["obsidian-md","obsidian-plugin","query-language","typescript"],"latest_commit_sha":null,"homepage":"https://blacksmithgu.github.io/obsidian-dataview/","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/blacksmithgu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["blacksmithgu"]}},"created_at":"2021-01-13T05:23:45.000Z","updated_at":"2025-05-11T20:24:35.000Z","dependencies_parsed_at":"2023-09-24T09:56:16.551Z","dependency_job_id":"fcdd70f4-b7c6-40e2-a0af-1fa6321a2f4c","html_url":"https://github.com/blacksmithgu/obsidian-dataview","commit_stats":{"total_commits":769,"total_committers":117,"mean_commits":6.572649572649572,"dds":0.3732119635890767,"last_synced_commit":"3c29f7cb5bb76f62b5342b88050e054a7272667f"},"previous_names":[],"tags_count":145,"template":false,"template_full_name":"obsidianmd/obsidian-sample-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmithgu%2Fobsidian-dataview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmithgu%2Fobsidian-dataview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmithgu%2Fobsidian-dataview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmithgu%2Fobsidian-dataview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blacksmithgu","download_url":"https://codeload.github.com/blacksmithgu/obsidian-dataview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745198,"owners_count":21957319,"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":["obsidian-md","obsidian-plugin","query-language","typescript"],"created_at":"2024-07-31T17:01:40.860Z","updated_at":"2025-05-12T13:21:36.285Z","avatar_url":"https://github.com/blacksmithgu.png","language":"TypeScript","funding_links":["https://github.com/sponsors/blacksmithgu","https://www.paypal.com/donate?business=Y9SKV24R5A8BQ\u0026item_name=Open+source+software+development\u0026currency_code=USD","https://www.buymeacoffee.com/holroy"],"categories":["TypeScript","Graph Knowledge Base","Uncategorized","知识管理_wiki知识库","🔌 Recommended Plugins","Obsidian Vault Architecture for Agents","⚙️ Backend \u0026 APIs"],"sub_categories":["Uncategorized","资源传输下载","Benchmark Reality Check (real-world tool use)"],"readme":"# Obsidian Dataview\n\nTreat your [Obsidian Vault](https://obsidian.md/) as a database which you can query from. Provides a JavaScript API and\npipeline-based query language for filtering, sorting, and extracting data from Markdown pages. See the Examples section\nbelow for some quick examples, or the full [reference](https://blacksmithgu.github.io/obsidian-dataview/) for all the details.\n\n## Examples\n\nShow all games in the game folder, sorted by rating, with some metadata:\n\n~~~markdown\n```dataview\ntable time-played, length, rating\nfrom \"games\"\nsort rating desc\n```\n~~~\n\n![Game Example](docs/docs/assets/game.png)\n\n---\n\nList games which are MOBAs or CRPGs.\n\n~~~markdown\n```dataview\nlist from #game/moba or #game/crpg\n```\n~~~\n\n![Game List](docs/docs/assets/game-list.png)\n\n---\n\nList all markdown [tasks](https://blacksmithgu.github.io/obsidian-dataview/data-annotation/#tasks) in un-completed projects:\n\n~~~markdown\n```dataview\ntask from #projects/active\n```\n~~~\n\n![Task List](docs/docs/assets/project-task.png)\n\n---\n\nShow all files in the `books` folder that you read in 2021, grouped by genre and sorted by rating:\n\n~~~markdown\n```dataviewjs\nfor (let group of dv.pages(\"#book\").where(p =\u003e p[\"time-read\"].year == 2021).groupBy(p =\u003e p.genre)) {\n\tdv.header(3, group.key);\n\tdv.table([\"Name\", \"Time Read\", \"Rating\"],\n\t\tgroup.rows\n\t\t\t.sort(k =\u003e k.rating, 'desc')\n\t\t\t.map(k =\u003e [k.file.link, k[\"time-read\"], k.rating]))\n}\n```\n~~~\n\n![Books By Genre](docs/docs/assets/books-by-genre.png)\n\n## Usage\n\nFor a full description of all features, instructions, and examples, see the [reference](https://blacksmithgu.github.io/obsidian-dataview/). For a more brief outline, let us examine the two major aspects of Dataview: *data* and *querying*.\n\n#### **Data**\n\nDataview generates *data* from your vault by pulling\ninformation from **Markdown frontmatter** and **Inline fields**.\n\n- Markdown frontmatter is arbitrary YAML enclosed by `---` at the top of a markdown document which can store metadata\n  about that document.\n- Inline fields are a Dataview feature which allow you to write metadata directly inline in your markdown document via\n  `Key:: Value` syntax.\n\nExamples of both are shown below:\n\n```yaml\n---\nalias: \"document\"\nlast-reviewed: 2021-08-17\nthoughts:\n  rating: 8\n  reviewable: false\n---\n```\n```markdown\n# Markdown Page\n\nBasic Field:: Value\n**Bold Field**:: Nice!\nYou can also write [field:: inline fields]; multiple [field2:: on the same line].\nIf you want to hide the (field3:: key), you can do that too.\n```\n\n#### **Querying**\n\nOnce you've annotated documents and the like with metadata, you can then query it using any of Dataview's four query\nmodes:\n\n1. **Dataview Query Language (DQL)**: A pipeline-based, vaguely SQL-looking expression language which can support basic\n   use cases. See the [documentation](https://blacksmithgu.github.io/obsidian-dataview/query/queries/) for details.\n\n   ~~~markdown\n   ```dataview\n   TABLE file.name AS \"File\", rating AS \"Rating\" FROM #book\n   ```\n   ~~~\n\n2. **Inline Expressions**: DQL expressions which you can embed directly inside markdown and which will be evaluated in\n   preview mode. See the [documentation](https://blacksmithgu.github.io/obsidian-dataview/reference/expressions/) for\n   allowable queries.\n\n   ```markdown\n   We are on page `= this.file.name`.\n   ```\n\n3. **DataviewJS**: A high-powered JavaScript API which gives full access to the Dataview index and some convenient\n   rendering utilities. Highly recommended if you know JavaScript, since this is far more powerful than the query\n   language. Check the [documentation](https://blacksmithgu.github.io/obsidian-dataview/api/intro/) for more details.\n\n   ~~~markdown\n   ```dataviewjs\n   dv.taskList(dv.pages().file.tasks.where(t =\u003e !t.completed));\n   ```\n   ~~~\n\n4. **Inline JS Expressions**: The JavaScript equivalent to inline expressions, which allow you to execute arbitrary JS\n   inline:\n\n   ~~~markdown\n   This page was last modified at `$= dv.current().file.mtime`.\n   ~~~\n\n#### JavaScript Queries: Security Note\n\nJavaScript queries are very powerful, but they run at the same level of access as any other Obsidian plugin. This means\nthey can potentially rewrite, create, or delete files, as well as make network calls. You should generally write\nJavaScript queries yourself or use scripts that you understand or that come from reputable sources. Regular Dataview\nqueries are sandboxed and cannot make negative changes to your vault (in exchange for being much more limited).\n\n## Contributing\n\nContributions via bug reports, bug fixes, documentation, and general improvements are always welcome. For more major\nfeature work, make an issue about the feature idea / reach out to me so we can judge feasibility and how best to\nimplement it.\n\n#### Local Development\n\nThe codebase is written in TypeScript and uses `rollup` / `node` for compilation; for a first time set up, all you\nshould need to do is pull, install, and build:\n\n```console\nfoo@bar:~$ git clone git@github.com:blacksmithgu/obsidian-dataview.git\nfoo@bar:~$ cd obsidian-dataview\nfoo@bar:~/obsidian-dataview$ npm install\nfoo@bar:~/obsidian-dataview$ npm run dev\n```\n\nThis will install libraries, build dataview, and deploy it to `test-vault`, which you can then open in Obsidian. This\nwill also put `rollup` in watch mode, so any changes to the code will be re-compiled and the test vault will automatically\nreload itself.\n\n#### Preparing for creating pull requests\n\nIf you plan on doing pull request, we would also recommend to do the following in advance of creating the pull request:\n\n```console\nfoo@bar:~$ npm run dev\nfoo@bar:~$ npm run check-format\nfoo@bar:~$ npm run format\nfoo@bar:~$ npm run test\n```\n\nThe third step of `npm run format` is only needed if the format check reports some issue.\n\n#### Installing to Other Vaults\n\nIf you want to dogfood dataview in your real vault, you can build and install manually. Dataview is predominantly a\nread-only store, so this should be safe, but watch out if you are adjusting functionality that performs file edits!\n\n```console\nfoo@bar:~/obsidian-dataview$ npm run build\nfoo@bar:~/obsidian-dataview$ ./scripts/install-built path/to/your/vault\n```\n\n#### Building Documentation\n\nWe use `MkDocs` for documentation (found in `docs/`). You'll need to have python and pip to run it locally:\n\n```console\nfoo@bar:~/obsidian-dataview$ pip3 install mkdocs mkdocs-material mkdocs-redirects\nfoo@bar:~/obsidian-dataview$ cd docs\nfoo@bar:~/obsidian-dataview/docs$ mkdocs serve\n```\n\nThis will start a local web server rendering the documentation in `docs/docs`, which will live-reload on change.\nDocumentation changes are automatically pushed to `blacksmithgu.github.io/obsidian-dataview` once they are merged\nto the main branch.\n\n#### Using Dataview Types In Your Own Plugin\n\nDataview publishes TypeScript typings for all of its APIs onto NPM (as `blacksmithgu/obsidian-dataview`). For\ninstructions on how to set up development using Dataview, see [setup instructions](https://blacksmithgu.github.io/obsidian-dataview/plugin/develop-against-dataview/).\n\n## Support\n\nHave you found the Dataview plugin helpful, and want to support it? I accept donations which go towards future\ndevelopment efforts. I generally do not accept payment for bug bounties/feature requests, as financial incentives add\nstress/expectations which I want to avoid for a hobby project!\n\nSupport @blacksmithgu:  \n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/donate?business=Y9SKV24R5A8BQ\u0026item_name=Open+source+software+development\u0026currency_code=USD)\n\nSupport @holroy:  \n\u003ca href=\"https://www.buymeacoffee.com/holroy\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 40px !important;width: 175px !important;\" \u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacksmithgu%2Fobsidian-dataview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblacksmithgu%2Fobsidian-dataview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacksmithgu%2Fobsidian-dataview/lists"}