Skip to main content

prepembd

Project description

prepembd

PyPi Tests CI Codecov

Installation

Install prepembd:

python3 -m pip install prepembd --upgrade

Requirements

Why

I've been using markdown now for a long time to take notes in every possible scenario. I even manage my Anki cards with markdown (inka2) so finding relevant information again is paramount. With the advent of semantic search via Embeddings search became so much more powerfull. However, to create the embeddings out of markdown the files have to be prepared in order to reduce noice and create the correct chunk sizes.

This Python script automates the process and creates a json representation of all the markdown files which then can be fed into an embedding model. It is basically just a thin wrapper aroung LangChain combined with some bespoke filter to eliminated noise.

Usage

prepembd tokenize --prefix '$VIMWIKI_PATH/' <directory> | tee -a output.ndjson

# cat output.ndjson:
{
  "id": "$VIMWIKI_PATH/help/qk/quarkus.md:0",
  "content": "..."
}
{
  "id": "$VIMWIKI_PATH/help/qk/quarkus.md:1",
  "content": "..."
}
{
  "id": "$VIMWIKI_PATH/help/qk/quarkus.md:2",
  "content": "..."
}

This script integrates particularly well with bkmr.

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

prepembd-0.3.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

prepembd-0.3.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file prepembd-0.3.0.tar.gz.

File metadata

  • Download URL: prepembd-0.3.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for prepembd-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b7297b4230bca493613063210d69133b0aab3c35a0d72c48c3c03389cca95649
MD5 b2db4d3f32c906e0e4a8730ffceacd85
BLAKE2b-256 d0d0be976b879d9410e0794694ecff6ded22c75b4b5add4204ad78945ad06278

See more details on using hashes here.

File details

Details for the file prepembd-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: prepembd-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for prepembd-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 778fa990a96706a75bab4dfd78676ecda490e1dfa0184b4d2b10dec98fe2b06b
MD5 e47f357d67d06a97d894354c4a638903
BLAKE2b-256 dc8043f1d8d8ab687d6df7e4c2300af133207545cfbcf3815999f04d0b007a0c

See more details on using hashes here.

Supported by

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