Metadata-Version: 2.1
Name: tsqlite
Version: 0.2.0
Summary: A Python library for managing and syncing SQLite databases over Telegram channels with secure encryption.
Home-page: https://github.com/sina8013/TSQL
Author: Sina Saeedi
Author-email: sina8013@gmail.com
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Database :: Database Engines/Servers
Classifier: Topic :: Communications :: Chat
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: telethon >=1.24.0
Requires-Dist: pycryptodome >=3.15.0
Requires-Dist: pandas >=1.3.0

# 🚀 TSQL - Telegram SQLite Library

TSQL is a powerful Python library that synchronizes and manages SQLite databases through **Telegram channels**. With advanced encryption and real-time updates, TSQL makes database management and sharing simple and secure. 📦✨

---

## 🔑 Key Features

- **🔗 Telegram Integration**: Sync your SQLite database with Telegram channels seamlessly.
- **🔒 End-to-End Encryption**: Ensure data security using AES encryption.
- **⚡ Real-Time Updates**: Automatically manage database changes.
- **📊 Query Execution**: Execute custom SQL queries with ease.
- **📂 In-Memory SQLite**: Leverage fast and efficient in-memory SQLite databases.

---

## 🛠️ Installation

To install TSQL, use pip:

```bash
pip install tsqlite
```

---

## 📖 Usage

Here's how you can get started with TSQL:

```python
from tsql import TSQL
import asyncio

# Initialize the TSQL object
db = TSQL(
    api_id="12345",  # Your Telegram API ID
    api_hash="abcdef123456",  # Your Telegram API hash
    sessionName="my_session",  # Telegram session name
    chanellInviteLink="https://t.me/my_channel",  # Telegram channel invite link
    databaseStructurePath="db_structure.json",  # Path to your database structure file
    encryptKey="my_secret_key"  # (Optional) Encryption key for securing data
)

# Run asynchronously
async def main():
    await db.connect()  # Connect to Telegram
    await db.initDatabase()  # Initialize the database

    # Example: Execute a SELECT query
    result = await db.select("SELECT * FROM my_table;")
    print(result)

    # Example: Insert new data
    await db.execute("INSERT INTO my_table (id, name) VALUES (1, 'John Doe');")

# Run the async function
asyncio.run(main())
```

---

## 📂 Example Database Structure

TSQL uses JSON files to define your database structure. Here's an example:

```json
{
  "my_table": [
    { "id": 1, "name": "John Doe" },
    { "id": 2, "name": "Jane Doe" }
  ],
  "my_table_2": [
    { "id": 1, "name": "John Doe 2" },
    { "id": 2, "name": "Jane Doe 2" }
  ],
  "my_table_3": [
    { "id": 1, "name": "John Doe 3" },
    { "id": 2, "name": "Jane Doe 3" }
  ]
}
```

---

## 🧪 Testing

To run tests, ensure `pytest` is installed:

```bash
pip install pytest
pytest tests/
```

---

## 🌟 Why Use TSQL?

- 💡 **Innovative**: Use Telegram channels as a database synchronization medium.
- 🔐 **Secure**: Built-in AES encryption for data privacy.
- 🔄 **Dynamic**: Manage your database in real-time.
- 💻 **Developer-Friendly**: Easy-to-use interface for database operations.

---

## 👩‍💻 Contributing

We welcome contributions! Feel free to:

1. Fork the repo.
2. Create a feature branch: `git checkout -b feature-name`.
3. Commit your changes: `git commit -m 'Add feature'`.
4. Push the branch: `git push origin feature-name`.
5. Open a pull request.

---

## 📜 License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

---

## 📞 Contact

Have questions or need support? Feel free to reach out:

- **Telegram**: [@sina8013](https://t.me/sina8013)
- **Email**: sina8013@gmail.com

---

## 🚀 Get Started Today!

TSQL is the ultimate tool for managing and syncing your SQLite databases via Telegram. Install it now and simplify your database management process! 🎉
