Metadata-Version: 2.5
Name: teleglance
Version: 0.1.1
Summary: Async client for public Telegram channels via t.me web previews with no API keys or MTProto API
Project-URL: Homepage, https://github.com/NWGKGIT/TeleGlance
Project-URL: Repository, https://github.com/NWGKGIT/TeleGlance
Project-URL: Issues, https://github.com/NWGKGIT/TeleGlance/issues
Project-URL: Changelog, https://github.com/NWGKGIT/TeleGlance/blob/main/packages/python/CHANGELOG.md
Author: Nahom W.G
License: MIT
Keywords: async,channels,preview,scraper,t.me,telegram
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.7
Requires-Dist: selectolax>=0.3.21
Provides-Extra: cli
Requires-Dist: click>=8.1; extra == 'cli'
Provides-Extra: socks
Requires-Dist: httpx[socks]; extra == 'socks'
Description-Content-Type: text/markdown

# TeleGlance for Python

Async client for public Telegram channels via `t.me` web previews. No API keys, MTProto credentials, or Telegram account are required.

## Install

```sh
pip install teleglance
```

Python 3.10 or newer is required.

## Use

```python
import asyncio
from teleglance import TeleGlanceClient


async def main():
    async with TeleGlanceClient() as client:
        channel = await client.get_channel("telegram")
        print(channel.title)

        async for message in client.iter_messages("telegram", limit=10):
            print(message.id, message.text)


asyncio.run(main())
```

The package also provides typed models, checkpoints, media downloads, parser customization, and a `teleglance` command-line interface.

## JSON capture

Library results can be serialized with `dump_json` or saved safely with `capture_json`:

```python
from teleglance import capture_json

capture_json(messages, "messages.json")
```

The CLI writes JSON to standard output by default. Use `--output capture.json` to save `channel`, `messages`, or `search` output, or capture `watch` as NDJSON. Existing files require `--overwrite`.

## Development

```sh
uv sync --all-extras --group dev
uv run ruff check .
uv run mypy
uv run pytest --cov
```

Licensed under MIT. See [LICENSE](../../LICENSE).
