Skip to main content

TGPhind

PyPI version Downloads Python versions License GitHub stars

TGPhind is a multithreaded tool and Python library for searching articles by title and template on Telegra.ph and its mirrors (Graph.org, Te.legra.ph).

Features

  • Multithreaded article availability checking with configurable worker threads.
  • Flexible article title template generator supporting ranges and letter sets.
  • Automatic transliteration of Cyrillic titles into URL-compatible slugs.
  • Support for HTTP/HTTPS proxies.
  • Automatic mirror verification and URL mapping.
  • Command-line interface (CLI) and Python API.

Installation

Install via pip:

pip install tgphind

Or via poetry:

poetry add tgphind

Quick Start

Python API Usage

from tgphind import TGPhind, Proxy

# Initialize the search engine
se = TGPhind(
    max_th=16,  # Worker threads count (defaults to CPU count)
    proxy=None,  # Optional Proxy(host='...', protocol='https')
    brackets='<>'  # Template delimiter brackets
)

# Search articles using a template pattern
results = se.search('article<s>-<a-d>')

# Map results across available mirrors
mapped_urls = se.map_hosts(results)

for urls in mapped_urls:
    for url in urls:
        print(url)

CLI Usage

Execute directly via the installed executable:

tgphind "article-<1-3>" -tc 8

Or run via the Python module:

python -m tgphind "article<s>-<a-d>" -tc 16

Command-line Options

  • query (required): Article title or pattern string.
  • -tc, --threads-count: Number of threads to execute queries.
  • -b, --brackets: Custom template bracket delimiters (default: <>).
  • -x, --proxy: Proxy string formatted as protocol://host:port.

Template Syntax

The search pattern generator expands patterns wrapped inside bracket delimiters <>:

  • Single character: <s generates s and an empty string.
  • Character ranges: <a-d> expands to a, b, c, d.
  • Character sets: <abc> generates a, b, c.
  • Step ranges: <a2g> generates characters with step 2 (a, c, e, g).

Example Expansion

Pattern article<s>-<a-d> generates the following titles:

  • article-a, article-b, article-c, article-d
  • articles-a, articles-b, articles-c, articles-d

Each expanded title is tested against publication date patterns (MM-DD) and index suffixes (-2, -3, etc.).

Supported Mirrors

TGPhind automatically tests and maps links across these domains:

  • telegra.ph
  • graph.org
  • te.legra.ph

License

This project is licensed under the MIT License.

Release files for tgphind 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tgphind 1.1.0
File Size Uploaded
tgphind-1.1.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tgphind 1.1.0
File Interpreter ABI Platform
tgphind-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 kB

Release files / tgphind-1.1.0.tar.gz

Download URL tgphind-1.1.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7a4f620cf83aa87dd984e3c4c9ef8cff48735a2d2e7dd3470b006dec70721da7
BLAKE2b-256 checksum
How to use checksums
d6a7a5fcf7be897fcb0e8721a157b3e495f3e7dae68b75d179467abcc8891505
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.14 Linux/7.1.4-zen1

Release files / tgphind-1.1.0-py3-none-any.whl

Download URL tgphind-1.1.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66b71265f292347d0f9f53d83c8a64619116a1929ca24baf05f12beee63cfb1d
BLAKE2b-256 checksum
How to use checksums
0cf2ddbf972a7a86157e63e895528a9f59cb7b8f7f1a3ced02e46659d4ece83b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.14 Linux/7.1.4-zen1

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page