Skip to main content

KanTeX

KanTeX is a library that allow you to layout and format text using python. It is mainly intended to be used with Telegram Userbots and Bots.

KanTeX defaults to markdown but can be switched to using html by using from kantex.html import *. To be explicit about using Markdown, from kantex.md import * can be used.

Examples

from kantex.md import *

doc = KanTeXDocument(
    Section('A Section',
            Italic('A italic Text'),
            Mention('Telegram', 777000)))
print(doc)

Result:

**A Section**
    __A italic Text__
    [Telegram](tg://user?id=777000)

from kantex.html import *

doc = KanTeXDocument(
    Section('A Section',
            Italic('A italic Text'),
            Mention('Telegram', 777000)))
print(doc)

Result:

<b>A Section</b>
    <i>A italic Text</i>
    <a href="tg://user?id=777000">Telegram</a>

from kantex.md import *

doc = KanTeXDocument()
for i in range(5):
    sec = Section(f'Section {i}')
    for n in range(2):
        sec.append(KeyValueItem(i, n))
    doc.append(sec)


print(doc)

Result:

**Section 0**
    0: 0
    0: 1

**Section 1**
    1: 0
    1: 1

**Section 2**
    2: 0
    2: 1

**Section 3**
    3: 0
    3: 1

**Section 4**
    4: 0
    4: 1

from kantex import *

doc = KanTeXDocument(
    Section('Nested',
            SubSection('Sections',
                       Italic('work too'))))

print(doc)

Result:

**Nested**
    **Sections**
        __work too__

Metadata

Release files for kantex 0.2.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 kantex 0.2.0
File Size Uploaded Provenance Actions
kantex-0.2.0.tar.gz 5.3 kB Without provenance Details for kantex-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.4 kB

Release files / kantex-0.2.0.tar.gz

Download URL kantex-0.2.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
77742cd70f38e0ea71eca601c98f3c2d044cbd9bf9088a6e3b418667f619187a
BLAKE2b-256 checksum
How to use checksums
a4d5c129c60d2680347d80252d2969af0e318599454e6391f78c7ea968df78fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

Release files / kantex-0.2.0-py3-none-any.whl

Download URL kantex-0.2.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af26c41577d621311386fbb422dba847e92e9f0ed701f402b2d6184e7f409b98
BLAKE2b-256 checksum
How to use checksums
dd3426e1b7e766e96d0a5b1dc8a22b8e1f4c7857ae6df4f083ea6c67ca43522d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

Security for kantex 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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