semvec/pypi-packages huggingface dataset:
ddmail-backup-taker 0.0.1
Program to take backups for the DDMail project.
Requires Python: >=3.8

# What is ddmail_backup_taker
Application to handle backups for the DDMail project.

## Features
- Backups of folders/files and mariadb databases.
- Storing backups in encrypted form "at rest" using OpenPGP.
- Sending backups offsite using ddmail_backup_receiver.

## What is DDMail
DDMail is a e-mail system/service that prioritizes security. A current production example can be found at www.ddmail.se

## Operating system
Developt for and tested on debian 12.

## Installing using pip
`pip install ddmail-backup-taker`

## Building and installing from source using hatchling.
Step 1: clone github repo<br>
`git clone https://github.com/drzobin/ddmail_backup_taker [code path]`<br>
`cd [code path]`<br>
<br>
Step 2: Setup python virtual environments<br>
`python -m venv [venv path]`<br>
`source [venv path]/bin/activate`<br>
<br>
Step 3: Install package and required dependencies<br>
`pip install -e .[dev]`<br>
<br>
Step 4: Build package<br>
`python -m pip install --upgrade build`<br>
`python -m build`<br>
<br>
Packages is now located under dist folder<br>
<br>
Step 5: Install package<br>
`pip install dist/[package name].whl`<br>

## Running
`source [ddmail_backup_taker venv]/bin/activate`<br>
`ddmail_backup_taker --config-file [config file path]`<br>

## Testing
`cd [code path]`<br>
`pytest --cov=ddmail_backup_taker tests/ --config=[config file path]`

## Coding
Follow PEP8 and PEP257. Use ruff for linting. Strive for 100% test coverage.
prompt4py 0.0.5
Programmatic prompt template for Python.
Requires Python: >=3.10

# *Prompt4Py*

*Programmatic prompt template for Python.*

## Installation

```
pip install -U prompt4py
```

## Quick Start

1. Create a prompt template

    ```python
    from prompt4py import GeneralTemplate

    # Create your prompt template
    prompt_template = GeneralTemplate()
    prompt_template.role = 'An NER machine'
    prompt_template.objective = 'Extract all {{entity_type}} from CONTEXT.'
    prompt_template.instruction = {
        1: 'Think deeply on every entities in CONTEXT',
        2: 'Extract all {{entity_type}}',
        3: 'Output the entities you have extracted'
    }
    prompt_template.constraint = 'Do not include any markdown grams'
    prompt_template.capability = 'Extract entities'
    prompt_template.context = '{{ent_1}}, {{ent_2}}, {{ent_3}}'
    prompt_template.output_dtype = 'str'
    prompt_template.output_format = 'jsonl'
    prompt_template.output_example = str([
        {
            'entity_type': '{{example_entity_type_1}}',
            'entity_text': '{{example_entity_text_1}}'
        }
    ])
    ```

2. Render the template

    ```python
    # Render the template
    prompt = prompt_template.render(entity_type='PERSON', ent_1='John Lennon', ent_2='Joe Biden', ent_3='Charlemagne',
                                    example_entity_type_1='PERSON', example_entity_text_1='Elizabeth')
    print(prompt)
    ```

    the prompt would be rendered like this:

    ```markdown
    ## _TIMESTAMP
    [82159.8475038]
    ## ROLE
    An NER machine
    ## OBJECTIVE
    Extract all PERSON from CONTEXT.
    ## INSTRUCTION
    - **1**: Think deeply on every entities in CONTEXT 
    - **2**: Extract all PERSON 
    - **3**: Output the entities you have extracted 
    ## CONSTRAINT
    Do not include any markdown grams
    ## CAPABILITY
    Extract entities
    ## CONTEXT
    John Lennon, Joe Biden, Charlemagne
    ## OUTPUT_DATATYPE
    str
    ## OUTPUT_FORMAT
    jsonl
    ## OUTPUT_EXAMPLE
    [{'entity_type': 'PERSON', 'entity_text': 'Elizabeth'}]
    ```

3. Invoke a chatbot / causal language model

    You would get response like below:

    ```
    {"entity_type": "PERSON", "entity_text": "John Lennon"}
    {"entity_type": "PERSON", "entity_text": "Joe Biden"}
    {"entity_type": "PERSON", "entity_text": "Charlemagne"}
    ```