Skip to main content

Sync notes from Bear to a local directory

Project description

Bear Sync

This is a small python package to export notes from Bear to a local directory as markdown files.

Installation

via pip:

pip install bear-sync

Usage

bear-sync [options] <directory>

Where <directory> should be the directory that the notes should be written to.

Options:

--db-dir TEXT: Path to Bear's database directory. Defaults to ~/Library/Group Containers/9K33E3U3T4.net.shinyfrog.bear/Application Data/database.sqlite

--overwrite: Overwrite existing markdown files with the same name.

--remove-existing: Remove existing markdown files before syncing. WARNING: This will delete all markdown files in output-dir.

Behaviour

This package attempts to mimic the behaviour of bear with a directory structure. At the moment, this results some duplication of files. If you have a document in bear like follows:

# My Bear Document

#tag/subtag #tag2

This is my bear document.

then the resulting directory structure will be:

bear_sync_folder/
├── tag/
|   ├── My Bear Document.md
│   ├── subtag/
│   │   ├── My Bear Document.md
├── tag2/
|   ├── My Bear Document.md

Example - using bear-sync with git

Setup a new git repository:

mkdir bear_notes
cd bear_notes
git init

Create a shell script to sync the bear notes:

cat <<EOF > bear_sync.sh
NOTES_PATH="$HOME/bear_notes"

bear-sync --overwrite --remove-existing "$NOTES_PATH"
git -C "$NOTES_PATH" add .
git -C "$NOTES_PATH" commit -m "notes backup: $(date)"
EOF

Give the new script execution permissions:

chmod +x ./bear_sync.sh

Run!

./bear_sync.sh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bear_sync-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bear_sync-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file bear_sync-0.1.0.tar.gz.

File metadata

  • Download URL: bear_sync-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for bear_sync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e1abca13b7d4ca95f9eac34eac11edfa91480c83b6bddc76dc379418a7c7c8cd
MD5 fb3b3c060752eb5da665e2e1c87a23e1
BLAKE2b-256 a905031da5ed1dc716834b676fa635f328c1cb9867ef683f358dc368fad5b2c9

See more details on using hashes here.

File details

Details for the file bear_sync-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bear_sync-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for bear_sync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed4f72af0f3713ccaa1087b2b41203f5be23e86a1c2b74eb1acaa05bbb107ceb
MD5 d277d3c54d3802c4d95a67b9766c2895
BLAKE2b-256 cf2838f3403d570b4278b924a387077312863b0bf782988ee8ef4e01e303c559

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page