semvec/pypi-packages huggingface dataset:
pyutil-juposs 2.1.0
A python utility package
Requires Python: >=3.6

# How to install?

python3 -m pip install --upgrade pip

pip3 install pyutil-juposs

# Defaults
Custom defaults can be stored in $HOME/pyutil_settings.json

See https://github.com/juposs/pyutil/blob/master/pyutil_settings.json_sample

Everything that is not defined in $HOME/pyutil_settings.json will be read from

"$HOME/.local/lib/python3.X/site-packages/pyutil/defaults.py" depending on your installed python version

# Usage:
1. ldap:
This will search for ldap object where userPrincipalName equals john.doe@example.org and return the value of pwdlastlet to the variable "result" and return whatever is in extensionAttribute12 to variable "result2"
```
        from pyutil import Ldap

        Modify defaults and use the minumum parameters:
        instance = Ldap("binduser@example.org", "strongpass", "john.doe@example.org")

        or give all parameters:
        instance = Ldap("binduser@example.org", "strongpass", "john.doe@example.org", "userPrincipalName", "OU=OrgUnit,DC=example,DC=org", "server.example.org")

        then run query with that instance:
        result = instance.query("pwdlastset")
        result2 = instance.query("extensionAttribute12")
```
2. mail:
```
        from pyutil import Mail

        Modify defaults and use the minumum parameters:
        instance = Mail()

        or give all parameters:
        email = Mail("no-rely@example.org", "mailserver.example.org", "25", true, "/path/to/myfile.txt")
        email = Mail("no-rely@example.org", "mailserver.example.org", "25", false)

        then send the mail with that instance:
        instance.send(subject, text, receipient1 [, receipient2])
```
3. logging:
```
        from pyutil import Logger

        Modify defaults and use the minumum parameters:
        logfile1 = Logger()

        or give all parameters:
        logfile1 = Logger("/path/to/logfile", maxBytes=1000, backupCount=10)

        Logfile will rotate after reaching maxBytes, default is '0', never rotate
        If rotation enabled, it will keep 'backupCount' files, default is 10

        then log stuff, for instance:
        log1.info("info")
        log1.warning("Warning")
        log1.error("Error")
        log1.debug("Debug")
```
dsdatabase 0.1.0
DesignSafe relational database connection scripts
Requires Python: >=3.9

# DS Database

[![build and test](https://github.com/DesignSafe-CI/dsdatabase/actions/workflows/build-test.yml/badge.svg)](https://github.com/DesignSafe-CI/dsdatabase/actions/workflows/build-test.yml)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)

`dsdatabase` is a library that simplifies accessing databases on [DesignSafe](https://designsafe-ci.org) via [Jupyter Notebooks](https://jupyter.designsafe-ci.org).

## Features

Connects to SQL databases on DesignSafe:

| Database | dbname | env_prefix |
|----------|--------|------------|
| NGL | `ngl`| `NGL_` |
| Earthake Recovery | `eq` | `EQ_` |
| Vp | `vp` | `VP_` |

Define the following environment variables:
```
{env_prefix}DB_USER
{env_prefix}DB_PASSWORD
{env_prefix}DB_HOST
{env_prefix}DB_PORT
```

For e.g., to add the environment variable `NGL_DB_USER` edit `~/.bashrc`, `~/.zshrc`, or a similar shell-specific configuration file for the current user and add `export NGL_DB_USER="dspublic"`.

## Installation

Install `dsdatabase` via pip

```shell
pip3 install dsdatabase
```

To install the current development version of the library use:

```shell
pip install git+https://github.com/DesignSafe-CI/dsdatabase.git --quiet
```

## Example usage:
```python
from dsdatabase.db import DSDatabase

db = DSDatabase("ngl")
sql = 'SELECT * FROM SITE'
df = db.read_sql(sql)
print(df)

# Optionally, close the database connection when done
db.close()
```
cannoli 0.1.27
Lib for prompt engineering using OpenAI

# cannoli

#### Install

`!pip install cannoli`

#### Usage Instructions:

**Basic Usage:**

This example demonstrates how to retrieve the API key from an environment variable named `OPENAI_API_KEY`. It also shows how to use default parameters defined in `default_settings.json`.

```python
# Create an instance of the Cannoli class
cnl = Cannoli()

# Ask a question with the quick_question method and store the response in 'ans'
ans = cnl.quick_question("What's the boiling point of water?")
```

**Customizing Parameters:**

In this example, the Cannoli class instance is created with a user-provided API key and custom settings, including the choice of engine, custom prompt, token limits, and temperature settings.

```python
# Instantiate the Cannoli class with a custom API key and setup parameters
api_key = 'your_api_key_here'
setup = {
    "engine": "gpt-3.5-turbo-instruct",
    "prompt": "You are my personal assistant. Please provide the best answer you can.",
    "max_tokens": 300,
    "temperature": 0.7
}
cnl = Cannoli(api_key=api_key, setup=setup)

# Use the quick_question method to ask a question and store the answer in 'ans'
ans = cnl.quick_question("What's the boiling point of water?")
```