Keeping your prompts clean since 2023
Project description
Pretty Prompt
Simple tools for better prompts.
Usage
Sniffing bad intentions
from prettyprompt import sniffers
# will this SQL statement write to my database?
sniffers.is_sql_write_statement(user_supplied_sql)
Converting input
from prettyprompt import converters
# convert scraped HTML into plain text, maintaining some structure
converters.html_to_text(scraped_html)
Cleaning input
from prettyprompt import cleaners
# remove tags from HTML
cleaners.remove_tags(html)
# normalise spaces
cleaners.normalise_spaces(text)
# swap common 'smart' characters with ASCII equivalents
cleaners.simplify_text(text)
Tests
pip install pytest
pytest
TODO
- Prompt Injection
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
prettyprompt-0.1.2.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for prettyprompt-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8be0323013163d56e2fc695a3ff7b3100290c529ffb10bf373348235b3e01b6b |
|
MD5 | 61fdad6f10cbc39a6fcb19287a8ebe39 |
|
BLAKE2b-256 | d8801f4657954177a3048d067043bad5ac37075747e05f1946f1f13a1579510f |