Skip to main content

A Python library for managing and syncing SQLite databases over Telegram channels with secure encryption.

Project description

🚀 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:

pip install tsqlite

📖 Usage

Here's how you can get started with TSQL:

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:

{
  "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:

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 file for details.


📞 Contact

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


🚀 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! 🎉

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsqlite-0.2.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsqlite-0.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file tsqlite-0.2.0.tar.gz.

File metadata

  • Download URL: tsqlite-0.2.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for tsqlite-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7308548d306c2ffda4d21ff81a68fa31c4ed34544bb311d84c1fb89c608777d1
MD5 4af5c5f920f870101bc3b08360d814f2
BLAKE2b-256 55a9dc3cf37b18cf1d9298135bafb712bb4c1be5ba4ca7866e51a6844e3e50b4

See more details on using hashes here.

File details

Details for the file tsqlite-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tsqlite-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for tsqlite-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3fbc9c6fcaad77636950a682ef82f15a8f3143f82ea02d30e333e2f9d17a410
MD5 43b2683a7c8285ca1686ffab1f1f6aef
BLAKE2b-256 4c2507286549f8d97751f4100f244842746b9df770b55e7e3fffddfd85d6e32b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page