Skip to main content

Contributors Forks Stargazers Issues Licence Telegram

Export all your data into Obsidian

Your data is your asset, you should own it.

This tool exports your saved data to Markdown files for Obsidian.

  • Export data from many sites into local Markdown files.
  • Keep one simple CLI for all modules.
  • Write an optional index file in Markdown.

Now this tool had supported following modules:

  1. bangumi
  2. bilibili
  3. cnblog
  4. qireader
  5. v2ex
  6. weibo
  7. zhihu

Quick start

You can install from PyPI:

pipx install export_to_obsidian

Or install from this repo:

pipx install -e .

Put your token or cookie values in .env, then load them:

chmod +x ./export-env.sh
source ./export-env.sh

Main env vars used by the current modules:

  • CNBLOG_ACCESS_TOKEN
  • BGM_ACCESS_TOKEN
  • QIREADER_COOKIE
  • V2EX_ACCESS_TOKEN
  • V2EX_COOKIE
  • WEIBO_COOKIE
  • ZHIHU_COOKIE
  • BILIBILI_COOKIE

Basic usage

eto <command> [options]
eto --index-file <path> <command> [options]

--index-file is a top-level option. Put it before the subcommand.

If you do not use --index-file, the index is printed to the terminal.

If you use --index-file, the index is written to one Markdown file.

Each module is stored under one second-level heading, and repeated exports for the same module are appended in order under that same heading.

Command examples

cnblog

eto cnblog -o output/cnblog

bangumi

Use config/bangumi_template.md as the template file.

eto bangumi -t config/bangumi_template.md -s 1 -o output/bangumi
eto bangumi -t config/bangumi_template.md -s 2 -o output/bangumi
eto bangumi -t config/bangumi_template.md -s 3 -o output/bangumi
eto bangumi -t config/bangumi_template.md -s 4 -o output/bangumi

You can also set one collection type:

eto bangumi -t config/bangumi_template.md -s 2 -c 3 -o output/bangumi

-c means the status of the subject:

  • 1: 想看
  • 2: 看过
  • 3: 在看
  • 4: 搁置
  • 5: 抛弃

qireader

eto qireader -t your-tag -o output/qireader

v2ex

eto v2ex -o output/v2ex

zhihu

eto zhihu -c your-collection-id -o output/zhihu

weibo

eto weibo -u your-user-id -o output/weibo

bilibili

eto bilibili -f your-fav-id -o output/bilibili

Index file

Example:

eto --index-file output/index/export-index.md zhihu -c your-collection-id -o output/zhihu
eto --index-file output/index/export-index.md bilibili -f your-fav-id -o output/bilibili

The file is grouped by module name. One module keeps one ## section. Each export run adds one ### block under that module.

Example output:

## zhihu

- [[~zhihu-entry-1|First saved item]]
- [[~zhihu-entry-2|Second saved item]]

## bilibili

- [[~BV1xxxxxx|One saved video]]

Output

Files are written as Markdown files in your output folder. The project also writes front matter, so the files work well in Obsidian.

Testing

Run all tests:

PYTHONPATH=src pytest tests -q

Run one test file:

PYTHONPATH=src pytest tests/test_utils.py -q

In VS Code, you can also use the debug and test settings in .vscode/launch.json.

Contributing

Any contributions made are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'feat(module):add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Top contributors:

contrib.rocks image

License

All code is licensed under the AGPL-3.0 license. See LICENSE for more information.

Metadata

Release files for export_to_obsidian 0.3.26

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for export_to_obsidian 0.3.26
File Size Uploaded Provenance Actions
export_to_obsidian-0.3.26.tar.gz 40.3 kB Without provenance Details for export_to_obsidian-0.3.26.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for export_to_obsidian 0.3.26
File Interpreter ABI Platform Actions
export_to_obsidian-0.3.26-py3-none-any.whl Python 3 none any Details for export_to_obsidian-0.3.26-py3-none-any.whl

Total release size: 95.9 kB

Release files / export_to_obsidian-0.3.26.tar.gz

Download URL export_to_obsidian-0.3.26.tar.gz
Size 40.3 kB
Tags Source
SHA-256 checksum
How to use checksums
64e7e0b7b5a7590abf081602e190c4da5e6200cfb0f91876b275b3d7a90663ed
BLAKE2b-256 checksum
How to use checksums
fde7a06e0defed9e04a649db58399c88b37abbe9017a813286a1a13c1f08b544
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.0 CPython/3.12.3 Linux/6.8.0-64-generic

Release files / export_to_obsidian-0.3.26-py3-none-any.whl

Download URL export_to_obsidian-0.3.26-py3-none-any.whl
Size 55.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
990c4fc967c9e252f301bb16114d15a5a4c9a100697eda48cb910b4bcc8cb9b8
BLAKE2b-256 checksum
How to use checksums
9ef5db8908ef02fd500c07b4b5ac6a960da4c9a2563ae9d29c66d002fcaac9a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.0 CPython/3.12.3 Linux/6.8.0-64-generic

Security for export_to_obsidian 0.3.26

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.

Release history Release notifications | RSS feed

This release

0.3.26 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page