🐻 bearkit
The Python toolkit for Bear notes - read, search, and write your notes from Python, with secret detection built in.
API reference ·
Website ·
bearcli (the CLI & terminal UI built on it)
Install
pip install bearkit # or: uv add bearkit
Lightweight by design: no CLI or UI dependencies, just the fundamentals.
Quick start
One object, Bear, for everything:
from bearkit import Bear
with Bear() as bear:
for note in bear.list_notes(tag="work", limit=10):
print(note.title, note.tags)
Read and search
Filter by tag (nested sub-tags included), dates, or status; search naively or fuzzily, scoped to tags and widened to archived or trashed notes:
from bearkit import Bear
with Bear() as bear:
pinned = bear.list_notes(only="pinned")
note = bear.get_note("C44D09DC") # a unique 4+ char id prefix works
for result in bear.search("quarterly planing", fuzzy=True)[:5]:
print(f"{result.score:5.1f} {result.note.title}")
for result in bear.search("invoice", tag=["work", "clients"], include_archived=True):
print(result.note.title, result.snippet)
Verified writes
Writes go through the Bear app itself and are verified before returning - you
get the fresh note back, or BearWriteError if Bear didn't apply the change:
from bearkit import Bear, BearWriteError
with Bear() as bear:
try:
note = bear.create_note("Meeting notes", text="agenda...", tags=["work"])
bear.add_tag(note, "from-python")
except BearWriteError:
print("Bear did not apply the change")
Also: add_text (append/prepend/replace), rename, attach_file, trash,
archive, rename_tag, delete_tag, and open to bring a note up in Bear.
Secret detection
Scan notes for leaked credentials (token formats, key blocks, credential assignments, high-entropy strings) - fully offline - and redact before sharing:
from bearkit import Bear
with Bear() as bear:
notes = bear.list_notes(limit=None, include_archived=True)
report = bear.scan_secrets(notes)
for finding in report:
print(finding.note_title, finding.rule, finding.excerpt) # excerpt is safe to print
for note in notes:
if report.has(note.id):
safe = report.redact(note) # text with [redacted: <rule>] placeholders
⚠️ Warning - detection is best-effort: a secret that reads like ordinary prose will not be caught. Ideally, don't keep secrets in notes at all.
Good to know
- Typed - ships
py.typed; the full API is annotated. - Encrypted notes are listed with their metadata, but their content stays
in Bear (
note.textisNone). - Every public function has a runnable sample in the API reference.
- Want a ready-made tool instead of a library?
bearkitpowersbearcli- the CLI and full terminal UI, including markdown export and git mirroring.
License
MIT · not affiliated with Shiny Frog
Metadata
Release files for bearkit 1.7.6
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 |
|---|---|---|---|---|
| bearkit-1.7.6.tar.gz | 16.5 kB | Without provenance | Details for bearkit-1.7.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bearkit-1.7.6-py3-none-any.whl | Python 3 | none | any | Details for bearkit-1.7.6-py3-none-any.whl |
Total release size: 37.4 kB
Release files / bearkit-1.7.6.tar.gz
| Download URL | bearkit-1.7.6.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a15d58c678b3f6d4dd1f05f54d602969870f96f2e2b16b6e16d343b0abef9ffd
|
|
BLAKE2b-256 checksum How to use checksums |
89cff3e0626af303d682f6c30ead94a05b9e08622da98a70c6c645ec083257cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / bearkit-1.7.6-py3-none-any.whl
| Download URL | bearkit-1.7.6-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bde4ab287bbc43a89537384c4135a83b56963f0228d403cc53bb0ff402cddde
|
|
BLAKE2b-256 checksum How to use checksums |
f06e7264759adae847bf5e48585d8047284dc15491ab322e5947bbb608145f38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for bearkit 1.7.6
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.