Metadata-Version: 2.1
Name: promptsdk
Version: 0.1.3
Summary: An SDK for managing prompts via github
Author: otto zastrow
Author-email: otto@midpage.ai
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: configparser (>=5.3.0,<6.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Description-Content-Type: text/markdown

Manage prompts via github


### Usage
```python
from promptSDK import prompts
print(prompts.my_folder.myprompt)
# this expects a repo with repo/my_folder/myprompt.md
```

When your code accesses a prompt it fetches that file from your prompt repo. This allows iterating on prompts while your server is running. 
Prompts are cached, so the SDK does not fetch from the web everytime you accesss a prompt. The default cache lifetime is 10 seconds for dev and 300 for production

### Install
```bash
pip install promptSDK
```

### Setup
Information on how to generate a token can be found [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)

If your prompt repo is public just leave the token empty.
Required env variables (see env.sample) are
```bash
BASE_URL=https://github.com/username/repo
TOKEN=your_github_personal_access_token
```

### Limitations
Currently only supports reading .md files in the prompt repo

### Example Prompt Repo
https://github.com/ottozastrow/sample-prompts
