A Python library for extracting code snippets using LLMs
Project description
llmcodxtracter
llmcodxtracter is a Python package designed to extract code snippets from plain text using Large Language Models (LLMs).
Installation
Install via pip:
pip install llmcodxtracter
Usage
python
from llmcodxtracter.processor import LLMOutputProcessor
from llmcodxtracter.validator import LLMOutputValidator
from llmcodxtracter.extractor import LLMCodeExtractor
from llmcodxtracter.exceptions import LLMOutputException
# Instantiate components
validator = LLMOutputValidator()
extractor = LLMCodeExtractor()
processor = LLMOutputProcessor(validator, extractor)
# Example usage
text = "```python //script.py print('Test')```"
try:
code_block = processor.process(text)
print(code_block)
except LLMOutputException as e:
print(f"Error processing LLM output: {e}")
Features
- Extracts code snippets from plain text.
- Supports multiple programming languages.
- Easily integrates into other LLM-based projects.
Contributing
- Fork the repository.
- Clone it: git clone https://github.com/DarthMuzammil/llmcodxtracter.git
- Install dependencies: pip install -r requirements.txt
- Submit a pull request!
License
This project is licensed under the MIT License.
Next Steps
- Make sure
src/lasso/__init__.pyexists. - Create
pyproject.toml(or usesetup.pyif preferred). - Build and upload to PyPI using
twine.
Let me know if you need help with any step! 🚀
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
llmcodxtracter-0.1.4.tar.gz
(4.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llmcodxtracter-0.1.4.tar.gz.
File metadata
- Download URL: llmcodxtracter-0.1.4.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
305f80ebad4c4ff048bbd837c60b7d55ddd4943c91559b3631c3ebfe8d8e495d
|
|
| MD5 |
6438dd899fa1e73123309f44ca1fb3a5
|
|
| BLAKE2b-256 |
f88962d4f33c9ed9d6989b7bc68607911b4e584e70e49e8ed93f2a8767dc0ffd
|
File details
Details for the file llmcodxtracter-0.1.4-py3-none-any.whl.
File metadata
- Download URL: llmcodxtracter-0.1.4-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3540d5e2a128bbf578b5d1ff438a6fd3b08a2820087f36833b93361673038cfa
|
|
| MD5 |
a197ed6e63556fa3bbe2b9d8ad168b76
|
|
| BLAKE2b-256 |
7dc7168e629b3b5f98e5a29c6b03e46e148a5a12cbcc9275b4a83119b56eb36d
|