semvec/pypi-packages huggingface dataset:
uniorm 1.0.0
Universal Async ORM for SQLite, MySQL, and PostgreSQL
Requires Python: >=3.9

# UniORM

**UniORM** — SQLite, MySQL va PostgreSQL bilan ishlovchi **universal async ORM**.  
Oddiy API, Django’ga o‘xshash model tizimi va kuchli query builder’ga ega.

---

## 🚀 Xususiyatlar

- ✅ Async (async/await)
- ✅ SQLite, MySQL, PostgreSQL
- ✅ Model + Field tizimi
- ✅ QueryBuilder & Q object
- ✅ Migratsiyalar
- ✅ Minimal va yengil

---

## 📦 O‘rnatish

```bash
pip install uniorm
````

Yoki manbadan:

```bash
git clone https://github.com/yourusername/uniorm.git
cd uniorm
pip install -e .
```

---

## 🔌 Database ulash

### SQLite

```python
from uniorm import SqliteDatabase

db = SqliteDatabase("db.sqlite3")
```

### MySQL

```python
from uniorm import MySQLDatabase

db = MySQLDatabase(
    database="test",
    user="root",
    password="password",
    host="localhost"
)
```

### PostgreSQL

```python
from uniorm import PostgreSQLDatabase

db = PostgreSQLDatabase(
    database="test",
    user="postgres",
    password="password"
)
```

---

## 🧱 Model yaratish

```python
from uniorm import Model, CharField, IntField

class User(Model):
    name = CharField(max_length=100)
    age = IntField()

    class Meta:
        database = db
```

---

## ✏️ CRUD amallar

### Create

```python
user = await User.create(name="Ali", age=20)
```

### Read

```python
user = await User.get(id=1)
users = await User.filter(age__gte=18)
```

### Update

```python
user.age = 21
await user.save()
```

### Delete

```python
await user.delete()
```

---

## 🔍 QueryBuilder

```python
from uniorm import Q

users = await User.select().where(
    Q(age__gte=18) & Q(name__contains="a")
).order_by("-age").limit(10).execute()
```

---

## 🔄 Migratsiyalar

```python
from uniorm import MigrationManager

manager = MigrationManager(db)
await manager.init()
manager.make_migrations([User])
await manager.migrate()
```

---

## ⚠️ Talablar

* Python 3.9+
* aiosqlite (SQLite)
* asyncmy (MySQL)
* psycopg[binary] (PostgreSQL)
chatrepl 0.2.0a1
A Python 2.7+ REPL for interacting with LLMs with an OpenAI Chat Completions-compatible API.
Requires Python: >=2

A Python 2.7+ REPL for interacting with LLMs with an OpenAI Chat Completions-compatible API.

## Features

- **Minimal Dependencies:** Works with stock Python 2.7+ and 3.x
- **Python-Powered REPL:** Native interactive shell with special chat commands as Python functions
- **Streaming Responses:** See model replies as they're generated
- **Multiline Editing:** Use your default editor for long/structured prompts
- **File & Image Support:** Attach text files or images to your conversation
- **Conversation Persistence:** Save/load full conversations as JSON
- **Markdown Export:** Archive conversations in Markdown for easy reference
- **Enhanced Input:** Optional readline support for history and line editing
- **Dual Modes:** Both interactive REPL and pipe-friendly CLI

## Installation

```bash
pip install chatrepl
```

## Interactive Mode (CLI)

```bash
python -m chatrepl \
  --api-key "your-api-key" \
  --base-url "https://api.openai.com/v1" \
  --model "gpt-4o"
```

You'll get a Python shell preloaded with chat helper functions:

| Function               | Description                              |
|------------------------|------------------------------------------|
| `send(text)`           | Send a message and stream the response   |
| `append(text)`         | Append text to conversation (don't send) |
| `multiline()`          | Append multiline input via your editor   |
| `img(img_file_path)`   | Append an image file                     |
| `txt(txt_file_path)`   | Append a text file                       |
| `load(json_file_path)` | Load conversation from JSON              |
| `save(json_file_path)` | Save conversation to JSON                |
| `export(md_file_path)` | Export conversation to Markdown          |
| `correct()`            | Correct (edit) last model response       |

 `exit()` or EOF (`Ctrl-D` on Unix) leaves REPL.

### Basic Example

```text
Welcome to ChatREPL! Use the following commands to interact with gpt-4o:

>>> send('Explain recursion.')
Assistant: Sure! Recursion is...

>>> multiline()
(opens your editor for multiline input)

>>> img('diagram.png')
(appends the given image to the conversation)

>>> send('Describe this image.')
Assistant: ...

>>> save('chat.json')
(saves the entire chat so far)
```

## Non-interactive Mode (Piped Input)

```bash
$ uname -a | python -m chatrepl --api-key <your_api_key> --base-url <your_base_url> --model <model_name>
The output you've provided appears to be system information from ... [output streamed to STDOUT]
```

## Programmatic Usage (API)

See [chat-completions-conversation](https://github.com/jifengwu2k/chat-completions-conversation).

## Contributing

Contributions are welcome! Please submit pull requests or open issues on the GitHub repository.

## License

This project is licensed under the [MIT License](LICENSE).