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 details)
Built Distribution
File details
Details for the file prettyprompt-0.1.2.tar.gz
.
File metadata
- Download URL: prettyprompt-0.1.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52c2faaf6f4696460cef1f464e56d808713443edb249fe718f96059653567c39 |
|
MD5 | aba04506393c20fd05cd96c28c77d014 |
|
BLAKE2b-256 | fd3b411800a8595dea30d86cd14b6b228f2b7474ef8f880100c3f300a7638b2a |
File details
Details for the file prettyprompt-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: prettyprompt-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8be0323013163d56e2fc695a3ff7b3100290c529ffb10bf373348235b3e01b6b |
|
MD5 | 61fdad6f10cbc39a6fcb19287a8ebe39 |
|
BLAKE2b-256 | d8801f4657954177a3048d067043bad5ac37075747e05f1946f1f13a1579510f |