semvec/pypi-packages huggingface dataset:
corvid 1.1.1
An opinionated simple static site generator
Requires Python: <4,>=3.5
Keywords: static markdown

# corvid

corvid is an opinionated simple static site generator.

It processes Markdown files, static assets and directories producing a 1:1 hierarchy of compiled content.

It includes a reloadable local development server, supports custom markdown frontmatter and Jinja templates.

## Installation

```
$ pip install corvid
```

## Running

By default corvid expects to be run in a directory with an `input` directory. With no parameters, corvid will process all files in this directory into the `output` directory and exit.

```
Usage:
$ corvid [OPTIONS]

For help:
$ corvid --help

Options:
  -l, --listen          Enable live reloading
  -b, --bind TEXT       Host to bind to
  -p, --port INTEGER    Port to run on
  -i, --input TEXT      Input directory
  -o, --output TEXT     Output directory
  -t, --templates TEXT  Templates directory
  --help                Show this message and exit.
```

## Example

Given the following directory layout:

```
├── input
│   └── index.md
└── templates
    └── default.html
```
With the following file contents:

`input/index.md`
```
---
title: This is the Index
---

Welcome
```

`templates/default.html`
```html
<html>
    <head>
        <title>{{ title }}</title>
    </head>
    <body>
        {{ content }}
    </body>
</html>
```

Running `corvid` will produce the additional `output` directory:

```
.
├── input
│   └── index.md
├── output
│   └── index.html
└── templates
    └── default.html
```

And the contents of the file will be:

`output/index.html`
```html
<html>
    <head>
        <title>This is the Index</title>
    </head>
    <body>
        <p>Welcome</p>
    </body>
</html>
```

## Using templates

Custom templates can be set by specifying the path to the template (inside the `templates` directory) as the `template` frontmatter in an individual page. See [`bar.md`](https://raw.githubusercontent.com/di/corvid/master/example/input/foo/bar.md) for an example.

See [`/example`](https://github.com/di/corvid/blob/master/example) for the full `input` -> `template` -> `output` folder structure.
doprompt 0.1.2
Add your description here
Requires Python: >=3.10

# doprompt-py
DoPrompt is a python package to parse and execute dotprompt files - a [filetype created by Google](https://firebase.google.com/docs/genkit/dotprompt) to store prompts outside of the code itself.

This library exists to create vendor independent tooling for a better way to store and interact with prompts. 

Please check out the visual studio code extension to easily play around with your prompts without ripping them out of your code.

## Example

1. Install doprompt
```bash
pip install doprompt
```

2. Create a `chatbot.prompt` file
```
---
model: openai/gpt-4o
config:
  temperature: 0.9
input:
  schema:
    userQuestion: string
---
{{role "system"}}
You are a helpful AI assistant that really loves to talk about food. Try to work
food items into all of your conversations.
{{role "user"}}
{{userQuestion}}
```

3. Execute the prompt
You can use our completion API to automatically dispatch the prompt to the right vendor library and pass in the parameters you configured:

```python
import doprompt

prompt = DoPrompt("./chatbot.prompt")
print(prompt.complete({'userQuestion': 'Which way is the library?'})
```

Alternatively if you need custom APIs, settings or vendors you can also manually pass down any parameters.
The following snippet results in equivalent behaviour

```python
import doprompt
from openai import OpenAI

prompt = DoPrompt("./chatbot.prompt")

openai = OpenAI()

messages = prompt.get_messages(values={
    'userQuestion': 'What is the capital of France?',
})


client = OpenAI()
completion = client.chat.completions.create(
    messages=prompt.get_messages(vals),
    model=prompt.model_name,
    temperature=prompt.get_config('temperature'),
)
print(completion.choices[0].message.content)
```

## Backgorund
Hardcoding prompt is a very constraining solution, since prompts often need very interactive development which is hard once they're embedded in code. 
The alterantive would be to use a prompt management platform, which create an additional dependency and point of failure, whilst siloing away your prompts from the parts they are actually very integrated into.

Separating them into their own file keeps them close to the code while allowing additional tooling to help you interactively develop them.

## Supported features
- [x] handlebars templating
- [x] config settings
- [x] roles
- [x] schema validation
- [ ] media support
- [ ] alternative templating languages