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.1.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.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tsqlite-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 cb59bee918b8c23886a37b4f07ceabf15db2443cf296a1caf258ddd5fbb0e828
MD5 68b6f6c98a95886a2917a2457ce69efc
BLAKE2b-256 9a2b43e602ee89588a048c75ddbcb619bb38978ed85e20bfc8c4d0087196f0b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tsqlite-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee76dd7a4353cf95f1c0053bb84762c4e14883d0803257a66832f932df2d6425
MD5 247ddb64c9776d875858941870a2ec4d
BLAKE2b-256 ab2cc155628f374fbe9ebea36fd71329c02a3597bc1bad6ccf32a033c4e4b681

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