prepembd
Installation
Install prepembd:
python3 -m pip install prepembd --upgrade
Requirements
- Python >= 3.10
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.
Metadata
Release files for prepembd 0.3.0
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 | |
|---|---|---|---|---|
| prepembd-0.3.0.tar.gz | 6.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| prepembd-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.6 kB
Release files / prepembd-0.3.0.tar.gz
| Download URL | prepembd-0.3.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7297b4230bca493613063210d69133b0aab3c35a0d72c48c3c03389cca95649
|
|
BLAKE2b-256 checksum How to use checksums |
d0d0be976b879d9410e0794694ecff6ded22c75b4b5add4204ad78945ad06278
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.5
|
Release files / prepembd-0.3.0-py3-none-any.whl
| Download URL | prepembd-0.3.0-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
778fa990a96706a75bab4dfd78676ecda490e1dfa0184b4d2b10dec98fe2b06b
|
|
BLAKE2b-256 checksum How to use checksums |
dc8043f1d8d8ab687d6df7e4c2300af133207545cfbcf3815999f04d0b007a0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.5
|
Security for prepembd 0.3.0
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.