Skip to main content

Single-shot CLI for sending text plus an optional file to Telegram.

Project description

tg-push

Python CLI for sending text plus an optional file to Telegram.

There is no bot polling loop, no MCP bridge, and no long-running server, just simple one-way messages.

Install

pip install tg-push

Or with pipx for an isolated install:

pipx install tg-push

Environment

Variable Required Description
TG_BOT_TOKEN yes Telegram bot token from @BotFather
TG_CHAT_ID yes Target chat ID or @channelusername

For a 1:1 bot chat, TG_CHAT_ID is your Telegram user id. For groups and channels, use the actual chat id instead.

Usage

tg-push --text "build finished"
tg-push --file ./render.png
tg-push --text "latest render" --file ./render.png
tg-push --text "report" --file ./report.pdf

Behavior

  • At least one of --text or --file is required.
  • If --file is present, recognized images and videos are sent as Telegram media.
  • Other files are sent as documents, so PDFs, archives, and extensionless files work.
  • Supported image extensions: .jpg, .jpeg, .png, .webp
  • Supported video extensions: .mp4, .mov, .m4v, .webm, .mkv, .avi
  • If --text is longer than Telegram's media caption limit, the file is sent first and the text is sent as follow-up messages.
  • The project has no runtime dependencies outside the Python standard library.

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

tg_push-2.0.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

tg_push-2.0.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file tg_push-2.0.2.tar.gz.

File metadata

  • Download URL: tg_push-2.0.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for tg_push-2.0.2.tar.gz
Algorithm Hash digest
SHA256 e4f995d43ebf88612f20d95c3afc3f40a42f1f7a756db347835b78406de44512
MD5 7268a52e7482eac17fe67486f9c61715
BLAKE2b-256 d705e58086da9119a540d478e8152da23ac983672a016713a1772ca072f10437

See more details on using hashes here.

File details

Details for the file tg_push-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: tg_push-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for tg_push-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 431da1158e4ce98eff68568379ce541b41aa1609a3e73da4d00386c693271c8a
MD5 c2e9459afe6d4d7984a74a46cdfebacd
BLAKE2b-256 e918e9e93b869bf1651259288b36dbe69c92267db7d4187c01cdb986e0414e99

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