Download db_client.py from smlflg/PromptGarageUI: direct link, hf CLI and curl.
- Browser
- Download file 646 Bytes
-
https://huggingface.co/smlflg/PromptGarageUI/resolve/main/db_client.py
- Command line
-
hf download hf://smlflg/PromptGarageUI/db_client.py
-
curl -L -o db_client.py https://huggingface.co/smlflg/PromptGarageUI/resolve/main/db_client.py
646 Bytes
| #!/usr/bin/env python3 | |
| """Database client - imports from existing PromptGarage.""" | |
| import os | |
| import sys | |
| # Add PromptGarage to path | |
| PROMPT_GARAGE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| sys.path.insert(0, os.path.join(PROMPT_GARAGE_DIR, "PromptGarage")) | |
| # Re-export all functions from the original db module | |
| from db import ( | |
| get_db, | |
| get_prompt, | |
| list_prompts, | |
| search_fts, | |
| toggle_star, | |
| set_rating, | |
| add_prompt, | |
| update_prompt, | |
| delete_prompt, | |
| get_stats, | |
| increment_use, | |
| list_top_used, | |
| list_untagged, | |
| ) | |
| # Keep DB_PATH accessible | |
| from db import DB_PATH as ORIGINAL_DB_PATH | |