In this example, we will build index flow to load data from a local directory, convert them to HTML, and save the data to another local directory powered by CocoIndex Custom Targets.
We appreciate a star ⭐ at CocoIndex Github if this is helpful.
- We ingest a list of local markdown files from the
data/directory. - For each file, convert them to HTML using markdown-it-py.
- We will save the HTML files to a local directory
output_html/.
Install Postgres if you don't have one.
Install dependencies:
pip install -e .Update the target:
cocoindex update --setup mainYou can add new files to the data/ directory, delete or update existing files.
Each time when you run the update command, cocoindex will only re-process the files that have changed, and keep the target in sync with the source.
You can also run update command in live mode, which will keep the target in sync with the source in real-time:
cocoindex update --setup -L main.pyI used CocoInsight (Free beta now) to troubleshoot the index generation and understand the data lineage of the pipeline. It just connects to your local CocoIndex server, with Zero pipeline data retention. Run following command to start CocoInsight:
cocoindex server -ci main
Then open the CocoInsight UI at https://cocoindex.io/cocoinsight.