python-obsidian-templater
Just a small vibe coding project that automatically generates Obsidian literature notes following templates and organizes PDFs from DOIs.
Obsidian Templater
Just a small vibe coding project that automatically generates Obsidian literature notes following templates and organizes PDFs from DOIs.
❗ This is an actively maintained repository for scholarly purposes only. If you have suggestions for further improvement or find bugs: Email me
Features
- Fetches metadata from DOIs using CrossRef API
- AIS eLibrary support: Process papers directly from AIS eLibrary URLs
- Automatically detects publication type (journal, conference, book, chapter, misc)
- Downloads PDFs using PyPaperBot (if available)
- Creates Obsidian literature notes using templates
- Organizes literature notes into year/quarter folders
- Generates BibTeX entries
- Configurable paths through directories.txt
Requirements
- Python 3.x
- Required Python packages (install using requirements.txt):
python3 -m venv .env source .env/bin/activate pip install -r requirements.txt
Setup
- Create
directories.txtwith the following format:
markdown_dir=/path/to/your/obsidian/notes
pdf_dir=/path/to/your/papers
- (Optional) For AIS eLibrary PDF downloads, create
.secrets.txtwith your authentication cookie:
{
"ais_auth_cookie": "YOUR_BPAUTH201311_COOKIE_VALUE_HERE"
}
See AIS eLibrary Authentication for details on obtaining the cookie.
- Update the
templatesdirectory if needed:journal_template.mdconference_template.mdbook_template.mdchapter_template.mdmisc_template.md
Usage
Command Line Parameters
| Parameter | Description | Default |
|---|---|---|
-doi | DOI to process | Required (or -ais) |
-ais | AIS eLibrary paper URL or ID to process | Required (or -doi) |
--markdown-dir | Override markdown output directory | From directories.txt |
--pdf-dir | Override PDF output directory | From directories.txt |
--force-type | Force publication type | Auto-detected |
--skip-pdf | Skip PDF download | False |
--local-pdf | Use local PDF file instead of downloading | None |
--related-projects | Related projects to add to the note (e.g., "[[Project A]]") | None |
Examples
- Basic usage with a DOI:
python obsidian-templater.py -doi 10.1007/978-3-031-68211-7_10
- Skip PDF download:
python obsidian-templater.py -doi 10.1007/978-3-031-68211-7_10 --skip-pdf
- Use a local PDF file:
python obsidian-templater.py -doi 10.1007/978-3-031-68211-7_10 --local-pdf "/path/to/paper.pdf"
- Force publication type:
python obsidian-templater.py -doi 10.1007/978-3-031-68211-7_10 --force-type conference
Hint: If the metadata type is incorrect, simply run the command again with the correct type and the note and PDF will be overwritten.
- Override output directories:
python obsidian-templater.py -doi 10.1007/978-3-031-68211-7_10 \
--markdown-dir "/path/to/notes" \
--pdf-dir "/path/to/papers"
- Add related projects to a note:
python obsidian-templater.py -doi 10.1007/978-3-031-68211-7_10 --related-projects "[[My Dissertation]]"
- Multiple related projects:
python obsidian-templater.py -doi 10.1007/978-3-031-68211-7_10 --related-projects "[[Project A]], [[Project B]]"
Batch Processing
You can process multiple papers at once using the provided shell script. Create a text file with one DOI or AIS URL per line (e.g., papers.txt):
# DOIs
10.1007/978-3-031-68211-7_10
10.1007/978-3-658-46151-5
# AIS eLibrary papers
https://aisel.aisnet.org/icis2023/blockchain/blockchain/7
icis2024/general_is/general_is/11
Then run:
./batch_process.sh papers.txt
With related projects:
./batch_process.sh papers.txt --related-projects "[[My Research Project]]"
Multiple related projects:
./batch_process.sh papers.txt --related-projects "[[Project A]], [[Project B]]"
The script will:
- Automatically detect whether each line is a DOI or AIS paper
- Process each paper sequentially
- Skip empty lines and comments (lines starting with
#) - Remove any "doi" prefix,
https://doi.org/prefix, and extra whitespace - Apply the
--related-projectsparameter to all processed papers - Show progress and summary statistics
AIS eLibrary Papers
Process papers directly from AIS eLibrary:
python obsidian-templater.py -ais "https://aisel.aisnet.org/icis2023/blockchain/blockchain/7"
Or using just the path:
python obsidian-templater.py -ais "icis2023/blockchain/blockchain/7"
With related projects:
python obsidian-templater.py -ais "icis2023/blockchain/blockchain/7" --related-projects "[[Blockchain Research]]"
AIS eLibrary Authentication
To download PDFs from AIS eLibrary, you need to provide an authentication cookie. This requires membership access to AIS eLibrary.
Obtaining the Authentication Cookie
- Log in to AIS eLibrary
- Open your browser's Developer Tools
- Go to the Network tab
- Navigate to any paper page on AIS eLibrary
- Click on any request and look at the Cookies in the request headers
- Find the cookie named
BPAuth201311and copy its value
Setting Up the Cookie
-
Copy
.secrets.txt.exampleto.secrets.txt:cp .secrets.txt.example .secrets.txt -
Edit
.secrets.txtand replace the placeholder with your cookie value:{ "ais_auth_cookie": "YOUR_ACTUAL_COOKIE_VALUE" }
⚠️ Note: The authentication cookie may expire periodically. If PDF downloads stop working, obtain a fresh cookie by logging in again.
🔒 Security: The
.secrets.txtfile is excluded from version control via.gitignore. Never commit your authentication cookies.
License
This project is licensed under the MIT License.
Contributions
Pull requests and suggestions are welcome! Feel free to submit issues or feature requests. Please note that I am not a professional software developer, just a researcher trying automate parts of his workflow.
How to Install
- Download the template file from GitHub
- Move it anywhere in your vault
- Open it in Obsidian — done!
Stats
Stars
2
Forks
0
License
MIT
Last updated 7mo ago