inka-clean
Remove inka2 metadata from markdown files while preserving content and adjusting heading hierarchy.
Overview
inka-clean is a Unix pipeline tool that processes markdown files containing inka2 flashcard sections. It removes inka2 metadata (delimiters, deck/tag specifications, ID comments, question numbers, answer prefixes) while preserving the actual content and intelligently adjusting heading levels to fit the surrounding markdown hierarchy.
Installation
uv tool install inka-clean
# or for development
cd inka-clean && make install
Usage
As a Unix pipeline tool (stdin → stdout):
# Read from stdin, write to stdout
cat file.md | inka-clean > output.md
# Direct file redirection
inka-clean < input.md > output.md
# With file argument
inka-clean input.md > output.md
# Chain with other tools
cat file.md | inka-clean | pandoc -o output.html
Example
Input:
## Outer Heading
Some content.
---
Deck: tools::vim
Tags: vim
<!--ID:1755681272665-->
1. How to format text paragraphs?
> `gq`
> `gqap` (current paragraph)
---
### Another Heading
More content.
Output:
## Outer Heading
Some content.
How to format text paragraphs?
`gq`
`gqap` (current paragraph)
### Another Heading
More content.
Features
- Metadata removal: Strips
---delimiters,Deck:,Tags:,<!--ID:-->comments - Prefix stripping: Removes
1.question numbers and>answer prefixes - Heading adjustment: Adjusts heading levels in inka2 content relative to surrounding context
- Edge case handling: Preserves code blocks, regular ordered lists, blockquotes, thematic breaks
- Performance: < 20ms for typical files
- Unix philosophy: Pure stdin/stdout, composable with other tools
Development
# Run tests (TDD)
make test
# Type check
make ty
# Lint and format
make lint
make format
# Run benchmarks
make bench
License
MIT
inka-clean
Metadata
Release files for inka-clean 0.1.2
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 | |
|---|---|---|---|---|
| inka_clean-0.1.2.tar.gz | 11.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| inka_clean-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / inka_clean-0.1.2.tar.gz
| Download URL | inka_clean-0.1.2.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf192a3cd62bcc287fc4981640901fe3fb5732c661e0cf6aec223a8eb1491bf0
|
|
BLAKE2b-256 checksum How to use checksums |
460bd28a42a7b4a3fb9ab5d61fd11f4a1db08a86f36c99431cd19cb82ebe4e89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.5
|
Release files / inka_clean-0.1.2-py3-none-any.whl
| Download URL | inka_clean-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2965456fb97b87c13c9162127a9466babb6549dcccb92b7ddf5475344239a6ce
|
|
BLAKE2b-256 checksum How to use checksums |
96f3f842523833bc2593a8be108b0d62788a5968dbc303ac7473beee4f9f7a74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.5
|
Security for inka-clean 0.1.2
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.