Skip to main content

textseek

English | Русский

Zero-dependency Python library for searching and extracting structured data — confirmation codes, links, and arbitrary regex matches — from plain text.

textseek is not tied to any source: the text may come from email, SMS, HTML, an API response, logs, OCR, or anywhere else. Fetching text is your job; pulling structured values out of it is textseek's.

Install

pip install textseek

Requires Python 3.12+. No runtime dependencies.

Quickstart

from textseek import TextSeek, Extract

text = "Your verification code is 123456"

seek = TextSeek(text)
result = seek.extract_one(Extract.code(length=6, digits=True))

print(result.value)  # 123456

Extract a link and inspect its parts

link = TextSeek(text).extract_one(
    Extract.link(domain="example.com")
)
print(link.domain)              # example.com
print(link.path)                # /auth/magic
print(link.query_params["token"][0])

Find by example link

link = TextSeek(text).extract_one(
    Extract.link(sample="https://example.com/auth/magic?token=abc&email=test@example.com")
)

Arbitrary regex

order = TextSeek(text).extract_one(Extract.regex(r"Order ID:\s*([A-Z0-9\-]+)"))
print(order.value)

Methods

Method Returns
extract_one(spec) one result, or raises ExtractNotFoundError
extract_first(spec) first result, or None
extract_all(spec) list of results (possibly empty)
contains(spec) bool

See full documentation in docs/.

Metadata

Release files for textseek 0.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 textseek 0.1.0
File Size Uploaded
textseek-0.1.0.tar.gz 50.8 kB Details

Built distribution (wheel)

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

Total release size: 61.7 kB

Release files / textseek-0.1.0.tar.gz

Download URL textseek-0.1.0.tar.gz
Size 50.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e2144923ff7a88d0cbbc8f6c983c5964f0da21a3d00bd7efae7a9ac6d8aad338
BLAKE2b-256 checksum
How to use checksums
e4e19c03818cfc17460bc1236d8676a936a77c31263c829ffa313643508250c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / textseek-0.1.0-py3-none-any.whl

Download URL textseek-0.1.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d98f0abdb81d8aa6f09628cff34ed0b2566a8eb4130390b85a57422bef794366
BLAKE2b-256 checksum
How to use checksums
b22cae2a39680f7193fca4a243bfed7ff213745e1bdf2650da02b78307979b32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

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