Skip to main content

A Python library for extracting code snippets using LLMs

Project description

llmcodxtracter

PyPI License

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

License

This project is licensed under the MIT License.

Next Steps

  1. Make sure src/lasso/__init__.py exists.
  2. Create pyproject.toml (or use setup.py if preferred).
  3. 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.2.4.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llmcodxtracter-0.2.4-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file llmcodxtracter-0.2.4.tar.gz.

File metadata

  • Download URL: llmcodxtracter-0.2.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

Hashes for llmcodxtracter-0.2.4.tar.gz
Algorithm Hash digest
SHA256 6906a503729b91929e7931c2477494d447ab61bc3310fcaad596554191bcfab8
MD5 558e65815f12fa434e0e93fa109d8193
BLAKE2b-256 5e7bc35e7e03fc8b3e2f035adad8b28bc17af2bfac061f62ac0adf139df3d430

See more details on using hashes here.

File details

Details for the file llmcodxtracter-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: llmcodxtracter-0.2.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

Hashes for llmcodxtracter-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 99b195996c367c6955fa2153aa7752342a996688f4666aa6385e0a2cb262c1d8
MD5 eb5a7e617bf3ffbf289b65b3c260caaa
BLAKE2b-256 8d2fde1904238e7ed27cfb85849b24f4502bf83d7e0ccc4d0495357bf10993dc

See more details on using hashes here.

Supported by

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