Skip to main content

Toopdf

Brauzersiz PDF bilan ishlash vositasi. Terminal va Telegram orqali PDF tarjima, konvertatsiya va boshqa amallar.

๐Ÿ’ก Barcha vositalar bepul! Hech qanday to'lov yoki obuna talab qilinmaydi. PDF bilan bog'liq barcha amallarni tekin bajaring.

๐ŸŒ Web interfeys (Streamlit)

Brauzer orqali ishlash uchun:

Streamlit Community Cloud (kelajakda)

Yoki local ishga tushirish:

pip install streamlit toopdf
streamlit run app.py

Web interfeysda:

  1. PDF fayl yuklang
  2. Vositani tanlang
  3. "Ishga tushirish" tugmasini bosing
  4. Natijani yuklab oling

Imkoniyatlar

  • 30+ PDF vosita โ€” tarjima, konvertatsiya, merge, split, OCR, watermark, encrypt/unlock
  • Batch ishlov โ€” bir necha faylni birdaniga qayta ishlash
  • Telegram bot โ€” mobil orqali PDF ishlash
  • Chiroyli CLI โ€” progress bar, rangli output, avtoto'ldirish
  • Stealth โ€” brauzerdek soxta headerlar, delay, cookie saqlash
  • Xavfsiz โ€” input validatsiya, rate limiting, shifrlangan cookie'lar

O'rnatish

# CLI uchun
pip install toopdf

# Telegram bot bilan
pip install toopdf[bot]

Ishlatish

1. ๐Ÿ“‹ CLI orqali

# Vositalar ro'yxati
toopdf list

# PDF tarjima (en โ†’ uz)
toopdf translate test.pdf --from en --to uz

# PDF konvertatsiya
toopdf convert pdf-to-word test.pdf
toopdf convert pdf-to-jpg test.pdf

# PDF yuklash (qayta ishlashsiz)
toopdf upload test.pdf

# Batch ishlov (bir necha faylni birdan)
toopdf batch *.pdf --tool pdf-to-word

# Konfiguratsiya
toopdf config

# Yordam
toopdf --help
toopdf translate --help

2. ๐Ÿค– Telegram Bot orqali

# Botni ishga tushirish
export TOOPDF_BOT_TOKEN="your:bot_token"
toopdf-bot

Bot qanday ishlaydi:

  1. Botga /start yuboring
  2. PDF fayl yuboring
  3. Kategoriya va vositani tanlang (inline tugmalar)
  4. Natijani oling

Bot buyruqlari:

  • /start โ€” ishga tushirish
  • /list โ€” vositalar ro'yxati
  • /help โ€” yordam
  • /cancel โ€” bekor qilish

Bot sozlamalari:

TOOPDF_BOT_TOKEN=123456:ABCdef     # @BotFather dan oling
TOOPDF_BOT_ALLOWED_USERS=123,456   # Kim foydalanishi mumkin (bo'sh = hamma)

3. ๐Ÿ Python API orqali

# Sync usul (oddiy skriptlar uchun)
from toopdf import Toopdf

with Toopdf() as api:
    # Vositlarni ro'yxat qilish
    tools = api.list_tools()
    print(tools)

    # Tarjima qilish
    result = api.translate("document.pdf", from_lang="en", to_lang="uz")
    print(f"Natija: {result}")

    # Konvertatsiya qilish
    result = api.convert("pdf-to-word", "document.pdf")
    print(f"Natija: {result}")
# Async usul (yuqori samaradorlik)
from toopdf import ToopdfClient
import asyncio

async def main():
    async with ToopdfClient(api_key="your-key") as api:
        tools = await api.list_tools()
        print(f"{len(tools)} ta vosita topildi")

        # Yuklash va konvertatsiya
        upload = await api.upload("document.pdf")
        result = await api.convert(upload.file_id, "pdf-to-word")
        await api.download(result.download_url, "result.docx")

asyncio.run(main())

Xavfsizlik

Xususiyat Tavsif
Input validatsiya Fayl yo'li, til kodi, vosita nomi tekshiriladi
File size limit Katta fayllar rad etiladi (sozlash mumkin)
Path traversal ../ bloklanadi
Rate limiting So'rovlar soni cheklangan (sozlash mumkin)
Encrypted cookies Shifrlangan cookie saqlash
Logging Barcha hodisalar yoziladi

Konfiguratsiya

.env fayl orqali yoki environment variable'lar bilan:

TOOPDF_MAX_FILE_SIZE_MB=50
TOOPDF_RATE_LIMIT_PER_MINUTE=10
TOOPDF_LOG_LEVEL=INFO
TOOPDF_BOT_TOKEN=your:bot_token
TOOPDF_BOT_ALLOWED_USERS=123456789

Loyiha tuzilmasi

toopdf/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ toopdf/
โ”‚       โ”œโ”€โ”€ __init__.py      # Paket init
โ”‚       โ”œโ”€โ”€ bot.py            # Telegram bot
โ”‚       โ”œโ”€โ”€ cli.py            # CLI interfeys (typer)
โ”‚       โ”œโ”€โ”€ client.py         # Asosiy kutubxona (httpx)
โ”‚       โ”œโ”€โ”€ config.py         # Konfiguratsiya (pydantic)
โ”‚       โ””โ”€โ”€ exceptions.py     # Xatolik klasslari
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ conftest.py           # Pytest fixture'lar
โ”‚   โ”œโ”€โ”€ test_client.py        # Client testlari
โ”‚   โ””โ”€โ”€ test_cli.py           # CLI testlari
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

Testlar

pip install -e ".[dev]"
pytest

Litsenziya

MIT

Download files

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

Source Distribution

toopdf-0.3.2.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

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

toopdf-0.3.2-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file toopdf-0.3.2.tar.gz.

File metadata

  • Download URL: toopdf-0.3.2.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for toopdf-0.3.2.tar.gz
Algorithm Hash digest
SHA256 4fe9f15c00c3aa7c2e40d0c86e186fff11c5d22643061873cf1cca86b5cf7ca2
MD5 0b91a321f26bdcff0d4ebffd5b412be4
BLAKE2b-256 e5f96d5fc88fbbed836c9411361152cdcbfd0317397d568d6b3f362f074c64f9

See more details on using hashes here.

File details

Details for the file toopdf-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: toopdf-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for toopdf-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf92709f40283c8bcb57ee85cbaff0884371d7eeef034d5af70e4475c8a6fb14
MD5 5cedd28c6c8257ebd7fdb8b2a1e4c638
BLAKE2b-256 c938ecd19178c6549bf4ea7bad6f2367ddbbbab4e7a4c52a7e84234e2bd54318

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