obsbase
Read and query Obsidian Bases from Python.
obsbase loads Obsidian .base files and returns the results as Python
objects or pandas DataFrames.
Installation
pip install obsbase
Quick start
from obsbase import Vaultvault = Vault("/path/to/your/vault")df = ( vault .base("books.base") .run() .to_dataframe())print(df.head())
Description
Vault
│
├── notes()
│
└── base("books.base")
│
▼
Base
│
▼
View
│
▼
ResultSet
│
▼
pandas.DataFrame
Example
example vault with french cities:
set md files from wikipedia : https://fr.wikipedia.org/wiki/Liste_des_communes_de_France_les_plus_peupl%C3%A9es
villes/ Paris.md Lyon.md Marseille.md
top50.base
views:
- type: table
name: Tableau
filters:
and:
- file.folder == "villes"
- Rang_2023 <= 50
order:
- file.name
- Commune
- Population_de_référence
- Département
- Région
- Rang_2023
sort:
- property: Rang_2023
direction: ASC
Then:
from obsbase import Vault
vault = Vault("examples/obsbase_vault")
base = vault.base("top50.base")
rows = base.run()
df = rows.to_dataframe()
returns
| file.name | Commune | Population_de_référence | Département | Région | Rang_2023 | |
|---|---|---|---|---|---|---|
| 0 | Reims | Reims | 177 674 | Marne | Grand Est | 13 |
| 1 | Amiens | Amiens | 136 449 | Somme | Hauts-de-France | 28 |
| 2 | Avignon | Avignon | 92 188 | Vaucluse | Provence-Alpes-Côte d'Azur | 49 |
| 3 | Tourcoing | Tourcoing | 98 772 | Nord | Hauts-de-France | 43 |
| 4 | Roubaix | Roubaix | 98 286 | Nord | Hauts-de-France | 44 |
| 5 | Villeurbanne | Villeurbanne | 163 684 | Métropole de Lyon | Auvergne-Rhône-Alpe | 16 |
| ... | ... | ... | ... | ... | ... | ... |
| 45 | Paris | Paris | 2 103 778 | Paris | Île-de-France | 1 |
| 46 | Perpignan | Perpignan | 121 616 | Pyrénées-Orientales | Occitanie | 32 |
| 47 | Strasbourg | Strasbourg | 293 771 | Bas-Rhin | Grand Est | 8 |
| 48 | Aix-en-Provence | Aix-en-Provence | 149 695 | Bouches-du-Rhône | Provence-Alpes-Côte d'Azur | 22 |
| 49 | Toulouse | Toulouse | 514 819 | Haute-Garonne | Occitanie | 4 |
API
Vault
vault = Vault(path)
Methods
notes()base(filename)
Base
base = vault.base("top50.base")
Methods
run()
Attributes
views
View
view = base.views[0]
Methods
run()
Attributes
nametypefilterscolumnssort
ResultSet
rows = base.run()
Methods
to_dataframe()
Supports
- iteration
- indexing
len()
Roadmap
- Read notes
- Read
.basefiles - Execute filters
- Export to pandas
- Sorting
- Nested filters (
or) - Dataview expressions
- CSV export
- Markdown export
Metadata
Release files for obsbase 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| obsbase-0.1.3.tar.gz | 8.6 kB | Without provenance | Details for obsbase-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| obsbase-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for obsbase-0.1.3-py3-none-any.whl |
Total release size: 18.6 kB
Release files / obsbase-0.1.3.tar.gz
| Download URL | obsbase-0.1.3.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
48176e73d01255a6d47f1cbf5fabe31105c7da31a8bbbd81106ed39f9790afc4
|
|
BLAKE2b-256 checksum How to use checksums |
26aa2409da3d4648f29a83652d5784034c205d304da8ddd4fd21f12c437c7f0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / obsbase-0.1.3-py3-none-any.whl
| Download URL | obsbase-0.1.3-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78c21b943bf5eb42340541a25a282d4d74ae2f84699bef616b6dab653057a154
|
|
BLAKE2b-256 checksum How to use checksums |
c3e6a0c6a32251f113cf0c0f92c8917372a8934d76b4cbee1acda50fe64324bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for obsbase 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.