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.4.2.tar.gz (23.2 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.4.2-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for toopdf-0.4.2.tar.gz
Algorithm Hash digest
SHA256 5932bb612ceda8657d1ca7d11a56b16b89b4b78f016f38fc3bc90e8773444d7a
MD5 d6475f605b5ce82f25c4cc38c7c98447
BLAKE2b-256 e85ff919b3daadd39aaf320234204df2d51b9d96129682cc215c57a4cfa3eff9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: toopdf-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 19.2 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.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5132e32e9e5be11c0ab1f0dddbac76b9e9b7e4a65a872920720be036d7326cd7
MD5 e828f93111423aa512df59cad25cfa78
BLAKE2b-256 028706b20817e83e6549cf999e7f2e7aeaf31af9e8e2309ecae8369a355f706e

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