Skip to main content

Flask app for reading and searching notes from a personal knowledge base

Project description

Build Status codecov Maintainability PyPI version

ReadingBricks

Overview

It is a Flask app for reading and searching notes from a personal knowledge base. Here, knowledge base means a collection of Jupyter notebooks with Markdown cells which may have tags and may contain links to each other. So, the approach resembles Zettelkasten.

Features of the search system include:

  • Separate spaces for fields of knowledge
  • Search by single tag
  • Search by expressions consisting of tags, logical operators, and parentheses
  • Full-text search with TF-IDF
  • Search within kNN-index built on vector representations of notes

The repository can be used either as a whole (with notes written by me) or as a Python package providing an interface to your notes.

Usage as existing knowledge base

The most valuable part of this project is not a software. It is the notes itself. When writing them, I try to explain complicated things in a way that allows efficient grasping with as less ambiguity as possible. I write mostly on machine learning, but new topics are coming. Alas, there is a potential dealbreaker — as of now, the notes are in Russian only. If it does not suit you, please go to the next section.

To start with, you need to clone the repository to your local machine and install readingbricks package. This can be done by running the below commands from a terminal:

cd /your/path/
git clone https://github.com/Nikolay-Lysenko/readingbricks
cd readingbricks
make venv

Every time you want to start a Flask application, run these commands:

cd /your/path/readingbricks
source venv/bin/activate
python -m readingbricks

The last command launches a local server. After it is ready, open your web browser and go to 127.0.0.1:5000. See interface guide for further details.

Usage as an interface

To make your own knowledge base compatible with the app, it must be represented as follows:

notes_directory
├── field_one
│   ├── notebook_one.ipynb
│   ├── ...
│   └── notebook_n.ipynb
├── ...
└── field_k
    ├── notebook_one.ipynb
    ├── ...
    └── notebook_m.ipynb

Here, fields stand for independent domains (say, machine learning, chemistry, music theory, etc.). Within a particular field, distribution of notes among Jupyter notebooks can be arbitrary. For example, you may simply keep all notes in a single notebook.

All cells of a notebook must be Markdown cells starting with '## {title}'. To tag a note, activate tagging facilities with 'View -> Cell Toolbar -> Tags'. To add link from one note to an other note, special patterns __root_url__/{field}/notes/{note_title} and __home_url__/notes/{note_title} can be used. While the latter is less verbose, only the former supports cross-field links.

So far so good. The knowledge base is ready, but the app must be configured to use it. Create somewhere a JSON file that looks like this:

{
  "FIELDS": ["field_one", "field_two"],
  "FIELD_TO_ALIAS": {"field_one": "Field #1", "field_two": "Field #2"},
  "FIELD_TO_SEARCH_PROMPT": {"field_one": "the_most_popular_tag", "field_two": "the_most_popular_tag"},
  "NOTES_DIR": "/absolute/path/to/notes_directory",
  "RESOURCES_DIR": "/any/directory/for/storing/internal/files"
}

Now, let us install the Python package:

source /your/path/venv/bin/activate
pip install readingbricks

All that remains is to launch the app:

python -m readingbricks -c /absolute/path/to/config.json

As in the previous section, go to 127.0.0.1:5000. Known bug is that some minor interface elements are in Russian regardless of notes language. I am still seeking an elegant solution to this problem.

Interface guide

The web interface is quite self-explanatory.

At the index page, you can select a filed and go to its home page. Such home pages have two control elements:

  • search bar,
  • cloud of tags.

You can look through the tag cloud and choose the tags you are interested in. If you are interested in a single tag, just push a button with it. However, if you need less trivial selection of notes, search bar should be used. Arbitrary logical expressions with AND, OR, and NOT operators, and parentheses are supported there.

Enjoy reading!

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

readingbricks-0.1.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

readingbricks-0.1.0-py3-none-any.whl (53.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: readingbricks-0.1.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for readingbricks-0.1.0.tar.gz
Algorithm Hash digest
SHA256 de77d73fc172506d7bda32ce1bd72ea1b21c395960c545d8739f9803e05a2944
MD5 0014e5d5a6988bede2c10ca7b321e0c3
BLAKE2b-256 aad8fa98f2fa6093a9914f93a52d7941c412bad724d99a822f7f6a62ccecae65

See more details on using hashes here.

File details

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

File metadata

  • Download URL: readingbricks-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 53.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for readingbricks-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c74be630a263aa83f1836ce891ed5d1aca34cf6241d9d92ed005e5ebc7b9c93
MD5 4fd8eb5fdb805c2d8e5f628b4d54930a
BLAKE2b-256 27e5f36ee0b42ca53d2156fbb76e051849ea31106c1261a6f95939193bf74ba2

See more details on using hashes here.

Supported by

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