Developer guide and API map for the current toolbox.py module. This page is aligned with
__version__ = "1.6" and calls out optional dependencies, side effects, and compatibility behavior. The Matching section explains the algorithm selectors and compatibility defaults introduced in v1.6. Signatures in the complete source API are generated from the active module.
toolbox.py is a general-purpose utility module containing:
It is designed as a broad utility library for rapid Python development, especially in backend, data, and tooling workflows.
Import: the module is a single file, so consumers normally use
import toolbox or import selected names directly. Several integrations require optional
third-party packages or local data files; see the relevant section before deploying a feature.
The module combines unrelated but commonly useful utilities into a single file. Key themes include:
The standard library covers only part of the module. Dependencies are loaded at different times, so a successful
import toolbox does not prove that every feature is ready to use.
| Dependency | Used by | Loading behavior |
|---|---|---|
requests, urllib3 | Synchronous downloads and updater requests | requests is deferred until first attribute access. |
aiohttp, multidict | Async HTTP, service plugins, URL query data | Wrapped by DelayModuleLoad; a missing package may fail only when the feature is first used. |
rapidfuzz | Matching algorithms 2–5 | Optional import at module startup. RAPIDFUZZ_IMPORTED reports availability; pure-Python fallbacks are used when unavailable. Methods 0 and 1 do not use RapidFuzz. |
matplotlib | Statistical plotting | Optional and deferred. |
jsondb2, sqliteObj, aiosqliteObj | Queue/cache/database-backed features and plugins.UserManager | Imported conditionally. Missing aiosqliteObj no longer triggers installation at startup; UserManager may request it when used. sqliteObj may still be installed through the updater during import. |
pygments | HTML source/traceback formatting | Optional; formatter classes exist only when it imports. |
| Local data files | Country, Android-device, and user-agent helpers | Some lookups depend on resources available beside the application. |
Important: importing this module currently enables AUTO_UPDATER and calls
pmblue_update.self_update(). If pmblue_update is missing, the import path attempts to download it.
The missing-updater bootstrap still uses its legacy HTTP URL. Provision pmblue_update before import to avoid that bootstrap. Account for this network and file-write side effect in offline builds, tests, and restricted production environments.
Defers module import until the module is actually used.
DelayModuleLoad(module_name, name_as=None, module_to_globals=True)
__getattr__(self, name)
Loads the real module, optionally replaces the placeholder, then resolves the requested attribute.
asyncio = DelayModuleLoad("asyncio")
await asyncio.sleep(1)
Defined in the aiohttp feature block. Because aiohttp is represented by a deferred loader, a missing installation can surface on first request rather than at module import.
Wraps aiohttp responses in a more requests-like interface.
AiohttpResponse(response, elapsed, data)
| Property | Description |
|---|---|
| content | Raw response bytes |
| text | Decoded text using response encoding |
| json() | Parses JSON from content |
| status / status_code | HTTP status code |
| headers | Response headers |
| cookies | Cookie dictionary |
| url | Resolved response URL |
| elapsed | Request duration |
await AiohttpResponse.get(...)
await AiohttpResponse.post(...)
await AiohttpResponse.delete(...)
await AiohttpResponse.ping(...)
async def download_file_async(url, dest_path, chunk_size=1024*1024, verbose=False, as_gzip=False): ...
When as_gzip=True, pass a destination without a .gz suffix; the current implementation appends it.
def download_file(url, dest_path, chunk_size=1024*1024): ...
requests| Function | Description |
|---|---|
| dec_amt(n) | Applies variable decimal rounding based on magnitude |
| format_time_sec(sec) | Formats seconds or timedelta into ps/ns/us/ms/s/m/h/d/w |
| format_size(size) | Formats bytes into b/kb/mb/gb |
| format_number(number) | Adds commas and trims unnecessary decimals |
| format_currency(number) | Formats as $1,234.56 |
| format_name(name) | Normalizes capitalization for names |
Measures performance across a fixed number of iterations or a fixed time window.
tm = TestManager(trial_amt=1000)
@tm.test_func
def test():
pass
tm.run()
tm.print_results()
| Argument | Description |
|---|---|
| trial_amt | Number of iterations to run |
| trial_time | How long to keep iterating |
| test_trial | Whether to subtract loop overhead estimate |
| Method | Description |
|---|---|
| test_func(func) | Registers a test function |
| run() | Runs the registered test function |
| start_trial() | Starts manual timing |
| end_trial() | Ends manual timing |
| print_results() | Prints trial count, total duration, and average duration |
| txt_results() | Returns a text summary |
| Function | Description |
|---|---|
| remove_outliers(data) | Removes values outside 1.5 × IQR |
| get_sd_dev(data) | Computes mean absolute deviation-like value, not a classic standard deviation |
| get_total(data) | Sums values |
| get_median(data) | Median for sorted sequences |
| is_even(amt) | Returns parity boolean |
Analyzes numeric datasets and exposes cached summary statistics.
DataInfo(data)
| Property | Description |
|---|---|
| len | Dataset size |
| total | Sum of values |
| avg | Average |
| median | Median |
| mode | Most frequent value |
| iqr | First and third quartile pair |
| range | (min, max) |
| sd_dev | Sample standard deviation |
| avg_dev | Average absolute deviation from mean |
| skewed | Skew approximation using mean, median, and sd |
| Method | Description |
|---|---|
| sorted_data() | Sorts and returns dataset |
| avg_no_outliers() | Average excluding outliers |
| is_outlier(n) | IQR-based outlier test |
| get_zscore(n) | Returns z-score |
| get_item(n) | Returns DataInfo.Item for a value |
| get_percentile(n) | Returns percentile, including interpolation in some cases |
| info_txt() | Full text summary |
| basic_info_txt() | Reduced summary |
| print() | Prints full summary |
| basic_print() | Prints reduced summary |
Represents a distinct numeric value in the dataset.
| Attribute | Description |
|---|---|
| number | The numeric value |
| frequency | Count of occurrences |
| zscore | Cached z-score |
| is_outlier | Cached outlier status |
| percentile | Cached percentile |
Similar in structure to DataInfo, but designed for more general sortable values and supports reverse sorting.
Recursively computes total directory size.
FileInfo(x)
x may be a path-like value, an os.DirEntry, or a directory entry with callable is_dir()/stat(). Pass an existing FileInfo's path to construct fresh metadata. Paths are normalized to forward slashes, but relative inputs remain relative.
| Property | Description |
|---|---|
| name | Filename |
| path | Supplied path with forward-slash separators |
| is_dir | Whether entry is a directory |
| size | File size or recursive directory size |
| modified | Modification timestamp |
| created_at | Platform-dependent ctime, converted to local datetime |
| Method | Description |
|---|---|
| all_files() | Returns non-recursive file list |
| all_files_recursive() | Returns recursive file list |
Checks whether the given path exists and returns its FileInfo, or None.
Simple ASCII table builder.
| Method | Description |
|---|---|
| add_column(name, length=None) | Adds a column |
| add_row(*args) | Adds a row |
| print(limit=None, send=True) | Renders the table as text |
Enhanced table builder supporting text output, HTML export, searching, sorting, and Flask-friendly pagination.
| Method | Description |
|---|---|
| add_column(...) | Adds a column, optionally with computed/default values |
| insert_column(...) | Inserts a column at a position |
| add_row(...) | Adds a row |
| remove_column(col_num) | Removes a column |
| print(...) | Renders text table |
| to_html(...) | Renders table as HTML |
| flask_pagination(...) | Builds paginated, searchable, sortable output for Flask requests |
table.to_html(max_len=100, condensed=True)
flask_pagination() reads request args like page, rows_per_page, search, sort_by, case, and adv, then filters and formats the selected rows.
| Function | Description |
|---|---|
| iter_dict(d) | Generator yielding (key, value) |
| sort_dict(d, key=None, reverse=False) | Sorts dictionary items into a new ordered dictionary |
Attempts string-to-number conversion:
"123" → 123"12.3" → 12.3Static helpers for reading, writing, and condensing CSV data. The default result is a ListTable with header-indexed Row objects; as_list=True returns raw row lists, and row.dict() converts a row.
| Method | Use |
|---|---|
read(arg, has_headers=True, as_list=False) | CSV-aware parser; accepts the file-like inputs supported by the file conversion helpers. |
basic_read(arg, has_headers=True, as_list=False, forgiving=False, by_line=None) | Fast parser. forgiving tolerates malformed row widths; by_line supports large inputs without reading the entire file first. |
basic_read_threaded(..., amt_per_thread=20000, max_workers=None) | Splits parsing work across a thread pool. |
no_quotes_read(...) | Optimized path for data known not to contain quoted fields. |
condense(fp, has_headers=True, unique_only=False, remove_func=None, remove_columns=[]) | Reduces a CSV while optionally removing rows/columns and duplicate rows. |
write(rows) / write_file(fp, rows) | Serialize rows to CSV text or a destination. |
Avoid reusing and mutating the default list passed to remove_columns; pass an explicit list in new code.
| Type | Behavior |
|---|---|
ListTable(rows, has_headers=True, read_only=True) | Wraps row data with header-based access and exports individual rows with row.dict(); use a list comprehension for all rows. |
CacheList(max_cache_size=100) | List plus a lookup cache. Use get(key, default); mutating methods keep the cache synchronized. |
Unique(max_items=None) | List-like collection that prevents duplicates and can cap retained items. |
UniqueDict() | Stores unique values by type and exposes the flattened values through all(). |
ListIndex(d, key=str, f_idx=0, nested_indexes=None) | Binary-search-backed index with exact, case-insensitive, list, and index-returning lookups. |
SortedList(d, key=str, reverse=False) | Maintains sorted order when values are appended. |
AttrDict(data={}) | Intended dictionary wrapper with attribute access and get(); current constructor recursively accesses its unset storage and can raise RecursionError. Use a normal dict until repaired. |
merge_iters(*args) | Iterates several input iterables as one sequence. |
ReverseListIter(item) | Reverse iterator for list-like data. |
IterLoop(i) | Cycles repeatedly over an iterable. |
Related helpers are randomize_list, count_dict,
count_print, make_json_parsable, and dict_print.
| Descriptor | Behavior |
|---|---|
AsyncProperty | Allows an async method to be awaited through property syntax. |
CachedProperty(func=None, expire=None) | Caches an async or sync property per instance; supports expiration, explicit cache inspection, and replacement by assignment. |
ClassProperty | Evaluates a getter against the class rather than an instance. |
CachedClassProperty(func=None, expire=None) | Class-level cached property with optional expiration. |
class Service:
@CachedProperty(expire=60)
async def status(self):
return await load_status()
service = Service()
status = await service.status
These are custom descriptors. Async values use await obj.property, not a method call.
| API | Purpose |
|---|---|
StringInfo(s) | String inspection, character counts, average word length, checks, and URL discovery. |
LinkInfo(url) | URL decomposition, base URL, query-string parsing, hashing, and link discovery. |
TxtParser(format_txt, ..., handle_not_found=False, possible_chars=['[', ']']) | Extracts named variables from format patterns; supports optional segments and regex-backed parsing. |
TxtParserExp | Experimental parser variant with the same pattern-oriented interface. |
TxtParserBasic | Smaller parser without optional-character configuration. |
split / split_multi | Current regex-optimized case-sensitive or case-insensitive splitting functions. |
split_old / split_multi_old | Compatibility implementations retained for callers that depend on the previous behavior. |
Matching | Normalization-aware match/within and fuzzy equivalents with configurable thresholds. See the dedicated guide below. |
Additional small helpers include get_between, get_all_between,
extract_int, place_suffix, bytes_to_str,
word_to_digit, name_to_normal,
convert_to_normal, convert_to_single_letters, and the intentionally
misspelled compatibility function equivilency_convert.
get* methods use the ordinary random source. Prefer
secure_get, secure_get_alpha,
secure_get_num, or secure_get_alphanum for tokens and credentials.
These helpers are available in the current 1.6 source. The ID format combines a base62 Unix-millisecond timestamp prefix with a random alphanumeric suffix.
| API | Return and behavior |
|---|---|
base10_to_base36(n) | Integer to text using 0–9A–Z. |
base10_to_base62(n) | Integer to text using 0–9A–Za–z. |
peyton_day_timestamp(dt=None) | Integer millionths of a day since 2000-01-01 00:00:00 UTC. Uses current time when dt is omitted. |
peyton_id_prefix(dt=None, leading_zeros=True, granularity_level=0) | Base62 Unix-millisecond timestamp text, padded to eight characters by default. |
peyton_id_prefix_to_timestamp(prefix, granularity_level=0) | Decodes a 1–8-character base62 prefix to a naive local datetime, despite its timestamp-oriented name. |
peyton_id(dt=None, length=16, leading_zeros=True, granularity_level=0) | Timestamp prefix plus ordinary random suffix. |
peyton_id_secure(dt=None, length=16, leading_zeros=True, granularity_level=0) | Timestamp prefix plus a suffix generated with secrets. |
import datetime
import toolbox
created_at = datetime.datetime.now(datetime.timezone.utc)
record_id = toolbox.peyton_id(dt=created_at, length=24)
decoded_local_time = toolbox.peyton_id_prefix_to_timestamp(record_id[:8])
print(toolbox.base10_to_base36(35)) # Z
print(toolbox.base10_to_base62(61)) # z
secure_record_id = toolbox.peyton_id_secure(length=32)
granularity_level selects milliseconds (0, eight-character padding), 100 seconds (1, five-character padding), or 100000 seconds (2, three-character padding). Pass the same level when decoding; invalid levels raise ValueError. With leading_zeros=False, padding is omitted and the random suffix fills the requested total length.
The timestamp prefix is predictable and reveals approximate creation time; the secure variant only makes the suffix cryptographically random. Neither function checks for collisions or validates requested length. Supply an integer length greater than eight when randomness is required. The conversion functions require integers; negative values currently produce an empty string. Use timezone-aware datetime inputs when the intended epoch must be unambiguous.
For an opaque random token without a timestamp, use the existing RandomString.secure_get_alphanum(size) helper.
Matching compares complete strings or searches within longer text. Version 1.6 adds numbered algorithms and window modes. Both defaults remain 0 for legacy behavior; selecting an edit-distance algorithm does not automatically change the substring-search mode.
| matching_method | Algorithm | Score behavior |
|---|---|---|
| 0 (default) | Legacy positional | Fuzzy comparisons count equal paired positions and ignore unmatched trailing characters. The high-level exact path retains its original equality/wildcard behavior. |
| 1 | Positional | Counts mismatched positions and unmatched trailing characters. |
| 2 | Levenshtein | Counts insertions, deletions, and substitutions. |
| 3 | Optimal String Alignment (OSA) | Also allows adjacent swaps, with restrictions on overlapping edits. |
| 4 | Damerau-Levenshtein | Allows adjacent swaps and overlapping edits. |
| 5 | Jaro-Winkler | Character similarity with a shared-prefix bonus. |
Matching.Methods.select(str1, str2, matching_method=0) returns similarity between 0 and 1, where 1 means identical under the selected comparison. Methods 1–4 use 1 - distance / max(len(str1), len(str2)). Method 5 uses Jaro-Winkler similarity. Method 0 lowercases; methods 1–5 are case-sensitive at this low level. All six full-string methods score two empty strings as 1 and one empty string as 0.
When RAPIDFUZZ_IMPORTED is true, methods 2–5 use RapidFuzz. Otherwise they use the module's pure-Python implementations. No optional package is needed for the fallback path.
| within_method | Window selection |
|---|---|
| 0 (default) | Original substring behavior, always using legacy positional matching regardless of matching_method. |
| 1 | Fixed character windows with the query's length, scored using matching_method. |
| 2 | Consecutive word windows with the query's word count, ranked by normalized similarity using matching_method. Splits whitespace and rejoins with single spaces. Word boundaries are retained before optional space removal for scoring; extra middle names are not skipped. |
Matching.Methods.select_within(str1, str2, matching_method=0, within_method=0, ignore_spaces=False, match_asterisk=False) returns the best window similarity, or None if no window fits. An empty query returns 1. It does not apply the high-level normalization pipeline. Fixed character windows do not search variable-length substrings even when using an edit-distance algorithm.
Matching.Settings(
normalize=True,
extraneous_characters=False,
ignore_spaces=False,
match_asterisk=False,
fuzzy_threshold=1,
phonetic=False,
matching_method=None,
within_method=None,
)
Omitted or None method arguments resolve Matching.DEFAULT_MATCHING_METHOD and Matching.DEFAULT_WITHIN_METHOD when settings are created. Both initially equal 0. Existing settings keep their selections after class defaults change; pass explicit zeros to pin legacy behavior. Selectors accept integers 0–5 and 0–2 respectively; other values, including booleans, raise ValueError.
Calls to match() or within() without settings create fresh settings from the current method defaults and copy the other options from Matching.default_settings. Changing method fields on that template does not change the class method defaults.
| Setting | Default | Behavior |
|---|---|---|
normalize | True | Runs Unicode normalization and the module's transliteration rules; also lowercases. |
extraneous_characters | False | Collapses consecutive duplicate characters; does not remove punctuation. |
ignore_spaces | False | Removes ordinary spaces. Token mode preserves word boundaries until candidate scoring. |
match_asterisk | False | Treats an asterisk in either input as a positional wildcard. Nonlegacy paths mask paired positions per candidate and preserve unmatched tails; this is not an arbitrary-length glob. |
fuzzy_threshold | 1 | Minimum accepted similarity for nonlegacy paths. Legacy mode uses its original exact path at 1 and positional fuzzy comparison otherwise. Thresholds are not validated; normally use 0–1. |
phonetic | False | Applies ordered sound substitutions, such as ph → f. Can increase false positives. |
| API | Behavior |
|---|---|
Matching.match(txt1, txt2, settings=None) | Transforms both inputs and compares them using the selected matching method. |
Matching.within(txt1, txt2, settings=None) | Transforms both inputs and searches using the selected within method. |
Matching.fuzzy_match(txt1, txt2, threshold=.8, matching_method=None) | Lowercases and compares selector similarity with the threshold. Omitted method uses the class default; does not apply Unicode, phonetic, or interchange transformations. |
Matching.fuzzy_within(txt1, txt2, threshold=.8, matching_method=None, within_method=None) | Compares the best window similarity with the threshold. Omitted methods use class defaults; comparisons are case-insensitive without the high-level normalization pipeline. |
The high-level transformation order is Unicode normalization, optional space removal, interchange substitutions (0 → o, @ → a, $ → s, 1 → i, z → 2, + → t), optional repeated-character collapse, optional phonetic substitutions, then wildcard handling and comparison. Token mode delays space removal until scoring. within() always lowercases; with normalize=False, nonlegacy match() can remain case-sensitive.
from toolbox import Matching
assert Matching.match("Héllô", "hello")
assert Matching.match("0scar", "Oscar")
# OSA counts the adjacent swap as one edit: similarity = 0.8.
names = Matching.Settings(matching_method=3, within_method=2,
fuzzy_threshold=.8)
assert Matching.match("Maria", "Maira", names)
assert Matching.within("Maria", "Member Maira Active", names)
# Similarities and raw distances have opposite directions.
assert Matching.Methods.select("kitten", "sitting", 2) == 1 - 3 / 7
assert Matching.Methods.levenshtein_local("kitten", "sitting") == 3
assert Matching.Methods.fuzzy_local("abc", "abcd") == 1
# Explicitly retain legacy behavior even if class defaults change.
legacy = Matching.Settings(matching_method=0, within_method=0,
fuzzy_threshold=.8)
assert Matching.match("abc", "abcd", legacy) # trailing suffix ignored
assert not Matching.match("abc", "abcd",
Matching.Settings(matching_method=1, fuzzy_threshold=.8))
These helpers do not normalize inputs, lowercase, apply wildcards, or apply acceptance thresholds. Distances are smaller for closer matches, with zero meaning identical.
| Matching.Methods API | Return value |
|---|---|
fuzzy_local(txt1, txt2) | Integer positional differences, including unmatched trailing characters. |
levenshtein_local(s1, s2) | Integer Levenshtein edit distance. |
osa_local(s1, s2) | Integer OSA edit distance. |
damerau_levenshtein_local(s1, s2) | Integer unrestricted Damerau-Levenshtein edit distance. |
jaro_winkler_local(s1, s2, prefix_weight=0.1) | Fractional distance in 0–1, not an edit count. Prefix weight must be 0–0.25. |
fuzzy_local_within(query, text) | Minimum positional differences over query-length character windows; 0 for an empty query, None if the query is longer than the text. |
token_window_within(query, text, distance_method=None, extra_words=0) | Best window as a dict with text, differences, start_word, and exclusive end_word; None for empty inputs or no fitting window. Defaults to raw OSA distance. A nonnegative integer extra_words expands sizes above and below the query's word count. Ties favor smaller windows, then earlier positions. |
token_window_within() ranks raw distances, whereas select_within(..., within_method=2) ranks normalized similarities and uses exactly the query's word count. These APIs can choose different windows. The in-module notes attribute the new raw helpers to 1.5.6; they are present in the reviewed 1.6 source.
Measured 2026-11-08 on CPython 3.11.6, an AMD EPYC-Rome CPU (one CPU available to the process), Linux x86-64, with RapidFuzz 3.13.0. Values are median microseconds per comparison/search (1,000 µs = 1 ms), so lower is faster. These are reference measurements on a shared host, not guaranteed application throughput.
Each length uses the same 48 deterministic ASCII pairs across all algorithms: equal strings, substitutions, insertions, deletions, adjacent transpositions, and unrelated strings in equal proportions. Length refers to the first string; the second differs by at most one character. The timings include Toolbox selector dispatch.
| Method | Python 16 chars | RapidFuzz 16 chars | Python 64 chars | RapidFuzz 64 chars | Python 256 chars | RapidFuzz 256 chars |
|---|---|---|---|---|---|---|
| 0: Legacy positional | 1.19 | 1.14 | 2.74 | 2.68 | 9.21 | 8.26 |
| 1: Positional + tails | 1.15 | 1.16 | 2.38 | 2.37 | 7.28 | 7.30 |
| 2: Levenshtein | 45.52 | 1.11 | 678.09 | 1.17 | 10,783.64 | 2.04 |
| 3: OSA | 11.40 | 1.08 | 55.36 | 1.22 | 285.70 | 2.58 |
| 4: Damerau-Levenshtein | 95.16 | 1.36 | 1,338.77 | 4.07 | 20,827.22 | 48.96 |
| 5: Jaro-Winkler | 8.57 | 1.13 | 44.88 | 1.27 | 374.02 | 2.59 |
Methods 0 and 1 still execute Python code when RapidFuzz is installed; differences between those columns are measurement noise. For methods 2–5, the optional backend substantially reduces cost on this workload. The Python Levenshtein and full Damerau-Levenshtein implementations become particularly expensive at longer lengths. Algorithms have different semantics; the faster method is not necessarily appropriate for the same matching decision.
Sixteen 15-character, two-word queries searched in 159-character, 20-word texts, evenly mixing an early exact match, a late exact match, a late transposition, and no planted match. Character mode 1 considers up to 145 windows; token mode 2 considers up to 19. Perfect-match early exits remain enabled. No Unicode/phonetic normalization, space removal, or wildcard processing is enabled.
| Matching method | Python character windows | RapidFuzz character windows | Python token windows | RapidFuzz token windows |
|---|---|---|---|---|
| 0: Legacy positional | 123.73 | 122.40 | 19.67 | 18.99 |
| 1: Positional + tails | 140.01 | 140.29 | 21.66 | 21.08 |
| 2: Levenshtein | 4,374.24 | 131.54 | 589.90 | 20.11 |
| 3: OSA | 933.85 | 128.33 | 131.44 | 21.09 |
| 4: Damerau-Levenshtein | 8,863.83 | 233.17 | 1,158.77 | 33.21 |
| 5: Jaro-Winkler | 1,116.71 | 135.48 | 150.88 | 19.72 |
Legacy within mode 0, which always uses matching method 0, measured 119.51 µs/search without RapidFuzz and 132.03 µs/search with it installed. Token mode scans fewer candidates here, but searches word boundaries rather than arbitrary character positions; its speed and results are not interchangeable with character mode.
Method and limits: seven timing rounds in shuffled order after warm-up, with each case calibrated to at least 25 ms per sample. Each value is the median of batch-average timings; individual calls can vary more. Only the exact Matching class was loaded from source, avoiding Toolbox startup and updater side effects. High-level normalization, imports, and network work are excluded. All 1,072 accelerated/fallback score comparisons on these inputs agreed within absolute tolerance 1e-12. This checks this corpus, not every possible input or matching accuracy.
Reproduce: run python3 tools/benchmark_matching_1_6.py from the repository, with rapidfuzz==3.13.0 installed in the benchmark environment to include both backends. The script also works without RapidFuzz. Repository files benchmarks/matching_1_6.md and benchmarks/matching_1_6.json contain the full report, sample ranges, exact input corpus, source SHA-256, and environment. Hardware, load, Python/backend version, string length, and match location all affect these rough numbers.
fuzzy_match() with method 0 raises ZeroDivisionError if either string is empty; fuzzy_within() with within method 0 raises it for an empty query. This preserves the legacy behavior, unlike the low-level selectors' defined empty-input scores.within_method=0 ignores a nonzero matching_method.| Type | Purpose and important behavior |
|---|---|
CountryInfo(key=None, compressed_requests=False) | Country metadata lookup. |
IpInfo(ip=None, data=None) | Synchronous IP metadata with IPv4/IPv6 validation, dictionary output, reverse DNS, and a process cache. |
AsyncIpInfo(ip=None, data=None) | Async IP lookup with memory/file/SQLite cache modes. Cache records expire after one week by default and can be configured through class settings. |
WebRequestInfo(user_agent, ip) | Combines user-agent and IP context and can confirm major crawler networks with forward/reverse DNS checks. |
StandardRequest(request) | Normalizes request objects from supported web frameworks into common path, scheme, query, IP, body, and user-agent accessors. |
UserAgent(txt) | Parses device, OS, browser, versions, mobile/tablet state, and bot identity. |
request = StandardRequest(framework_request)
ua = UserAgent.from_request(request)
if ua and ua.is_mobile:
print(ua.browser, ua.browser_version)
UserAgent.from_request considers Client Hints as well as the User-Agent header and accepts
both a native request object and StandardRequest. Current parsing includes modern iPhone Safari formats, tolerates malformed version strings, and adds the UserAgent.Formats.bot6 pattern for ClaudeBot-style crawler headers.
ZF_REQ and run_code(code, **kwargs) are specialized internal-facing helpers;
inspect their implementation before exposing them to untrusted input. Never pass untrusted code to run_code.
Added in toolbox v1.5.4; verified unchanged in v1.5.5. An async context manager that limits concurrent blocks globally and by hashable index. Share one lock among the tasks you want to coordinate, on one event loop.
AsyncLock(task_timeout=30, max_concurrent=1,
max_concurrent_by_index=1, timeout_behavior=0)
| Parameter | Meaning |
|---|---|
task_timeout | Seconds allowed after acquisition (default 30); queue waiting time is excluded. Use None to disable the timeout. Otherwise, supply a finite positive real number. |
max_concurrent | Maximum active blocks across this lock (default 1). Must be a positive integer. |
max_concurrent_by_index | Maximum active blocks for each individual index (default 1). Must be a positive integer. The global limit still applies. |
timeout_behavior | 0 / "raise", 1 / "suppress", or 2 / "release"; see below. The property returns the numeric mode and accepts either form when assigned. Each block captures the mode at acquisition. |
Invalid constructor values raise ValueError; booleans are not accepted as numbers for these settings.
| Usage | Reservation |
|---|---|
async with lock: | One global slot only; does not reserve any index. |
async with lock["account-1"]: | One global slot and one slot for that index. |
async with lock["account-1", "account-2"]: | One global slot and one slot for each distinct index, acquired together. A list of indexes also works: lock[["account-1", "account-2"]]. |
Repeated indexes count once. Indexes must be hashable; unhashable indexes raise TypeError. A tuple or list passed to lock[...] is interpreted as a collection of indexes. To use a tuple as a single key, wrap it in a list: lock[[("account", 1)]]. An empty collection reserves only a global slot. Both plain and indexed contexts return the lock itself through as.
Multi-index requests never hold a partial reservation while waiting. Waiting requests are considered in arrival order, but a request blocked on an index can be bypassed by a later request whose indexes are available. This is not strict FIFO ordering or a guarantee against starvation.
lock.scope(*indexes, task_timeout=...)
Returns an async context manager using the same lock and reservations as lock[index]. Set a timeout for one block without changing lock.task_timeout or creating an independent lock. With no indexes, it reserves only a global slot; multiple indexes are acquired atomically and duplicates count once. Entering the context returns the parent lock.
| Usage | Timeout after acquisition |
|---|---|
lock.scope("account-1") | Inherits the lock's default at acquisition, not when the scope is created. Explicit task_timeout=... has the same meaning. |
lock.scope("account-1", task_timeout=1) | Uses a one-second timeout for this block only. |
lock.scope("account-1", task_timeout=None) | Disables the timeout for this block only. |
lock.scope(task_timeout=1) | Uses a one-second timeout with only a global reservation. |
The override must be a finite positive real number, None, or the default ... sentinel. Invalid values, including booleans, raise ValueError when scope() is called. Queue waiting is still excluded. The scope uses the parent lock's timeout_behavior at acquisition; this method overrides only the duration.
Pass indexes as separate arguments: lock.scope("a", "b", task_timeout=1). To unpack a list, use lock.scope(*indexes, task_timeout=1); passing the list itself raises TypeError because it is unhashable. Unlike lock["a", "b"], lock.scope(("a", "b")) treats the tuple as one index.
async def scope_example():
lock = AsyncLock(task_timeout=30, max_concurrent=2)
try:
async with lock.scope("account-1", task_timeout=0.01):
await asyncio.sleep(1)
except asyncio.TimeoutError:
print("This block exceeded its shorter timeout")
async with lock.scope("account-1", "account-2", task_timeout=None):
await asyncio.sleep(0.01) # Both indexes reserved, no block timeout.
async with lock["account-1"]:
await asyncio.sleep(0.01) # Still uses the original 30-second default.
| Mode | At the deadline |
|---|---|
0 / "raise" (default) | Cancels the block cooperatively. Once cleanup completes, releases its slots and raises asyncio.TimeoutError. |
1 / "suppress" | Cancels the block cooperatively, then releases its slots after cleanup and continues after async with, suppressing the lock's timeout error. Unfinished statements inside the block are skipped. |
2 / "release" | Releases slots without cancelling the block. Later work can overlap the still-running block, including work using the same indexes. This mode does not preserve mutual exclusion after the deadline. |
Cancellation is cooperative: blocking the event loop delays timers, and catching cancellation inside the block can prevent the expected timeout outcome. Let cancellation propagate and perform cleanup in finally. Ordinary block exceptions and external cancellation propagate; "suppress" does not generally swallow them. Cancelling a waiting task removes its request or releases a reservation already granted to it.
The lock is not reentrant: nested acquisition gets no special allowance for slots already held by the same task and can wait indefinitely. Queue waiting has no built-in timeout. Do not share a lock across event loops; attempting to acquire it from another loop raises RuntimeError. This class coordinates tasks; it does not create workers or schedule jobs.
import asyncio
from toolbox import AsyncLock
async def main():
lock = AsyncLock(task_timeout=None, max_concurrent=3,
max_concurrent_by_index=1)
async def update_account(account_id):
async with lock[account_id]:
print("Starting", account_id)
await asyncio.sleep(0.01) # Replace with async account work.
print("Finished", account_id)
await asyncio.gather(update_account("a"), update_account("a"),
update_account("b"))
# Reserve both accounts together for an operation touching both.
async with lock["a", "b"]:
await asyncio.sleep(0.01)
asyncio.run(main())
The two updates for "a" run sequentially, while "b" may run alongside either. With the default max_concurrent=1, all blocks would run sequentially regardless of index.
async def timeout_example():
lock = AsyncLock(task_timeout=0.01, timeout_behavior="raise")
try:
async with lock["account-1"]:
await asyncio.sleep(1)
except asyncio.TimeoutError:
print("Timed out; slots have been released")
| API | Purpose |
|---|---|
Time | to_min, parse_datetime, parse_time, parse_date, and date-format generation. |
epoch(epoch_timestamp=None) | Converts between epoch-oriented values and the module's datetime representation. |
TimeEstimate(amt=None, print_every=None, ...) | Tracks completed work, elapsed/average duration, percent complete, and estimated completion. |
ActionQueue(queue_file='queue.json', queue_file_type=None, loop_interval=60, remove_on_err=True) | Persists scheduled actions and runs registered handlers. create_action accepts datetime, date, timedelta, and supported numeric activation values. |
iCalendar(name, uid, ...) | Adds events and generates iCalendar text. |
vCard(first_name, last_name, ...) | Adds phone/email/address/organization metadata and generates a contact card. |
Version(v_str) | Comparable, normalized dotted-version value used by compatibility checks. |
Call these methods on Time directly. parse_datetime and parse_date return datetime.datetime objects or None; parse_time returns duration seconds, with 0 for invalid input.
Accepts strings containing ISO dates/timestamps, compact YYYYMMDD dates, numeric dates, named months (including ordinal days), 12/24-hour times, fractional seconds, and signed Unix seconds or milliseconds. Non-string, empty, and invalid date/time inputs return None.
day_first=None: numeric dates use month-first order unless the first field exceeds 12. True enforces day-first and False enforces month-first; year-first dates remain unambiguous. Other values raise TypeError.None.Z, UTC, GMT, or numeric offsets such as -04:00. Inputs without a timezone produce naive datetimes unless you supply tzinfo.datetime.fromtimestamp(seconds, tz=tzinfo): a supplied timezone converts the instant into that zone; otherwise the result uses local time and is naive. Exactly 13 digits, excluding a leading sign and with no decimal point, are treated as milliseconds. Eight unsigned digits are reserved for calendar dates; two-part dotted numbers such as 10.24 are fractional Unix seconds, not month/day dates.tzinfo=None preserves the previous behavior. Supply a datetime.tzinfo instance, such as datetime.timezone.utc or zoneinfo.ZoneInfo("America/New_York"), to give otherwise naive parsed dates and times a timezone. The parsed clock values stay the same; this attaches a timezone rather than converting a local clock reading. Explicit zones in the input are preserved, even when a different default is supplied. Unix timestamps instead represent an instant and are converted into the supplied zone.
Missing date fields still use the current UTC date, even with a default timezone. A timezone name string such as "UTC" is not accepted for this argument; non-None values that are not datetime.tzinfo instances raise TypeError. This argument belongs to parse_datetime; parse_date retains its existing signature.
from datetime import timezone, timedelta
from toolbox import Time
utc = timezone.utc
west = timezone(timedelta(hours=-4))
assert Time.parse_datetime("2026-10-24 14:30", tzinfo=utc).isoformat() == "2026-10-24T14:30:00+00:00"
assert Time.parse_datetime("2026-10-24T14:30:00-04:00", tzinfo=utc).utcoffset() == timedelta(hours=-4)
assert Time.parse_datetime("0", tzinfo=west).isoformat() == "1969-12-31T20:00:00-04:00"
assert Time.parse_datetime("2026-10-24").tzinfo is None
Parses durations such as 1h30m, 1 hour, 30 minutes, and 1 hour and 30 minutes. A leading + or - applies to the entire duration. Fractional amounts and existing unit aliases are supported; weeks are seven days and years are 365 days.
Every amount must have a recognized unit, and the entire input must be valid. Unknown units, trailing text, malformed numbers, non-string inputs, and incomplete components return 0, rather than a partial total. Bare numbers and clock notation such as 01:30 are not duration syntax. A valid zero duration also returns zero, so this result alone cannot distinguish zero from invalid input.
Tries the formats in Time.date_formats using datetime.strptime, returning the first successful datetime or None. These include numeric, named-month, ordinal-day, and compact dates. Unlike parse_datetime, this method uses strptime's defaults for omitted fields (for example, year 1900 for a yearless date); it has no day_first argument.
from toolbox import Time
assert Time.parse_datetime("2026-10-24T14:30:00Z").isoformat() == "2026-10-24T14:30:00+00:00"
assert Time.parse_datetime("03/04/2026").isoformat() == "2026-03-04T00:00:00"
assert Time.parse_datetime("03/04/2026", day_first=True).isoformat() == "2026-04-03T00:00:00"
assert Time.parse_datetime("October 24th, 2026 at 2:30 PM").hour == 14
assert Time.parse_datetime("2026-02-30") is None
assert Time.parse_time("-1h30m") == -5400
assert Time.parse_time("1.5 hours") == 5400
assert Time.parse_time("1h junk") == 0
assert Time.parse_date("2026-10-24").isoformat() == "2026-10-24T00:00:00"
assert Time.parse_date("not a date") is None
calendar = iCalendar("Support rota", "[email protected]")
calendar.add_event("On call", "event-1", starts_at, ends_at)
ics_text = calendar.generate()
Address(d, correct_address=True, parse_address=True) accepts a string, mapping, or supported address-like value.
It normalizes street suffixes, state abbreviations, ZIP/postal codes, and common misplaced fields. Use
Address.parse_address(text) for direct parsing, to_dict() for serialization,
and compare_address for normalized comparison. Aliases include street, street2,
zip_code, and postal_code. Version 1.5 uses precomputed street-suffix and state-name lookups to speed up parsing.
PhoneNumber(number) normalizes a phone number and exposes e164,
domestic_format, and international_format.
| Type | Purpose |
|---|---|
AndroidDevice / AgentFormat | Device catalog and user-agent format support. |
Permission.evaluate_permission(primary, evaluate) | Checks exact, prefix, suffix, and wildcard-style permission relationships. |
Extra(...) | Manages encoded non-standard database-column data, with dictionary or list-like mutations followed by save(). |
BivariateData(data) / Slope(slope, yint) | Correlation, regression slope, and linear equation representation. |
Integrations are grouped under the lowercase plugins namespace; instantiate a nested class directly.
mailgun = plugins.Mailgun(api_key, domain,
default_from="Support <[email protected]>",
default_archive_to="[email protected]")
response = await mailgun.send_email(
"Welcome", "[email protected]", html="<p>Hello</p>"
)
send_email accepts one of text, html, or template, plus CC/BCC,
reply-to, template variables, and per-message archive_to. The per-message value overrides the constructor default.
twilio = plugins.Twilio(account_sid, auth_token, default_from="+15551234567")
await twilio.send_sms("+15557654321", body="Hello")
lookup = await twilio.lookup(
"+15557654321",
["line_status", "line_type_intelligence"]
)
active = lookup.line_status.is_line_active if lookup.line_status else None
lookup(phone_number, lookup_fields, **params) accepts a field string or list and forwards additional query parameters.
It returns plugins.Twilio.LookupNumber, which retains response-style properties such as
status_code, headers, text, json(), and raise_for_status(), while also exposing parsed
caller_name, identity_match, line_status, and line_type_intelligence objects.
identity_match(..., **params) formats supported birth dates as YYYYMMDD and accepts an
Address, mapping, or string. Convenience methods line_status(phone) and is_line_active(phone) return parsed status;
the latter is tri-state: True, False, or None when unknown.
plugins.UserManager(dbm, tbl_name='users', mfa_tbl=None, session_validator=None) integrates with
aiosqliteObj. It creates required user/session columns, hashes passwords, caches users, and manages persisted sessions.
Nested types include User, UserSession, UserSession.Validation, and MFA.
add_user, get_user, and get_session are async.RandomString.secure_get_alphanum.Alphabetical glossary of the public toolbox API. “Conditional” entries exist only when their optional dependency is available.
| Name | Definition |
|---|---|
AsyncLock | Async context manager with global and per-index concurrency limits, atomic multi-index acquisition, and configurable timeouts. |
ActionQueue | Persistent scheduler that maps named actions to handlers and executes them when activated. |
Address | Parses, normalizes, serializes, and compares postal addresses. |
AgentFormat | Associates a text parser with user-agent OS, device, mobile, and tablet metadata. |
AiohttpResponse | Requests-like wrapper around a fully read aiohttp response; conditional on aiohttp support. |
AndroidDevice | Represents and looks up Android device metadata from the module's device catalog. |
AsyncIpInfo | Asynchronous IP metadata lookup with configurable memory, file, or SQLite caching. |
AsyncProperty | Descriptor that exposes an async getter through property syntax. |
AttrDict | Dictionary wrapper whose keys are also accessible as attributes. |
BivariateData | Calculates correlation and a fitted slope from paired numeric observations. |
CachedClassProperty | Class-level cached descriptor with optional time-based expiration. |
CachedProperty | Instance-level cached descriptor supporting async values, expiration, inspection, and replacement by assignment. |
CacheList | List-like collection with an auxiliary lookup cache for fast retrieval. |
Cell | Typed cell value used internally by Table. |
ClassProperty | Descriptor that evaluates a property getter against the class. |
CodeFormat | Pygments-backed HTML formatter for Python, console, and traceback text; conditional on Pygments. |
Column | Column metadata, width, and totals support for Table. |
CountryInfo | Loads country metadata and resolves countries from supported keys. |
CSVReader | Namespace for standard, fast, threaded, streaming, and quote-free CSV parsing and writing. |
DataInfo | Cached descriptive statistics for numeric datasets, including quartiles, outliers, and z-scores. |
DataInfoMisc | Descriptive-statistics variant for broader sortable values and reverse ordering. |
DelayModuleLoad | Proxy that imports a module the first time an attribute is accessed. |
Extra | Reads and mutates encoded list/dictionary data stored in a database column. |
FileInfo | Normalized file/directory metadata with child and recursive file enumeration. |
iCalendar | Builder for events and serialized iCalendar content. |
IpInfo | Synchronous IP metadata, validation, serialization, reverse DNS, and caching. |
IterLoop | Iterator that restarts at the beginning whenever its input sequence is exhausted. |
LinkInfo | Parses URLs into host, path, query, domain, and link-discovery information. |
ListIndex | Binary-search-oriented index over a list, including exact and case-insensitive lookups. |
ListTable | Header-aware wrapper for rows with dictionary export. |
Matching | Configurable normalized, positional-wildcard, phonetic, exact, containment, and fuzzy text matching; includes nested Settings. |
merge_iters | Iterator class that yields several iterables as a single sequence. |
Permission | Namespace for evaluating exact and wildcard-like permission strings. |
PhoneNumber | Normalized phone number with E.164, domestic, and international formatting. |
plugins | Namespace containing the Mailgun, Twilio, and UserManager integrations and their response/session types. |
RandomString | Namespace for ordinary and cryptographically secure random strings by character set. |
ReqInfo | Serializable request snapshot with parsed URL, user-agent, IP, location, and crawler checks. |
ReverseListIter | Iterator that traverses a list-like value in reverse. |
Row | Row container used internally by Table. |
ServerAnalytics | Minimal analytics state container retaining a bounded set of recent requests. |
Slope | Value object for a linear slope and y-intercept. |
SortedList | List that inserts appended values while preserving configured sort order. |
StandardRequest | Adapter exposing common request fields across supported web frameworks. |
StringInfo | String analysis helper for character, word, pattern, and link inspection. |
Table | Basic fixed-width text table composed of columns, rows, and cells. |
TestManager | Benchmark runner supporting fixed iteration counts, time windows, and manual trials. |
Time | Namespace for duration conversion and flexible date/time parsing. |
TimeEstimate | Progress tracker that estimates remaining time, completion time, and average duration. |
TxtParser | Pattern parser that extracts named values and supports optional sections. |
TxtParserBasic | Reduced named-value pattern parser without optional-section configuration. |
TxtParserExp | Experimental variant of the named-value text parser. |
TxtTable | Enhanced text table with CSV/HTML output and Flask-oriented filtering, sorting, and pagination. |
Unique | List-like collection that rejects duplicates and can cap retained items. |
UniqueDict | Type-grouped unique-value collection with flattened access. |
UserAgent | Parses browser, OS, device, version, mobility, and crawler identity from headers. |
vCard | Builder for contact details serialized as vCard text. |
Version | Normalized, comparable dotted-version value. |
WebRequestInfo | Combines an IP and user agent and confirms known crawler networks through DNS. |
ZF_REQ | Specialized proxy downloader that requests compressed remote content and unwraps the ZIP response. |
| Name | Definition |
|---|---|
base10_to_base36, base10_to_base62 | Convert a nonnegative integer to the documented base alphabet. |
peyton_day_timestamp | Returns integer millionths of a day since the start of 2000 UTC. |
peyton_id_prefix | Encodes the Unix-millisecond timestamp as a base62 prefix. |
peyton_id_prefix_to_timestamp | Decodes a prefix into a naive local datetime. |
peyton_id, peyton_id_secure | Build timestamp-prefixed IDs using ordinary or secure random suffixes. |
bytes_to_str | Decodes bytes by trying the module's supported encodings. |
convert_to_normal | Applies Unicode NFKD decomposition and custom character-name replacements, returning lowercase text. Phonetic conversion is a separate function. |
convert_to_single_letters | Collapses consecutive duplicate characters. |
count_dict | Builds a frequency mapping, optionally using custom comparison or estimation. |
count_print | Prints frequency information with an optional output-line limit. |
dec_amt | Chooses a decimal precision based on numeric magnitude. |
dict_print | Prints a dictionary as formatted JSON-like text. |
dir_size | Returns the recursive byte size of a directory. |
download_file | Streams a URL to disk synchronously, with a legacy-TLS retry path. |
download_file_async | Streams a URL to disk asynchronously with progress and optional gzip output; conditional on aiohttp. |
epoch | Returns the current epoch, converts an epoch to datetime, or converts a datetime to epoch. |
equivilency_convert | Applies phonetic-equivalence substitutions; the misspelling is part of the public API. |
extract_int | Extracts digit characters from a value and returns them as a string. |
file_arg_to_buffer | Normalizes supported path, byte, string, or file-like inputs to a binary buffer. |
file_arg_to_file | Normalizes supported inputs to an opened file-like object. |
file_arg_to_fp | Resolves a supported file argument to its filesystem path when possible. |
file_arg_to_str | Reads or converts a supported file argument to text. |
format_currency | Formats a numeric value as dollar currency. |
format_name | Applies person-name capitalization rules. |
format_number | Adds grouping separators and removes unnecessary decimal zeros. |
format_size | Formats a byte count with a human-readable unit. |
format_time_sec | Formats seconds or a timedelta using an appropriate duration unit. |
get_all_between | Returns every substring bounded by start and end delimiters. |
get_between | Returns the first substring bounded by start and end delimiters. |
get_median | Returns the middle value (or midpoint pair) and assumes the supplied sequence is already sorted. |
get_sd_dev | Calculates the module's deviation metric; see the statistics caveat above. |
get_total | Sums the supplied data. |
haversine | Calculates great-circle distance between two latitude/longitude points. |
is_class_instance | Tests whether a value appears to be an instantiated class object. |
is_even | Returns whether a numeric amount is even. |
is_json_parsable | Recursively checks whether a value can be represented by the module's JSON rules. |
iter_dict | Yields dictionary key/value pairs. |
make_json_parsable | Recursively converts common non-JSON values into serializable representations. |
name_to_normal | Maps a Unicode character-name string to a custom replacement; returns None when no mapping exists. |
obj_attr_print | Prints selected attributes from an object. |
obj_attr_txt | Returns selected object attributes as text. |
place_suffix | Returns an English ordinal suffix such as st, nd, rd, or th. |
quick_save | Writes data to a path or supported file destination with minimal setup. |
randomize_list | Returns a randomly reordered copy of a list. |
remove_outliers | Returns data inside the module's 1.5-IQR outlier bounds. |
run_code | Executes Python code while capturing stdout or a traceback; unsafe for untrusted input. |
scan_for_file | Returns FileInfo for an existing path, or None. |
sort_dict | Returns a dictionary ordered by key or a supplied sort callback. |
split | Current optimized split implementation with count and case-sensitivity controls. |
split_multi | Splits text on any of several delimiters. |
split_multi_old | Compatibility implementation of multi-delimiter splitting. |
split_old | Compatibility implementation of single-delimiter splitting. |
to_numb | Converts numeric-looking strings to int or float and leaves other inputs unchanged. |
word_to_digit | Converts a supported written number word to a digit value. |
This index lists every non-underscore top-level function and class in version 1.5.1.1. Some classes are support types normally created by a higher-level API.
| Area | Public symbols |
|---|---|
| Loading and HTTP | DelayModuleLoad, AiohttpResponse (when aiohttp is available), download_file_async (when aiohttp is available), download_file |
| Formatting and numbers | dec_amt, format_time_sec, format_size, format_number, format_currency, format_name, to_numb, place_suffix, extract_int |
| Statistics and measurement | TestManager, remove_outliers, get_sd_dev, get_total, get_median, is_even, DataInfo, DataInfoMisc, BivariateData, Slope, TimeEstimate |
| Files and serialization | dir_size, FileInfo, scan_for_file, bytes_to_str, file_arg_to_str, file_arg_to_buffer, file_arg_to_file, file_arg_to_fp, quick_save, make_json_parsable, is_json_parsable |
| Tables and CSV | Table, Column, Row, Cell, TxtTable, CSVReader, ListTable |
| Collections | iter_dict, sort_dict, merge_iters, randomize_list, IterLoop, CacheList, Unique, UniqueDict, count_dict, ReverseListIter, ListIndex, SortedList, AttrDict, count_print, dict_print |
| Descriptors | AsyncProperty, CachedProperty, ClassProperty, CachedClassProperty |
| Text and parsing | RandomString, get_all_between, get_between, StringInfo, LinkInfo, obj_attr_print, obj_attr_txt, TxtParserExp, TxtParser, TxtParserBasic, split_multi_old, split_old, split_multi, split, word_to_digit, name_to_normal, convert_to_normal, convert_to_single_letters, equivilency_convert, Matching, CodeFormat (when Pygments is available) |
| Network and requests | ZF_REQ, CountryInfo, IpInfo, AsyncIpInfo, AndroidDevice, AgentFormat, UserAgent, WebRequestInfo, StandardRequest, ServerAnalytics, ReqInfo |
| Timestamp IDs and bases | peyton_day_timestamp, peyton_id_prefix, peyton_id_prefix_to_timestamp, peyton_id, peyton_id_secure, base10_to_base36, base10_to_base62 |
| Async coordination | AsyncLock |
| Time and formats | Time, epoch, ActionQueue, iCalendar, vCard, Version |
| Domain and integrations | Address, Extra, PhoneNumber, Permission, plugins, haversine, is_class_instance, run_code |
This guide describes the distributed source at 1.5.1.1. Recent additions and retained features include:
Matching.Methods.levenshtein_local alongside the existing positional fuzzy functions.random.choices for ordinary alphanumeric generation, and deferred urllib3/concurrent.futures loading.bot6 user-agent pattern and removal of eager installation of a missing aiosqliteObj during startup.archive_to support at both client and message level.Time.parse_date and broader accepted date inputs in Twilio identity matching.scan_for_file and expanded FileInfo input handling.AttrDict, CacheList, and large-file CSV parsing through by_line.AsyncIpInfo caches and increased aiohttp header-field allowance for large-download endpoints.di = DataInfo([1, 2, 3, 4, 100])
print(di.info_txt())
t = Table()
t.add_column("Name")
t.add_column("Value")
t.add_row("A", 100)
t.add_row("B", 200)
t.print()
resp = await AiohttpResponse.get("https://example.com")
print(resp.text)
Most toolbox APIs fit one of three calling styles: plain functions return converted values, namespace classes such as CSVReader expose functions called directly on the class, and stateful objects such as TxtTable hold data across method calls. Async methods must be awaited; custom async properties use await object.property.
| Family | Input and result | State or side effect |
|---|---|---|
| Formatting functions | format_number, format_currency, format_size, and format_time_sec return display strings. place_suffix(21) returns only "st". | Use the original numeric value for calculations. to_numb only converts recognized numeric-looking strings and may return the original input. |
FileInfo(path) | Metadata object with name, path, is_dir, byte size, and datetime modified/created_at. | Reads filesystem metadata immediately; directory construction calculates recursive size. Timestamps are naive local datetimes; created_at uses platform-dependent stat ctime. |
DataInfo(data) | Numeric collection summary with cached len, total, avg, median, range, and other statistics. get_item(value) returns a DataInfo.Item with frequency and lazy statistics. | Keeps your input list and may sort it in place. Pass a copy if ordering matters. Cached results do not automatically refresh after arbitrary mutation; create a new DataInfo for changed data. |
TxtTable(...) | add_column returns Column, add_row returns Row, and a Row's data contains Cell objects with underlying/display values. | print(send=False) returns text; the default also prints. CSV and HTML exports return strings. Add columns before rows and pass one value per column. |
CSVReader → ListTable → ListTable.Row | Read methods return a ListTable by default. Index a row with a column name or integer, or call row.dict(). as_list=True returns raw row lists, including the header row. | Reads consume file-like inputs. Parsers materialize the result even when input reading is line-oriented. Use [row.dict() for row in table]; current ListTable.dict() references a nonexistent attribute. |
TxtParser(format_txt, ...) | Callable parser object. Named placeholders such as <name> become dictionary keys; calling it returns a dictionary or None when no match is found. | Compiles its pattern during construction. handle_not_found=True uses looser matching and can return None-valued fields. It is a pattern helper, not an input-validation schema. |
CacheList(max_cache_size=100) | get(key, default=None) retrieves a stored object; pop(index=-1) removes and returns one; append/add/remove return None. | Uses a key dictionary plus an eviction queue. Set stringify_func(callable) before adding values. Re-appending an existing key refreshes eviction order but retains the original object. |
scan_for_file(path) returns a FileInfo when the path exists, otherwise None. FileInfo.all_files() and all_files_recursive() return filename strings, not FileInfo objects or reliable full paths; recursive results can contain the same basename from different subdirectories.
Many namespace methods omit self; call CSVReader.read(...), Time.parse_time(...), and Matching.match(...) on the class. Constructing and calling them as ordinary instance methods may pass an unexpected argument.
The default CSV result is a ListTable. Its rows support header-based indexing; the report creates separate typed cells so numeric display formatting can apply. No external file or service is required after the import-time updater setup.
import io
import toolbox
csv_input = io.StringIO("name,amount\nAda,1200\nGrace,85.5\n")
data = toolbox.CSVReader.basic_read(csv_input)
report = toolbox.TxtTable(format_numbers=True)
report.add_column("Name")
report.add_column("Amount")
for row in data:
report.add_row(row["name"], toolbox.to_numb(row["amount"]))
print(report.print(send=False))
plain_records = [row.dict() for row in data]
print(plain_records[0]["name"]) # Ada
csv_output = toolbox.CSVReader.write([
["name", "amount"],
*[[record["name"], record["amount"]] for record in plain_records],
])
print(csv_output)
CSVReader.write(rows) expects an iterable of row sequences and returns text. write_file(path, rows) also writes/closes its destination. condense() rewrites its input file. The custom serializer quotes commas and quotes but does not cover every multiline CSV case; use Python's standard csv module when general CSV interoperability is required.
CacheList stores objects by the key returned by your callback. Looking up a key does not refresh its eviction position. In this example, adding a third distinct key evicts the first because the capacity is two.
import toolbox
cache = toolbox.CacheList(max_cache_size=2)
cache.stringify_func(lambda item: item["id"])
cache.append({"id": "a", "name": "Ada"})
cache.append({"id": "b", "name": "Grace"})
print(cache.get("a")["name"]) # Ada
cache.append({"id": "c", "name": "Linus"})
print(cache.get("a")) # None
print(cache.pop()["name"]) # Linus
class Report:
def __init__(self, values):
self.values = list(values)
self.calculations = 0
@toolbox.CachedProperty(expire=60)
def total(self):
self.calculations += 1
return sum(self.values)
report = Report([10, 20])
print(report.total, report.total, report.calculations) # 30 30 1
print(Report.total.is_cached(report)) # True
report.total = 40 # Explicitly replace the cached value.
print(report.total) # 40
CachedProperty accepts an expiry in seconds or a timedelta. Read the descriptor through the class, as in Report.total.is_cached(report) and get_cached(report). Assignment replaces the cached value and resets its expiry; a decorated setter may transform the assigned value. There is no public cache-clear method. A changed underlying list does not invalidate the property automatically.
TxtParser captures strings; convert each field explicitly. PhoneNumber strips nondigits, assumes +1 for ten digits, and treats extra leading digits as a country code. It formats values but does not validate real numbering-plan assignments.
import toolbox
parser = toolbox.TxtParser("<name> ; <phone>")
fields = parser("Ada Lovelace ; (212) 555-0100")
if fields is None:
raise ValueError("Expected name ; phone")
phone = toolbox.PhoneNumber(fields["phone"])
print(phone.e164) # +12125550100
print(phone.domestic_format) # (212) 555-0100
print(phone.country_code, phone.area_code) # +1 212
address = toolbox.Address({
"address1": "10 Main Street",
"address2": None,
"city": "New York",
"state": "NY",
"zip": "10001",
}, correct_address=False)
print(address.street)
print(address.to_dict()["zip"])
print(toolbox.Matching.match("Héloise", "HELOISE")) # True
Address owns mutable address1, address2, city, state, and zip fields. street, street2, zip_code, and postal_code are read aliases. to_dict() returns those five fields; parsed_address and compare_address are cached string properties, not methods. Construct a new Address after changing fields if fresh cached normalization is required. Address normalization does not verify postal deliverability.
This example requires aiohttp and network access. The response helpers consume the response body before returning AiohttpResponse. Then content, text, and json() are synchronous byte/string/decoded-JSON accessors; await the request, not those accessors.
import asyncio
import aiohttp
import toolbox
async def main():
response = await toolbox.AiohttpResponse.get(
"https://example.com/",
timeout=aiohttp.ClientTimeout(total=10),
)
response.raise_for_status()
print(response.status_code, response.url)
print(len(response.content), response.elapsed.total_seconds())
print(response.text[:80])
asyncio.run(main())
get, post, and delete forward arguments to aiohttp requests and return AiohttpResponse. headers, cookies, status_code/status, url, encoding, and elapsed provide response metadata. raise_for_status() raises for HTTP errors; methods do not call it automatically. ping() issues a GET, closes the response without loading its body, and returns None.
Generated from modules/toolbox.py; version 1.6. Includes public functions, classes, directly declared methods, properties, and Python protocol methods. Conditional APIs may require optional dependencies. Inherited members and dynamically assigned attributes are explained in the guide where relevant.
Signatures and docstrings are extracted without importing or running the module. A property or AsyncProperty decorator changes how a member is accessed; see its decorators and the guide.
DelayModuleLoadAiohttpResponseTestManagerFileInfoDataInfoDataInfo.ItemDataInfoMiscDataInfoMisc.ItemTableColumnRowCellTxtTableTxtTable.ColumnTxtTable.RowTxtTable.CellRandomStringmerge_itersCSVReaderCSVReader.CharsAfterQuotedCSVReader.RowCountMismatchListTableListTable.RowAsyncLockAsyncPropertyCachedPropertyClassPropertyCachedClassPropertyStringInfoLinkInfoZF_REQZF_REQ._dataIterLoopCountryInfoIpInfoAsyncIpInfoBivariateDataBivariateData.DataPointSlopeCacheListUniqueUniqueDictTimeEstimateReverseListIterTxtParserExpTxtParserTxtParserBasicAndroidDeviceAndroidDevice._DeviceIndexAgentFormatUserAgentUserAgent.FormatsUserAgent.Formats._opt_iterUserAgent.Formats._opt_itersUserAgent.VersionTimeTime._TimestampFormatTime._MeasureWebRequestInfoActionQueueActionQueue.ItemActionQueue._check_iteriCalendariCalendar.EventvCardAddressCodeFormatStandardRequestListIndexSortedListAttrDictServerAnalyticsReqInfoVersionExtraPhoneNumberPermissionpluginsplugins.Mailgunplugins.Twilioplugins.Twilio.LookupNumberplugins.Twilio.LookupNumber.CallerNameplugins.Twilio.LookupNumber.IdentityMatchplugins.Twilio.LookupNumber.LineStatusplugins.Twilio.LookupNumber.LineTypeIntelligenceplugins.UserManagerplugins.UserManager.Userplugins.UserManager.UserSessionplugins.UserManager.UserSession.Validationplugins.UserManager.MFAMatchingMatching.MethodsMatching.Settingsdownload_file_asyncdownload_filedec_amtformat_time_secformat_sizeformat_numberformat_currencyformat_nameremove_outliersget_sd_devget_totalget_medianis_evendir_sizescan_for_fileiter_dictsort_dictto_numbplace_suffixpeyton_day_timestampbase10_to_base36base10_to_base62peyton_id_prefixpeyton_id_prefix_to_timestamppeyton_idpeyton_id_secureget_all_betweenget_betweenbytes_to_strfile_arg_to_strfile_arg_to_bufferfile_arg_to_filefile_arg_to_fpextract_intrandomize_listquick_saveobj_attr_printobj_attr_txtcount_dictmake_json_parsabledict_printsplit_multi_oldsplit_oldsplit_multisplitis_class_instanceis_json_parsableepochrun_codecount_printhaversineword_to_digitname_to_normalconvert_to_normalconvert_to_single_lettersequivilency_convertclass DelayModuleLoadSource line 16
Construct: DelayModuleLoad(module_name, name_as=None, module_to_globals=True)
Declared functions, properties, and nested objects:
DelayModuleLoad.__init__ — methodDelayModuleLoad.__getattr__ — methodDelayModuleLoad.__init__(self, module_name, name_as=None, module_to_globals=True)Source line 18
| Parameter | Passing convention | Default / required |
|---|---|---|
module_name | positional or keyword | required |
name_as | positional or keyword | None |
module_to_globals | positional or keyword | True |
DelayModuleLoad.__getattr__(self, name)Source line 45
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
class AiohttpResponseSource line 305
Allows for requests to be done similar to requests module w/ aiohttp, with response object being
Construct: AiohttpResponse(r, elapsed, data)
Fields assigned by the constructor: content, elapsed. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
AiohttpResponse.__init__ — methodAiohttpResponse.raise_for_status — methodAiohttpResponse.json — methodAiohttpResponse.text — propertyAiohttpResponse.get — async methodAiohttpResponse.post — async methodAiohttpResponse.delete — async methodAiohttpResponse.ping — async methodAiohttpResponse.__init__(self, r, elapsed, data)Source line 310
| Parameter | Passing convention | Default / required |
|---|---|---|
r | positional or keyword | required |
elapsed | positional or keyword | required |
data | positional or keyword | required |
AiohttpResponse.raise_for_status(self)Source line 338
No caller-supplied parameters are declared.
AiohttpResponse.json(self)Source line 340
Get json content as a dictionary.
No caller-supplied parameters are declared.
AiohttpResponse.text(self)Source line 344
Decorators: @property
Get content as a string
No caller-supplied parameters are declared.
async AiohttpResponse.get(*args, **kwargs)Source line 349
Make a GET request via aiohttp.
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
kwargs | extra keyword arguments (**kwargs) | optional collection |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async AiohttpResponse.post(*args, **kwargs)Source line 359
Make a POST request via aiohttp.
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
kwargs | extra keyword arguments (**kwargs) | optional collection |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async AiohttpResponse.delete(*args, **kwargs)Source line 369
Make a DELETE request via aiohttp.
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
kwargs | extra keyword arguments (**kwargs) | optional collection |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async AiohttpResponse.ping(*args, **kwargs)Source line 379
Make a GET request without loading all of page content.
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
kwargs | extra keyword arguments (**kwargs) | optional collection |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async download_file_async(url, dest_path, chunk_size=1024 * 1024, verbose=False, as_gzip=False)Source line 387
| Parameter | Passing convention | Default / required |
|---|---|---|
url | positional or keyword | required |
dest_path | positional or keyword | required |
chunk_size | positional or keyword | 1024 * 1024 |
verbose | positional or keyword | False |
as_gzip | positional or keyword | False |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
download_file(url, dest_path, chunk_size=1024 * 1024)Source line 426
| Parameter | Passing convention | Default / required |
|---|---|---|
url | positional or keyword | required |
dest_path | positional or keyword | required |
chunk_size | positional or keyword | 1024 * 1024 |
dec_amt(n)Source line 466
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
format_time_sec(sec)Source line 479
| Parameter | Passing convention | Default / required |
|---|---|---|
sec | positional or keyword | required |
format_size(size)Source line 537
| Parameter | Passing convention | Default / required |
|---|---|---|
size | positional or keyword | required |
format_number(number)Source line 555
| Parameter | Passing convention | Default / required |
|---|---|---|
number | positional or keyword | required |
format_currency(number)Source line 574
| Parameter | Passing convention | Default / required |
|---|---|---|
number | positional or keyword | required |
format_name(name)Source line 578
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
class TestManagerSource line 592
Construct: TestManager(**kwargs)
Fields assigned by the constructor: end, start, test_trial, trial_amt, trial_time, trial_type. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
TestManager.__init__ — methodTestManager.__iter__ — methodTestManager.__next__ — methodTestManager.empty_trial_iter — methodTestManager.empty_trial_run — methodTestManager.empty_trial_manual — methodTestManager.duration — propertyTestManager.duration_str — propertyTestManager.avg_duration — propertyTestManager.avg_duration_str — propertyTestManager.test_func — methodTestManager.run — methodTestManager.start_trial — methodTestManager.end_trial — methodTestManager.print_results — methodTestManager.txt_results — methodTestManager.__init__(self, **kwargs)Source line 593
| Parameter | Passing convention | Default / required |
|---|---|---|
kwargs | extra keyword arguments (**kwargs) | optional collection |
TestManager.__iter__(self)Source line 618
No caller-supplied parameters are declared.
TestManager.__next__(self)Source line 627
No caller-supplied parameters are declared.
TestManager.empty_trial_iter(**kwargs)Source line 662
| Parameter | Passing convention | Default / required |
|---|---|---|
kwargs | extra keyword arguments (**kwargs) | optional collection |
TestManager.empty_trial_run(trial_count)Source line 667
| Parameter | Passing convention | Default / required |
|---|---|---|
trial_count | positional or keyword | required |
TestManager.empty_trial_manual(trial_count)Source line 674
| Parameter | Passing convention | Default / required |
|---|---|---|
trial_count | positional or keyword | required |
TestManager.duration(self)Source line 683
Decorators: @property
No caller-supplied parameters are declared.
TestManager.duration_str(self)Source line 691
Decorators: @property
No caller-supplied parameters are declared.
TestManager.avg_duration(self)Source line 694
Decorators: @property
No caller-supplied parameters are declared.
TestManager.avg_duration_str(self)Source line 697
Decorators: @property
No caller-supplied parameters are declared.
TestManager.test_func(self, func)Source line 699
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
TestManager.run(self)Source line 701
No caller-supplied parameters are declared.
TestManager.start_trial(self)Source line 713
No caller-supplied parameters are declared.
TestManager.end_trial(self)Source line 716
No caller-supplied parameters are declared.
TestManager.print_results(self)Source line 723
No caller-supplied parameters are declared.
TestManager.txt_results(self)Source line 727
No caller-supplied parameters are declared.
remove_outliers(data)Source line 733
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
get_sd_dev(data)Source line 781
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
get_total(data)Source line 800
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
get_median(data)Source line 811
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
is_even(amt)Source line 833
| Parameter | Passing convention | Default / required |
|---|---|---|
amt | positional or keyword | required |
dir_size(dir_path)Source line 840
| Parameter | Passing convention | Default / required |
|---|---|---|
dir_path | positional or keyword | required |
class FileInfoSource line 854
Construct: FileInfo(x)
Fields assigned by the constructor: created_at, is_dir, modified, name, path, size. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
FileInfo.__init__ — methodFileInfo.all_files_recursive — methodFileInfo.all_files — methodFileInfo.__str__ — methodFileInfo.__repr__ — methodFileInfo.__init__(self, x)Source line 855
| Parameter | Passing convention | Default / required |
|---|---|---|
x | positional or keyword | required |
FileInfo.all_files_recursive(self)Source line 879
No caller-supplied parameters are declared.
FileInfo.all_files(self)Source line 893
No caller-supplied parameters are declared.
FileInfo.__str__(self)Source line 903
No caller-supplied parameters are declared.
FileInfo.__repr__(self)Source line 905
No caller-supplied parameters are declared.
scan_for_file(file)Source line 910
| Parameter | Passing convention | Default / required |
|---|---|---|
file | positional or keyword | required |
class DataInfoSource line 916
Construct: DataInfo(data)
Fields assigned by the constructor: data, data_sorted. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
DataInfo.Item — nested classDataInfo.__init__ — methodDataInfo.sorted_data — methodDataInfo.len — propertyDataInfo.total — propertyDataInfo.range — propertyDataInfo.item_dict — propertyDataInfo.mode — propertyDataInfo.iqr — propertyDataInfo.avg — propertyDataInfo.avg_no_outliers — methodDataInfo.even_len — propertyDataInfo.median — propertyDataInfo.skewed — propertyDataInfo.sd_dev — propertyDataInfo.avg_dev — propertyDataInfo.load — methodDataInfo.is_outlier — methodDataInfo.get_zscore — methodDataInfo.get_item — methodDataInfo.get_percentile — methodDataInfo.info_txt — methodDataInfo.print — methodDataInfo.basic_info_txt — methodDataInfo.basic_print — methodDataInfo.__len__ — methodDataInfo.__iter__ — methodDataInfo.__next__ — methodclass DataInfo.ItemSource line 917
Construct: DataInfo.Item(n, di)
Fields assigned by the constructor: data_info, frequency, number. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
DataInfo.Item.__init__ — methodDataInfo.Item.zscore — propertyDataInfo.Item.is_outlier — propertyDataInfo.Item.percentile — propertyDataInfo.Item.load — methodDataInfo.Item.__repr__ — methodDataInfo.Item.__init__(self, n, di)Source line 918
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
di | positional or keyword | required |
DataInfo.Item.zscore(self)Source line 926
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.Item.is_outlier(self)Source line 931
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.Item.percentile(self)Source line 936
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.Item.load(self)Source line 940
No caller-supplied parameters are declared.
DataInfo.Item.__repr__(self)Source line 944
No caller-supplied parameters are declared.
DataInfo.__init__(self, data)Source line 946
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
DataInfo.sorted_data(self)Source line 960
No caller-supplied parameters are declared.
DataInfo.len(self)Source line 965
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.total(self)Source line 970
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.range(self)Source line 975
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.item_dict(self)Source line 1016
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.mode(self)Source line 1021
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.iqr(self)Source line 1026
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.avg(self)Source line 1031
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.avg_no_outliers(self)Source line 1038
No caller-supplied parameters are declared.
DataInfo.even_len(self)Source line 1048
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.median(self)Source line 1051
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.skewed(self)Source line 1056
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.sd_dev(self)Source line 1065
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.avg_dev(self)Source line 1074
Decorators: @property
No caller-supplied parameters are declared.
DataInfo.load(self)Source line 1082
No caller-supplied parameters are declared.
DataInfo.is_outlier(self, n)Source line 1150
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
DataInfo.get_zscore(self, n)Source line 1158
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
DataInfo.get_item(self, n)Source line 1160
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
DataInfo.get_percentile(self, n)Source line 1163
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
DataInfo.info_txt(self)Source line 1196
No caller-supplied parameters are declared.
DataInfo.print(self)Source line 1214
No caller-supplied parameters are declared.
DataInfo.basic_info_txt(self)Source line 1218
No caller-supplied parameters are declared.
DataInfo.basic_print(self)Source line 1228
No caller-supplied parameters are declared.
DataInfo.__len__(self)Source line 1233
No caller-supplied parameters are declared.
DataInfo.__iter__(self)Source line 1235
No caller-supplied parameters are declared.
DataInfo.__next__(self)Source line 1238
No caller-supplied parameters are declared.
class DataInfoMiscSource line 1242
Construct: DataInfoMisc(data, reverse=False)
Fields assigned by the constructor: data, data_sorted, reverse. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
DataInfoMisc.Item — nested classDataInfoMisc.__init__ — methodDataInfoMisc.sorted_data — methodDataInfoMisc.len — propertyDataInfoMisc.total — propertyDataInfoMisc.range — propertyDataInfoMisc.item_dict — propertyDataInfoMisc.mode — propertyDataInfoMisc.iqr — propertyDataInfoMisc.avg — propertyDataInfoMisc.even_len — propertyDataInfoMisc.median — propertyDataInfoMisc.sd_dev — propertyDataInfoMisc.load — methodDataInfoMisc.is_outlier — methodDataInfoMisc.get_zscore — methodDataInfoMisc.get_item — methodDataInfoMisc.get_percentile — methodDataInfoMisc.__len__ — methodDataInfoMisc.__iter__ — methodDataInfoMisc.__next__ — methodclass DataInfoMisc.ItemSource line 1243
Construct: DataInfoMisc.Item(n, di)
Fields assigned by the constructor: data_info, frequency, value. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
DataInfoMisc.Item.__init__ — methodDataInfoMisc.Item.zscore — propertyDataInfoMisc.Item.is_outlier — propertyDataInfoMisc.Item.percentile — propertyDataInfoMisc.Item.load — methodDataInfoMisc.Item.__repr__ — methodDataInfoMisc.Item.__init__(self, n, di)Source line 1244
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
di | positional or keyword | required |
DataInfoMisc.Item.zscore(self)Source line 1252
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.Item.is_outlier(self)Source line 1257
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.Item.percentile(self)Source line 1262
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.Item.load(self)Source line 1266
No caller-supplied parameters are declared.
DataInfoMisc.Item.__repr__(self)Source line 1270
No caller-supplied parameters are declared.
DataInfoMisc.__init__(self, data, reverse=False)Source line 1272
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
reverse | positional or keyword | False |
DataInfoMisc.sorted_data(self)Source line 1285
No caller-supplied parameters are declared.
DataInfoMisc.len(self)Source line 1290
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.total(self)Source line 1295
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.range(self)Source line 1300
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.item_dict(self)Source line 1339
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.mode(self)Source line 1344
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.iqr(self)Source line 1349
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.avg(self)Source line 1354
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.even_len(self)Source line 1359
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.median(self)Source line 1362
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.sd_dev(self)Source line 1367
Decorators: @property
No caller-supplied parameters are declared.
DataInfoMisc.load(self)Source line 1376
No caller-supplied parameters are declared.
DataInfoMisc.is_outlier(self, n)Source line 1453
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
DataInfoMisc.get_zscore(self, n)Source line 1461
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
DataInfoMisc.get_item(self, n)Source line 1463
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
DataInfoMisc.get_percentile(self, n)Source line 1466
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
DataInfoMisc.__len__(self)Source line 1499
No caller-supplied parameters are declared.
DataInfoMisc.__iter__(self)Source line 1501
No caller-supplied parameters are declared.
DataInfoMisc.__next__(self)Source line 1504
No caller-supplied parameters are declared.
iter_dict(d)Source line 1507
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
sort_dict(d, key=None, reverse=False)Source line 1512
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
key | positional or keyword | None |
reverse | positional or keyword | False |
class TableSource line 1530
Construct: Table(format_numbers=False, totals=False)
Fields assigned by the constructor: col_amt, columns, format_int, row_amt, rows, totals. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Table.row — methodTable.numbFormat — methodTable.formattedToNumb — methodTable.__init__ — methodTable.add_column — methodTable.add_row — methodTable.print — methodTable.row(txt, rl=8)Source line 1531
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
rl | positional or keyword | 8 |
Table.numbFormat(number)Source line 1541
| Parameter | Passing convention | Default / required |
|---|---|---|
number | positional or keyword | required |
Table.formattedToNumb(number)Source line 1547
| Parameter | Passing convention | Default / required |
|---|---|---|
number | positional or keyword | required |
Table.__init__(self, format_numbers=False, totals=False)Source line 1549
| Parameter | Passing convention | Default / required |
|---|---|---|
format_numbers | positional or keyword | False |
totals | positional or keyword | False |
Table.add_column(self, name, length=None)Source line 1556
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
length | positional or keyword | None |
Table.add_row(self, *args)Source line 1561
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
Table.print(self, limit=None, send=True)Source line 1568
| Parameter | Passing convention | Default / required |
|---|---|---|
limit | positional or keyword | None |
send | positional or keyword | True |
class ColumnSource line 1599
Construct: Column(name, length, table, col_num)
Fields assigned by the constructor: col_num, length, name, table. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Column.__init__ — methodColumn.__len__ — methodColumn.__repr__ — methodColumn.total — methodColumn.__init__(self, name, length, table, col_num)Source line 1600
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
length | positional or keyword | required |
table | positional or keyword | required |
col_num | positional or keyword | required |
Column.__len__(self)Source line 1605
No caller-supplied parameters are declared.
Column.__repr__(self)Source line 1618
No caller-supplied parameters are declared.
Column.total(self)Source line 1620
No caller-supplied parameters are declared.
class RowSource line 1645
Construct: Row(row_number, format_numbs, *args)
Fields assigned by the constructor: data, format_numbs, row_num. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Row.__init__ — methodRow.__init__(self, row_number, format_numbs, *args)Source line 1646
| Parameter | Passing convention | Default / required |
|---|---|---|
row_number | positional or keyword | required |
format_numbs | positional or keyword | required |
args | extra positional arguments (*args) | optional collection |
class CellSource line 1655
Construct: Cell(value, col_num, row_num, format_numbs)
Fields assigned by the constructor: col_num, format_numbs, row_num, type, value. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Cell.__init__ — methodCell.__len__ — methodCell.__str__ — methodCell.__repr__ — methodCell.__init__(self, value, col_num, row_num, format_numbs)Source line 1656
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
col_num | positional or keyword | required |
row_num | positional or keyword | required |
format_numbs | positional or keyword | required |
Cell.__len__(self)Source line 1672
No caller-supplied parameters are declared.
Cell.__str__(self)Source line 1674
No caller-supplied parameters are declared.
Cell.__repr__(self)Source line 1679
No caller-supplied parameters are declared.
to_numb(s)Source line 1687
| Parameter | Passing convention | Default / required |
|---|---|---|
s | positional or keyword | required |
class TxtTableSource line 1705
Construct: TxtTable(format_numbers=False, totals=False, len_limit=100)
Fields assigned by the constructor: col_amt, columns, format_int, len_limit, row_amt, rows, totals. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
TxtTable.row — methodTxtTable.numbFormat — methodTxtTable.formattedToNumb — methodTxtTable.__init__ — methodTxtTable.add_column — methodTxtTable.insert_column — methodTxtTable.add_row — methodTxtTable.remove_column — methodTxtTable.print — methodTxtTable.to_html — methodTxtTable.flask_pagination — methodTxtTable.to_csv — methodTxtTable.__repr__ — methodTxtTable.Column — nested classTxtTable.Row — nested classTxtTable.Cell — nested classTxtTable.to_numb — methodTxtTable.row(txt, rl=8)Source line 1706
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
rl | positional or keyword | 8 |
TxtTable.numbFormat(number)Source line 1716
| Parameter | Passing convention | Default / required |
|---|---|---|
number | positional or keyword | required |
TxtTable.formattedToNumb(number)Source line 1725
| Parameter | Passing convention | Default / required |
|---|---|---|
number | positional or keyword | required |
TxtTable.__init__(self, format_numbers=False, totals=False, len_limit=100)Source line 1727
| Parameter | Passing convention | Default / required |
|---|---|---|
format_numbers | positional or keyword | False |
totals | positional or keyword | False |
len_limit | positional or keyword | 100 |
TxtTable.add_column(self, name, length=None, str_convert=None, value=None)Source line 1735
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
length | positional or keyword | None |
str_convert | positional or keyword | None |
value | positional or keyword | None |
TxtTable.insert_column(self, name, loc, length=None, str_convert=None, value=None)Source line 1752
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
loc | positional or keyword | required |
length | positional or keyword | None |
str_convert | positional or keyword | None |
value | positional or keyword | None |
TxtTable.add_row(self, *args)Source line 1779
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
TxtTable.remove_column(self, col_num)Source line 1787
| Parameter | Passing convention | Default / required |
|---|---|---|
col_num | positional or keyword | required |
TxtTable.print(self, limit=None, send=True)Source line 1798
| Parameter | Passing convention | Default / required |
|---|---|---|
limit | positional or keyword | None |
send | positional or keyword | True |
TxtTable.to_html(self, max_len=100, condensed=True, row_range=None, to_body_top='', to_body_bottom='', to_head='', own_rows=None, table_only=False, row_colors=[['#f0eceb', '#000000'], ['#e6e2e1', '#000000']], background_color='#f7f2f2', header_color='#000000', table_border='1px solid black')Source line 1838
| Parameter | Passing convention | Default / required |
|---|---|---|
max_len | positional or keyword | 100 |
condensed | positional or keyword | True |
row_range | positional or keyword | None |
to_body_top | positional or keyword | '' |
to_body_bottom | positional or keyword | '' |
to_head | positional or keyword | '' |
own_rows | positional or keyword | None |
table_only | positional or keyword | False |
row_colors | positional or keyword | [['#f0eceb', '#000000'], ['#e6e2e1', '#000000']] |
background_color | positional or keyword | '#f7f2f2' |
header_color | positional or keyword | '#000000' |
table_border | positional or keyword | '1px solid black' |
TxtTable.flask_pagination(self, request, per_page=50, max_len=100, page_colors=['#ffffff', '#000000'], to_body_top='', querystring='', search_ignore=None, custom_sort={}, **kwargs)Source line 1992
| Parameter | Passing convention | Default / required |
|---|---|---|
request | positional or keyword | required |
per_page | positional or keyword | 50 |
max_len | positional or keyword | 100 |
page_colors | positional or keyword | ['#ffffff', '#000000'] |
to_body_top | positional or keyword | '' |
querystring | positional or keyword | '' |
search_ignore | positional or keyword | None |
custom_sort | positional or keyword | {} |
kwargs | extra keyword arguments (**kwargs) | optional collection |
TxtTable.to_csv(self)Source line 2353
No caller-supplied parameters are declared.
TxtTable.__repr__(self)Source line 2388
No caller-supplied parameters are declared.
class TxtTable.ColumnSource line 2391
Construct: TxtTable.Column(name, length, table, col_num, str_convert=None)
Fields assigned by the constructor: col_num, length, name, str_convert, table. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
TxtTable.Column.__init__ — methodTxtTable.Column.__len__ — methodTxtTable.Column.rows_len — methodTxtTable.Column.__repr__ — methodTxtTable.Column.total — methodTxtTable.Column.is_numb — methodTxtTable.Column.is_datetime — methodTxtTable.Column.cells — methodTxtTable.Column.__init__(self, name, length, table, col_num, str_convert=None)Source line 2392
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
length | positional or keyword | required |
table | positional or keyword | required |
col_num | positional or keyword | required |
str_convert | positional or keyword | None |
TxtTable.Column.__len__(self)Source line 2398
No caller-supplied parameters are declared.
TxtTable.Column.rows_len(self, rows)Source line 2415
| Parameter | Passing convention | Default / required |
|---|---|---|
rows | positional or keyword | required |
TxtTable.Column.__repr__(self)Source line 2432
No caller-supplied parameters are declared.
TxtTable.Column.total(self)Source line 2434
No caller-supplied parameters are declared.
TxtTable.Column.is_numb(self)Source line 2458
No caller-supplied parameters are declared.
TxtTable.Column.is_datetime(self)Source line 2464
No caller-supplied parameters are declared.
TxtTable.Column.cells(self)Source line 2470
No caller-supplied parameters are declared.
class TxtTable.RowSource line 2480
Construct: TxtTable.Row(row_number, format_numbs, table, *args)
Fields assigned by the constructor: data, format_numbs, row_num, table. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
TxtTable.Row.__init__ — methodTxtTable.Row.remove_column — methodTxtTable.Row.__repr__ — methodTxtTable.Row.__eq__ — methodTxtTable.Row.__contains__ — methodTxtTable.Row.__len__ — methodTxtTable.Row.__iter__ — methodTxtTable.Row.__next__ — methodTxtTable.Row.__getitem__ — methodTxtTable.Row.__init__(self, row_number, format_numbs, table, *args)Source line 2481
| Parameter | Passing convention | Default / required |
|---|---|---|
row_number | positional or keyword | required |
format_numbs | positional or keyword | required |
table | positional or keyword | required |
args | extra positional arguments (*args) | optional collection |
TxtTable.Row.remove_column(self, col_num)Source line 2495
| Parameter | Passing convention | Default / required |
|---|---|---|
col_num | positional or keyword | required |
TxtTable.Row.__repr__(self)Source line 2505
No caller-supplied parameters are declared.
TxtTable.Row.__eq__(self, other)Source line 2507
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
TxtTable.Row.__contains__(self, other)Source line 2511
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
TxtTable.Row.__len__(self)Source line 2513
No caller-supplied parameters are declared.
TxtTable.Row.__iter__(self)Source line 2515
No caller-supplied parameters are declared.
TxtTable.Row.__next__(self)Source line 2518
No caller-supplied parameters are declared.
TxtTable.Row.__getitem__(self, item)Source line 2520
| Parameter | Passing convention | Default / required |
|---|---|---|
item | positional or keyword | required |
class TxtTable.CellSource line 2540
Construct: TxtTable.Cell(value, print_value, col_num, row_num, format_numbs)
Fields assigned by the constructor: col_num, format_numbs, print_value, row_num, type, value. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
TxtTable.Cell.__init__ — methodTxtTable.Cell.__len__ — methodTxtTable.Cell.__str__ — methodTxtTable.Cell.__contains__ — methodTxtTable.Cell.__eq__ — methodTxtTable.Cell.__repr__ — methodTxtTable.Cell.__init__(self, value, print_value, col_num, row_num, format_numbs)Source line 2541
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
print_value | positional or keyword | required |
col_num | positional or keyword | required |
row_num | positional or keyword | required |
format_numbs | positional or keyword | required |
TxtTable.Cell.__len__(self)Source line 2558
No caller-supplied parameters are declared.
TxtTable.Cell.__str__(self)Source line 2560
No caller-supplied parameters are declared.
TxtTable.Cell.__contains__(self, other)Source line 2566
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
TxtTable.Cell.__eq__(self, other)Source line 2568
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
TxtTable.Cell.__repr__(self)Source line 2570
No caller-supplied parameters are declared.
TxtTable.to_numb(s)Source line 2575
| Parameter | Passing convention | Default / required |
|---|---|---|
s | positional or keyword | required |
place_suffix(n)Source line 2593
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
peyton_day_timestamp(dt=None)Source line 2608
| Parameter | Passing convention | Default / required |
|---|---|---|
dt | positional or keyword | None |
base10_to_base36(n)Source line 2619
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
base10_to_base62(n)Source line 2630
| Parameter | Passing convention | Default / required |
|---|---|---|
n | positional or keyword | required |
peyton_id_prefix(dt=None, leading_zeros=True, granularity_level=0)Source line 2643
| Parameter | Passing convention | Default / required |
|---|---|---|
dt | positional or keyword | None |
leading_zeros | positional or keyword | True |
granularity_level | positional or keyword | 0 |
peyton_id_prefix_to_timestamp(prefix, granularity_level=0)Source line 2669
| Parameter | Passing convention | Default / required |
|---|---|---|
prefix | positional or keyword | required |
granularity_level | positional or keyword | 0 |
peyton_id(dt=None, length=16, leading_zeros=True, granularity_level=0)Source line 2689
| Parameter | Passing convention | Default / required |
|---|---|---|
dt | positional or keyword | None |
length | positional or keyword | 16 |
leading_zeros | positional or keyword | True |
granularity_level | positional or keyword | 0 |
peyton_id_secure(dt=None, length=16, leading_zeros=True, granularity_level=0)Source line 2693
| Parameter | Passing convention | Default / required |
|---|---|---|
dt | positional or keyword | None |
length | positional or keyword | 16 |
leading_zeros | positional or keyword | True |
granularity_level | positional or keyword | 0 |
class RandomStringSource line 2699
No constructor is declared here. Some utility classes group functions for direct class access; use the call style shown in the guide.
Declared functions, properties, and nested objects:
RandomString.get — methodRandomString.get_alpha — methodRandomString.get_num — methodRandomString.get_alphanum — methodRandomString.secure_get — methodRandomString.secure_get_alpha — methodRandomString.secure_get_num — methodRandomString.secure_get_alphanum — methodRandomString.get(size)Source line 2705
| Parameter | Passing convention | Default / required |
|---|---|---|
size | positional or keyword | required |
RandomString.get_alpha(size)Source line 2710
| Parameter | Passing convention | Default / required |
|---|---|---|
size | positional or keyword | required |
RandomString.get_num(size)Source line 2715
| Parameter | Passing convention | Default / required |
|---|---|---|
size | positional or keyword | required |
RandomString.get_alphanum(size)Source line 2720
| Parameter | Passing convention | Default / required |
|---|---|---|
size | positional or keyword | required |
RandomString.secure_get(size)Source line 2725
| Parameter | Passing convention | Default / required |
|---|---|---|
size | positional or keyword | required |
RandomString.secure_get_alpha(size)Source line 2730
| Parameter | Passing convention | Default / required |
|---|---|---|
size | positional or keyword | required |
RandomString.secure_get_num(size)Source line 2735
| Parameter | Passing convention | Default / required |
|---|---|---|
size | positional or keyword | required |
RandomString.secure_get_alphanum(size)Source line 2740
| Parameter | Passing convention | Default / required |
|---|---|---|
size | positional or keyword | required |
get_all_between(txt, start, end)Source line 2779
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
start | positional or keyword | required |
end | positional or keyword | required |
get_between(txt, start, end)Source line 2785
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
start | positional or keyword | required |
end | positional or keyword | required |
bytes_to_str(b)Source line 2792
| Parameter | Passing convention | Default / required |
|---|---|---|
b | positional or keyword | required |
file_arg_to_str(arg)Source line 2813
| Parameter | Passing convention | Default / required |
|---|---|---|
arg | positional or keyword | required |
file_arg_to_buffer(arg, mode='wb', must_exist=True)Source line 2847
| Parameter | Passing convention | Default / required |
|---|---|---|
arg | positional or keyword | required |
mode | positional or keyword | 'wb' |
must_exist | positional or keyword | True |
file_arg_to_file(arg, mode='r')Source line 2864
| Parameter | Passing convention | Default / required |
|---|---|---|
arg | positional or keyword | required |
mode | positional or keyword | 'r' |
file_arg_to_fp(arg)Source line 2877
| Parameter | Passing convention | Default / required |
|---|---|---|
arg | positional or keyword | required |
extract_int(s)Source line 2885
| Parameter | Passing convention | Default / required |
|---|---|---|
s | positional or keyword | required |
class merge_itersSource line 2896
Construct: merge_iters(*args)
Declared functions, properties, and nested objects:
merge_iters.__init__ — methodmerge_iters.__iter__ — methodmerge_iters.__next__ — methodmerge_iters.__init__(self, *args)Source line 2898
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
merge_iters.__iter__(self)Source line 2903
No caller-supplied parameters are declared.
merge_iters.__next__(self)Source line 2907
No caller-supplied parameters are declared.
class CSVReaderSource line 2917
No constructor is declared here. Some utility classes group functions for direct class access; use the call style shown in the guide.
Declared functions, properties, and nested objects:
CSVReader.CharsAfterQuoted — nested classCSVReader.RowCountMismatch — nested classCSVReader.condense — methodCSVReader.write — methodCSVReader.write_file — methodCSVReader.read — methodCSVReader.basic_read_threaded — async methodCSVReader.basic_read — methodCSVReader.no_quotes_read — methodclass CSVReader.CharsAfterQuoted(Exception)Source line 2918
Construct: CSVReader.CharsAfterQuoted(line_number, char_on_line, char, rows_found)
Declared functions, properties, and nested objects:
CSVReader.CharsAfterQuoted.__init__ — methodCSVReader.CharsAfterQuoted.__init__(self, line_number, char_on_line, char, rows_found)Source line 2919
| Parameter | Passing convention | Default / required |
|---|---|---|
line_number | positional or keyword | required |
char_on_line | positional or keyword | required |
char | positional or keyword | required |
rows_found | positional or keyword | required |
class CSVReader.RowCountMismatch(Exception)Source line 2922
Construct: CSVReader.RowCountMismatch(line_number, amt, expected)
Declared functions, properties, and nested objects:
CSVReader.RowCountMismatch.__init__ — methodCSVReader.RowCountMismatch.__init__(self, line_number, amt, expected)Source line 2923
| Parameter | Passing convention | Default / required |
|---|---|---|
line_number | positional or keyword | required |
amt | positional or keyword | required |
expected | positional or keyword | required |
CSVReader.condense(fp, has_headers=True, unique_only=False, remove_func=None, remove_columns=[])Source line 2926
| Parameter | Passing convention | Default / required |
|---|---|---|
fp | positional or keyword | required |
has_headers | positional or keyword | True |
unique_only | positional or keyword | False |
remove_func | positional or keyword | None |
remove_columns | positional or keyword | [] |
CSVReader.write(rows)Source line 2974
| Parameter | Passing convention | Default / required |
|---|---|---|
rows | positional or keyword | required |
CSVReader.write_file(fp, rows)Source line 2996
| Parameter | Passing convention | Default / required |
|---|---|---|
fp | positional or keyword | required |
rows | positional or keyword | required |
CSVReader.read(arg, has_headers=True, as_list=False)Source line 3002
| Parameter | Passing convention | Default / required |
|---|---|---|
arg | positional or keyword | required |
has_headers | positional or keyword | True |
as_list | positional or keyword | False |
async CSVReader.basic_read_threaded(arg, amt_per_thread=20000, has_headers=True, as_list=False, max_workers=None)Source line 3227
| Parameter | Passing convention | Default / required |
|---|---|---|
arg | positional or keyword | required |
amt_per_thread | positional or keyword | 20000 |
has_headers | positional or keyword | True |
as_list | positional or keyword | False |
max_workers | positional or keyword | None |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
CSVReader.basic_read(arg, has_headers=True, as_list=False, forgiving=False, by_line=None)Source line 3309
| Parameter | Passing convention | Default / required |
|---|---|---|
arg | positional or keyword | required |
has_headers | positional or keyword | True |
as_list | positional or keyword | False |
forgiving | positional or keyword | False |
by_line | positional or keyword | None |
CSVReader.no_quotes_read(arg, has_headers=True, as_list=False)Source line 3410
| Parameter | Passing convention | Default / required |
|---|---|---|
arg | positional or keyword | required |
has_headers | positional or keyword | True |
as_list | positional or keyword | False |
class ListTableSource line 3475
Construct: ListTable(rows, has_headers=True, read_only=True)
Fields assigned by the constructor: has_headers, headers, read_only, rows. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
ListTable.__init__ — methodListTable.dict — methodListTable.__del__ — methodListTable.__getitem__ — methodListTable.__len__ — methodListTable.__iter__ — methodListTable.__next__ — methodListTable.__repr__ — methodListTable.Row — nested classListTable.__init__(self, rows, has_headers=True, read_only=True)Source line 3476
| Parameter | Passing convention | Default / required |
|---|---|---|
rows | positional or keyword | required |
has_headers | positional or keyword | True |
read_only | positional or keyword | True |
ListTable.dict(self)Source line 3505
No caller-supplied parameters are declared.
ListTable.__del__(self)Source line 3512
No caller-supplied parameters are declared.
ListTable.__getitem__(self, key)Source line 3520
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
ListTable.__len__(self)Source line 3524
No caller-supplied parameters are declared.
ListTable.__iter__(self)Source line 3526
No caller-supplied parameters are declared.
ListTable.__next__(self)Source line 3529
No caller-supplied parameters are declared.
ListTable.__repr__(self)Source line 3531
No caller-supplied parameters are declared.
class ListTable.RowSource line 3533
Construct: ListTable.Row(row, table)
Fields assigned by the constructor: row, table. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
ListTable.Row.__init__ — methodListTable.Row.dict — methodListTable.Row.__getitem__ — methodListTable.Row.__eq__ — methodListTable.Row.__len__ — methodListTable.Row.__iter__ — methodListTable.Row.__next__ — methodListTable.Row.__repr__ — methodListTable.Row.__init__(self, row, table)Source line 3534
| Parameter | Passing convention | Default / required |
|---|---|---|
row | positional or keyword | required |
table | positional or keyword | required |
ListTable.Row.dict(self)Source line 3537
No caller-supplied parameters are declared.
ListTable.Row.__getitem__(self, key)Source line 3544
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
ListTable.Row.__eq__(self, other)Source line 3553
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
ListTable.Row.__len__(self)Source line 3559
No caller-supplied parameters are declared.
ListTable.Row.__iter__(self)Source line 3561
No caller-supplied parameters are declared.
ListTable.Row.__next__(self)Source line 3564
No caller-supplied parameters are declared.
ListTable.Row.__repr__(self)Source line 3566
No caller-supplied parameters are declared.
class AsyncLockSource line 3572
Limit concurrent blocks globally and per hashable index.
Waiting requests are considered in arrival order; a blocked request does not
prevent a later request for available indexes from proceeding. Multi-index
requests never hold a partial reservation. Repeated indexes count once.
Like an asyncio.Lock, this lock is not reentrant.
Bare contexts take only a global slot; indexed contexts also take one
slot for each distinct hashable index. Use one lock per event loop.
lock = AsyncLock(max_concurrent=2, max_concurrent_by_index=1)
async with lock["a", "b"]: # lock[["a", "b"]] also works
await do_work()
Construct: AsyncLock(task_timeout=30, max_concurrent=1, max_concurrent_by_index=1, timeout_behavior=0)
Fields assigned by the constructor: max_concurrent, max_concurrent_by_index, task_timeout, timeout_behavior. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
AsyncLock.__init__ — methodAsyncLock.timeout_behavior — propertyAsyncLock.timeout_behavior — property setterAsyncLock.scope — methodAsyncLock.__getitem__ — methodAsyncLock.__aenter__ — async methodAsyncLock.__aexit__ — async methodAsyncLock.__init__(self, task_timeout=30, max_concurrent=1, max_concurrent_by_index=1, timeout_behavior=0)Source line 3587
Configure concurrency limits and behavior when a block times out.
task_timeout is measured in seconds after acquisition; None disables it.
timeout_behavior accepts a number or its string alias:
0 ("raise", default): Cancel the block, then raise asyncio.TimeoutError
after cleanup and release of its global and index slots.
1 ("suppress"): Cancel the block, then continue after async with once
cleanup finishes and slots are released, suppressing only the
lock's timeout error.
2 ("release"): Release slots at the deadline without cancelling the
block. Later work may overlap it, even under the same indexes.
Cancellation in modes 0 and 1 is cooperative; blocking code or suppressed
cancellation can delay release. Queue wait does not count toward timeout.
| Parameter | Passing convention | Default / required |
|---|---|---|
task_timeout | positional or keyword | 30 |
max_concurrent | positional or keyword | 1 |
max_concurrent_by_index | positional or keyword | 1 |
timeout_behavior | positional or keyword | 0 |
AsyncLock.timeout_behavior(self)Source line 3624
Decorators: @property
Timeout mode: 0 raises, 1 suppresses, 2 releases without cancellation.
No caller-supplied parameters are declared.
AsyncLock.timeout_behavior(self, value)Source line 3629
Decorators: @timeout_behavior.setter
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
AsyncLock.scope(self, *indexes, task_timeout=...)Source line 3638
Create a shared-lock context with an optional per-block timeout.
async with lock.scope(task_timeout=1): ...
async with lock.scope("client-id", task_timeout=None): ...
Omission inherits the lock default at acquisition; None disables the
timeout for this block. Indexes share reservations with lock[index].
Queue waiting remains outside the timeout.
| Parameter | Passing convention | Default / required |
|---|---|---|
indexes | extra positional arguments (*args) | optional collection |
task_timeout | keyword only | ... |
AsyncLock.__getitem__(self, indexes)Source line 3655
| Parameter | Passing convention | Default / required |
|---|---|---|
indexes | positional or keyword | required |
async AsyncLock.__aenter__(self)Source line 3661
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async AsyncLock.__aexit__(self, exc_type, exc_value, traceback)Source line 3667
| Parameter | Passing convention | Default / required |
|---|---|---|
exc_type | positional or keyword | required |
exc_value | positional or keyword | required |
traceback | positional or keyword | required |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class AsyncPropertySource line 3795
Construct: AsyncProperty(func)
Fields assigned by the constructor: coro, func. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
AsyncProperty.__init__ — methodAsyncProperty.__await__ — methodAsyncProperty.__get__ — methodAsyncProperty.__set__ — methodAsyncProperty.setter — methodAsyncProperty.__init__(self, func)Source line 3796
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
AsyncProperty.__await__(self)Source line 3800
No caller-supplied parameters are declared.
AsyncProperty.__get__(self, instance, owner)Source line 3802
| Parameter | Passing convention | Default / required |
|---|---|---|
instance | positional or keyword | required |
owner | positional or keyword | required |
AsyncProperty.__set__(self, instance, value)Source line 3805
| Parameter | Passing convention | Default / required |
|---|---|---|
instance | positional or keyword | required |
value | positional or keyword | required |
AsyncProperty.setter(self, func)Source line 3807
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
class CachedPropertySource line 3811
Construct: CachedProperty(func=None, expire=None)
Fields assigned by the constructor: func, is_coro, name, set_func. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
CachedProperty.__init__ — methodCachedProperty.setter — methodCachedProperty.expire — propertyCachedProperty.expire — property setterCachedProperty.get_cached — methodCachedProperty.is_cached — methodCachedProperty.__get__ — methodCachedProperty.__set__ — methodCachedProperty.__call__ — methodCachedProperty.__repr__ — methodCachedProperty.__init__(self, func=None, expire=None)Source line 3812
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | None |
expire | positional or keyword | None |
CachedProperty.setter(self, func)Source line 3828
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
CachedProperty.expire(self)Source line 3832
Decorators: @property
No caller-supplied parameters are declared.
CachedProperty.expire(self, expire)Source line 3835
Decorators: @expire.setter
| Parameter | Passing convention | Default / required |
|---|---|---|
expire | positional or keyword | required |
CachedProperty.get_cached(self, instance)Source line 3844
| Parameter | Passing convention | Default / required |
|---|---|---|
instance | positional or keyword | required |
CachedProperty.is_cached(self, instance)Source line 3848
| Parameter | Passing convention | Default / required |
|---|---|---|
instance | positional or keyword | required |
CachedProperty.__get__(self, instance, owner)Source line 3852
| Parameter | Passing convention | Default / required |
|---|---|---|
instance | positional or keyword | required |
owner | positional or keyword | required |
CachedProperty.__set__(self, instance, value)Source line 3905
| Parameter | Passing convention | Default / required |
|---|---|---|
instance | positional or keyword | required |
value | positional or keyword | required |
CachedProperty.__call__(self, func)Source line 3916
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
CachedProperty.__repr__(self)Source line 3924
No caller-supplied parameters are declared.
class ClassPropertySource line 3928
Construct: ClassProperty(func)
Fields assigned by the constructor: func, name, set_func. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
ClassProperty.__init__ — methodClassProperty.__get__ — methodClassProperty.__set__ — methodClassProperty.__call__ — methodClassProperty.setter — methodClassProperty.__init__(self, func)Source line 3929
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
ClassProperty.__get__(self, instance, owner)Source line 3933
| Parameter | Passing convention | Default / required |
|---|---|---|
instance | positional or keyword | required |
owner | positional or keyword | required |
ClassProperty.__set__(self, instance, value)Source line 3935
| Parameter | Passing convention | Default / required |
|---|---|---|
instance | positional or keyword | required |
value | positional or keyword | required |
ClassProperty.__call__(self, func)Source line 3937
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
ClassProperty.setter(self, func)Source line 3943
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
class CachedClassPropertySource line 3947
Construct: CachedClassProperty(func=None, expire=None)
Fields assigned by the constructor: func, is_coro, name. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
CachedClassProperty.__init__ — methodCachedClassProperty.expire — propertyCachedClassProperty.expire — property setterCachedClassProperty.get_cached — methodCachedClassProperty.__get__ — methodCachedClassProperty.__call__ — methodCachedClassProperty.__repr__ — methodCachedClassProperty.__init__(self, func=None, expire=None)Source line 3948
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | None |
expire | positional or keyword | None |
CachedClassProperty.expire(self)Source line 3964
Decorators: @property
No caller-supplied parameters are declared.
CachedClassProperty.expire(self, expire)Source line 3967
Decorators: @expire.setter
| Parameter | Passing convention | Default / required |
|---|---|---|
expire | positional or keyword | required |
CachedClassProperty.get_cached(self, instance)Source line 3976
| Parameter | Passing convention | Default / required |
|---|---|---|
instance | positional or keyword | required |
CachedClassProperty.__get__(self, instance, owner)Source line 3979
| Parameter | Passing convention | Default / required |
|---|---|---|
instance | positional or keyword | required |
owner | positional or keyword | required |
CachedClassProperty.__call__(self, func)Source line 4012
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
CachedClassProperty.__repr__(self)Source line 4020
No caller-supplied parameters are declared.
class StringInfoSource line 4024
Construct: StringInfo(s)
Fields assigned by the constructor: alpha_count, char_array, digit_count, is_float, is_int, lower_count, most_common, most_common_count, str, upper_count, word_array, word_list. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
StringInfo.indexes — methodStringInfo.__getattr__ — methodStringInfo.__init__ — methodStringInfo.__len__ — methodStringInfo.lower — methodStringInfo.char_count — methodStringInfo.avg_word_len — methodStringInfo.check — methodStringInfo.check_alt — methodStringInfo.regex_links — methodStringInfo.links — methodStringInfo.indexes(l, v)Source line 4030
| Parameter | Passing convention | Default / required |
|---|---|---|
l | positional or keyword | required |
v | positional or keyword | required |
StringInfo.__getattr__(self, name)Source line 4038
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
StringInfo.__init__(self, s)Source line 4040
| Parameter | Passing convention | Default / required |
|---|---|---|
s | positional or keyword | required |
StringInfo.__len__(self)Source line 4096
No caller-supplied parameters are declared.
StringInfo.lower(self)Source line 4098
No caller-supplied parameters are declared.
StringInfo.char_count(self, c)Source line 4100
| Parameter | Passing convention | Default / required |
|---|---|---|
c | positional or keyword | required |
StringInfo.avg_word_len(self)Source line 4104
No caller-supplied parameters are declared.
StringInfo.check(self, *args)Source line 4112
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
StringInfo.check_alt(self, i)Source line 4127
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
StringInfo.regex_links(self)Source line 4140
No caller-supplied parameters are declared.
StringInfo.links(self)Source line 4142
No caller-supplied parameters are declared.
class LinkInfoSource line 4146
Construct: LinkInfo(url)
Fields assigned by the constructor: domain_name, fragment, hostname, path, port, qs, qs_raw, scheme, sld, subdomains, text_url, tld, url. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
LinkInfo.qs_parse — methodLinkInfo.base_url — propertyLinkInfo.__init__ — methodLinkInfo.hash — decorated property (see guide)LinkInfo.__str__ — methodLinkInfo.__len__ — methodLinkInfo.__eq__ — methodLinkInfo.__repr__ — methodLinkInfo.regex_find — methodLinkInfo.find — methodLinkInfo.qs_parse(qs)Source line 4148
| Parameter | Passing convention | Default / required |
|---|---|---|
qs | positional or keyword | required |
LinkInfo.base_url(self)Source line 4167
Decorators: @property
No caller-supplied parameters are declared.
LinkInfo.__init__(self, url)Source line 4177
| Parameter | Passing convention | Default / required |
|---|---|---|
url | positional or keyword | required |
LinkInfo.hash(self)Source line 4246
Decorators: @CachedProperty
No caller-supplied parameters are declared.
LinkInfo.__str__(self)Source line 4254
No caller-supplied parameters are declared.
LinkInfo.__len__(self)Source line 4256
No caller-supplied parameters are declared.
LinkInfo.__eq__(self, other)Source line 4258
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
LinkInfo.__repr__(self)Source line 4264
No caller-supplied parameters are declared.
LinkInfo.regex_find(string)Source line 4267
| Parameter | Passing convention | Default / required |
|---|---|---|
string | positional or keyword | required |
LinkInfo.find(string)Source line 4274
| Parameter | Passing convention | Default / required |
|---|---|---|
string | positional or keyword | required |
class ZF_REQSource line 4357
No constructor is declared here. Some utility classes group functions for direct class access; use the call style shown in the guide.
Declared functions, properties, and nested objects:
ZF_REQ._data — nested classZF_REQ.request — methodZF_REQ.download — methodclass ZF_REQ._dataSource line 4358
Construct: ZF_REQ._data(b, r)
Fields assigned by the constructor: compress_sizes, content, encoding, ratio, request. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
ZF_REQ._data.__init__ — methodZF_REQ._data.json — methodZF_REQ._data.text — propertyZF_REQ._data.__getattr__ — methodZF_REQ._data.__repr__ — methodZF_REQ._data.__init__(self, b, r)Source line 4359
| Parameter | Passing convention | Default / required |
|---|---|---|
b | positional or keyword | required |
r | positional or keyword | required |
ZF_REQ._data.json(self)Source line 4365
No caller-supplied parameters are declared.
ZF_REQ._data.text(self)Source line 4368
Decorators: @property
No caller-supplied parameters are declared.
ZF_REQ._data.__getattr__(self, name)Source line 4370
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
ZF_REQ._data.__repr__(self)Source line 4372
No caller-supplied parameters are declared.
ZF_REQ.request(url, params=None, headers=None, timeout=600)Source line 4377
| Parameter | Passing convention | Default / required |
|---|---|---|
url | positional or keyword | required |
params | positional or keyword | None |
headers | positional or keyword | None |
timeout | positional or keyword | 600 |
ZF_REQ.download(fp, url, *args, **kwargs)Source line 4398
| Parameter | Passing convention | Default / required |
|---|---|---|
fp | positional or keyword | required |
url | positional or keyword | required |
args | extra positional arguments (*args) | optional collection |
kwargs | extra keyword arguments (**kwargs) | optional collection |
randomize_list(l)Source line 4421
| Parameter | Passing convention | Default / required |
|---|---|---|
l | positional or keyword | required |
class IterLoopSource line 4429
Construct: IterLoop(i)
Fields assigned by the constructor: l. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
IterLoop.__init__ — methodIterLoop.next — methodIterLoop.__contains__ — methodIterLoop.__len__ — methodIterLoop.__iter__ — methodIterLoop.__next__ — methodIterLoop.__init__(self, i)Source line 4430
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
IterLoop.next(self)Source line 4435
No caller-supplied parameters are declared.
IterLoop.__contains__(self, item)Source line 4437
| Parameter | Passing convention | Default / required |
|---|---|---|
item | positional or keyword | required |
IterLoop.__len__(self)Source line 4439
No caller-supplied parameters are declared.
IterLoop.__iter__(self)Source line 4441
No caller-supplied parameters are declared.
IterLoop.__next__(self)Source line 4444
No caller-supplied parameters are declared.
class CountryInfoSource line 4487
Construct: CountryInfo(key=None, compressed_requests=False)
Fields assigned by the constructor: compressed_requests, key. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
CountryInfo.__init__ — methodCountryInfo.request — methodCountryInfo.countries — decorated property (see guide)CountryInfo.__init__(self, key=None, compressed_requests=False)Source line 4488
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | None |
compressed_requests | positional or keyword | False |
CountryInfo.request(self, url, **kwargs)Source line 4491
| Parameter | Passing convention | Default / required |
|---|---|---|
url | positional or keyword | required |
kwargs | extra keyword arguments (**kwargs) | optional collection |
CountryInfo.countries(self)Source line 4511
Decorators: @CachedProperty
No caller-supplied parameters are declared.
class IpInfoSource line 4523
Construct: IpInfo(ip=None, data=None)
Fields assigned by the constructor: asn, city, country, hostname, ip, location, org, postal, raw_org, region. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
IpInfo.ip_list — methodIpInfo.get_ip — methodIpInfo.is_ipv4 — methodIpInfo.is_ipv6 — methodIpInfo.__repr__ — methodIpInfo.__init__ — methodIpInfo.dict — methodIpInfo.__hash__ — methodIpInfo.fqdn — methodIpInfo.__eq__ — methodIpInfo.ip_list(cls)Source line 4534
Decorators: @ClassProperty
No caller-supplied parameters are declared.
IpInfo.get_ip(ip=None)Source line 4698
| Parameter | Passing convention | Default / required |
|---|---|---|
ip | positional or keyword | None |
IpInfo.is_ipv4(ip)Source line 4722
| Parameter | Passing convention | Default / required |
|---|---|---|
ip | positional or keyword | required |
IpInfo.is_ipv6(ip)Source line 4747
| Parameter | Passing convention | Default / required |
|---|---|---|
ip | positional or keyword | required |
IpInfo.__repr__(self)Source line 4757
No caller-supplied parameters are declared.
IpInfo.__init__(self, ip=None, data=None)Source line 4759
| Parameter | Passing convention | Default / required |
|---|---|---|
ip | positional or keyword | None |
data | positional or keyword | None |
IpInfo.dict(self)Source line 4804
No caller-supplied parameters are declared.
IpInfo.__hash__(self)Source line 4816
No caller-supplied parameters are declared.
IpInfo.fqdn(self)Source line 4821
No caller-supplied parameters are declared.
IpInfo.__eq__(self, other)Source line 4823
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
class AsyncIpInfoSource line 4835
Construct: AsyncIpInfo(ip=None, data=None)
Fields assigned by the constructor: asn, city, country, hostname, ip, loaded, location, org, postal, raw_org, region, timestamp. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
AsyncIpInfo.ip_list — methodAsyncIpInfo.get_ip — async methodAsyncIpInfo.is_ipv4 — methodAsyncIpInfo.is_ipv6 — methodAsyncIpInfo.__repr__ — methodAsyncIpInfo.__init__ — methodAsyncIpInfo.__await__ — methodAsyncIpInfo.dict — methodAsyncIpInfo.__hash__ — methodAsyncIpInfo.fqdn — methodAsyncIpInfo.__eq__ — methodAsyncIpInfo.ip_list(cls)Source line 4846
Decorators: @ClassProperty
No caller-supplied parameters are declared.
async AsyncIpInfo.get_ip(ip=None)Source line 5071
| Parameter | Passing convention | Default / required |
|---|---|---|
ip | positional or keyword | None |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
AsyncIpInfo.is_ipv4(ip)Source line 5096
| Parameter | Passing convention | Default / required |
|---|---|---|
ip | positional or keyword | required |
AsyncIpInfo.is_ipv6(ip)Source line 5121
| Parameter | Passing convention | Default / required |
|---|---|---|
ip | positional or keyword | required |
AsyncIpInfo.__repr__(self)Source line 5131
No caller-supplied parameters are declared.
AsyncIpInfo.__init__(self, ip=None, data=None)Source line 5133
| Parameter | Passing convention | Default / required |
|---|---|---|
ip | positional or keyword | None |
data | positional or keyword | None |
AsyncIpInfo.__await__(self)Source line 5192
No caller-supplied parameters are declared.
AsyncIpInfo.dict(self)Source line 5194
No caller-supplied parameters are declared.
AsyncIpInfo.__hash__(self)Source line 5207
No caller-supplied parameters are declared.
AsyncIpInfo.fqdn(self)Source line 5212
No caller-supplied parameters are declared.
AsyncIpInfo.__eq__(self, other)Source line 5214
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
quick_save(fp, data, *args, **kwargs)Source line 5230
| Parameter | Passing convention | Default / required |
|---|---|---|
fp | positional or keyword | required |
data | positional or keyword | required |
args | extra positional arguments (*args) | optional collection |
kwargs | extra keyword arguments (**kwargs) | optional collection |
obj_attr_print(obj, no_methods=True, no_class_attrs=False, show_type=False, ignore=[])Source line 5241
| Parameter | Passing convention | Default / required |
|---|---|---|
obj | positional or keyword | required |
no_methods | positional or keyword | True |
no_class_attrs | positional or keyword | False |
show_type | positional or keyword | False |
ignore | positional or keyword | [] |
obj_attr_txt(obj, no_methods=True, no_class_attrs=False, show_type=False, ignore=[])Source line 5257
| Parameter | Passing convention | Default / required |
|---|---|---|
obj | positional or keyword | required |
no_methods | positional or keyword | True |
no_class_attrs | positional or keyword | False |
show_type | positional or keyword | False |
ignore | positional or keyword | [] |
class BivariateDataSource line 5277
Construct: BivariateData(data)
Fields assigned by the constructor: data, data_points, x, x_info, y, y_info. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
BivariateData.DataPoint — nested classBivariateData.__init__ — methodBivariateData.slope — decorated property (see guide)BivariateData.correlation — decorated property (see guide)BivariateData.plot — methodBivariateData.plot_residuals — methodBivariateData.show — methodBivariateData.show_residuals — methodclass BivariateData.DataPointSource line 5278
Construct: BivariateData.DataPoint(x, y, bd)
Fields assigned by the constructor: bd, x, y. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
BivariateData.DataPoint.__init__ — methodBivariateData.DataPoint.residual — decorated property (see guide)BivariateData.DataPoint.__init__(self, x, y, bd)Source line 5279
| Parameter | Passing convention | Default / required |
|---|---|---|
x | positional or keyword | required |
y | positional or keyword | required |
bd | positional or keyword | required |
BivariateData.DataPoint.residual(self)Source line 5284
Decorators: @CachedProperty
No caller-supplied parameters are declared.
BivariateData.__init__(self, data)Source line 5287
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
BivariateData.slope(self)Source line 5300
Decorators: @CachedProperty
No caller-supplied parameters are declared.
BivariateData.correlation(self)Source line 5305
Decorators: @CachedProperty
No caller-supplied parameters are declared.
BivariateData.plot(self, format='png', show_slope=True, show_residual_lines=False)Source line 5345
| Parameter | Passing convention | Default / required |
|---|---|---|
format | positional or keyword | 'png' |
show_slope | positional or keyword | True |
show_residual_lines | positional or keyword | False |
BivariateData.plot_residuals(self, format='png', show_line=True)Source line 5351
| Parameter | Passing convention | Default / required |
|---|---|---|
format | positional or keyword | 'png' |
show_line | positional or keyword | True |
BivariateData.show(self, show_slope=True, show_residual_lines=False)Source line 5357
| Parameter | Passing convention | Default / required |
|---|---|---|
show_slope | positional or keyword | True |
show_residual_lines | positional or keyword | False |
BivariateData.show_residuals(self, show_line=True)Source line 5360
| Parameter | Passing convention | Default / required |
|---|---|---|
show_line | positional or keyword | True |
class SlopeSource line 5364
Construct: Slope(slope, yint)
Fields assigned by the constructor: slope, yint. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Slope.__init__ — methodSlope.__str__ — methodSlope.__call__ — methodSlope.__init__(self, slope, yint)Source line 5365
| Parameter | Passing convention | Default / required |
|---|---|---|
slope | positional or keyword | required |
yint | positional or keyword | required |
Slope.__str__(self)Source line 5368
No caller-supplied parameters are declared.
Slope.__call__(self, x=None, y=None)Source line 5373
| Parameter | Passing convention | Default / required |
|---|---|---|
x | positional or keyword | None |
y | positional or keyword | None |
class CacheListSource line 5380
Construct: CacheList(max_cache_size=100)
Fields assigned by the constructor: idx, max_cache_size, queue, stringify. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
CacheList.__init__ — methodCacheList.stringify_func — methodCacheList.append — methodCacheList.add — methodCacheList.remove — methodCacheList.pop — methodCacheList.get — methodCacheList.__len__ — methodCacheList.__getitem__ — methodCacheList.__iter__ — methodCacheList.__contains__ — methodCacheList.__init__(self, max_cache_size=100)Source line 5381
| Parameter | Passing convention | Default / required |
|---|---|---|
max_cache_size | positional or keyword | 100 |
CacheList.stringify_func(self, func)Source line 5388
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
CacheList.append(self, item)Source line 5393
| Parameter | Passing convention | Default / required |
|---|---|---|
item | positional or keyword | required |
CacheList.add(self, item)Source line 5406
| Parameter | Passing convention | Default / required |
|---|---|---|
item | positional or keyword | required |
CacheList.remove(self, item)Source line 5408
| Parameter | Passing convention | Default / required |
|---|---|---|
item | positional or keyword | required |
CacheList.pop(self, index=-1)Source line 5413
| Parameter | Passing convention | Default / required |
|---|---|---|
index | positional or keyword | -1 |
CacheList.get(self, key, default=None)Source line 5419
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
default | positional or keyword | None |
CacheList.__len__(self)Source line 5424
No caller-supplied parameters are declared.
CacheList.__getitem__(self, key)Source line 5426
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
CacheList.__iter__(self)Source line 5428
No caller-supplied parameters are declared.
CacheList.__contains__(self, value)Source line 5430
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
class UniqueSource line 5435
Construct: Unique(max_items=None)
Fields assigned by the constructor: max_items, v. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Unique.__init__ — methodUnique.append — methodUnique.remove — methodUnique.pop — methodUnique.purge_func — methodUnique.__call__ — methodUnique.__len__ — methodUnique.__getitem__ — methodUnique.__iter__ — methodUnique.__contains__ — methodUnique.__init__(self, max_items=None)Source line 5436
| Parameter | Passing convention | Default / required |
|---|---|---|
max_items | positional or keyword | None |
Unique.append(self, item)Source line 5441
| Parameter | Passing convention | Default / required |
|---|---|---|
item | positional or keyword | required |
Unique.remove(self, item)Source line 5443
| Parameter | Passing convention | Default / required |
|---|---|---|
item | positional or keyword | required |
Unique.pop(self, index=-1)Source line 5446
| Parameter | Passing convention | Default / required |
|---|---|---|
index | positional or keyword | -1 |
Unique.purge_func(self, func)Source line 5449
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
Unique.__call__(self, v)Source line 5454
| Parameter | Passing convention | Default / required |
|---|---|---|
v | positional or keyword | required |
Unique.__len__(self)Source line 5463
No caller-supplied parameters are declared.
Unique.__getitem__(self, key)Source line 5465
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
Unique.__iter__(self)Source line 5467
No caller-supplied parameters are declared.
Unique.__contains__(self, value)Source line 5469
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
class UniqueDictSource line 5472
Construct: UniqueDict()
Fields assigned by the constructor: v. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
UniqueDict.__init__ — methodUniqueDict.__call__ — methodUniqueDict.__getitem__ — methodUniqueDict.__setitem__ — methodUniqueDict.__iter__ — methodUniqueDict.__next__ — methodUniqueDict.all — methodUniqueDict.__init__(self)Source line 5473
No caller-supplied parameters are declared.
UniqueDict.__call__(self, v)Source line 5475
| Parameter | Passing convention | Default / required |
|---|---|---|
v | positional or keyword | required |
UniqueDict.__getitem__(self, key)Source line 5480
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
UniqueDict.__setitem__(self, key, value)Source line 5482
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
value | positional or keyword | required |
UniqueDict.__iter__(self)Source line 5487
No caller-supplied parameters are declared.
UniqueDict.__next__(self)Source line 5490
No caller-supplied parameters are declared.
UniqueDict.all(self)Source line 5492
No caller-supplied parameters are declared.
count_dict(l, compare=None, estimate=False)Source line 5497
| Parameter | Passing convention | Default / required |
|---|---|---|
l | positional or keyword | required |
compare | positional or keyword | None |
estimate | positional or keyword | False |
class TimeEstimateSource line 5523
Construct: TimeEstimate(amt=None, print_every=None, print_format='<done>/<t> (<p>) | ~<e> Remaining | <a>/trial', over_time_est=None)
Fields assigned by the constructor: amt, over_time_est, print_every, print_format, trial_count. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
TimeEstimate.__init__ — methodTimeEstimate.__iter__ — methodTimeEstimate.__next__ — methodTimeEstimate.format — methodTimeEstimate.remaining — propertyTimeEstimate.percent_done — propertyTimeEstimate.percent_done_str — propertyTimeEstimate.estimate — propertyTimeEstimate.estimate_str — propertyTimeEstimate.duration — propertyTimeEstimate.end_duration_estimate — propertyTimeEstimate.duration_str — propertyTimeEstimate.avg_duration — propertyTimeEstimate.avg_duration_str — propertyTimeEstimate.print_results — methodTimeEstimate.txt_results — methodTimeEstimate.__init__(self, amt=None, print_every=None, print_format='<done>/<t> (<p>) | ~<e> Remaining | <a>/trial', over_time_est=None)Source line 5524
| Parameter | Passing convention | Default / required |
|---|---|---|
amt | positional or keyword | None |
print_every | positional or keyword | None |
print_format | positional or keyword | '<done>/<t> (<p>) | ~<e> Remaining | <a>/trial' |
over_time_est | positional or keyword | None |
TimeEstimate.__iter__(self)Source line 5532
No caller-supplied parameters are declared.
TimeEstimate.__next__(self)Source line 5541
No caller-supplied parameters are declared.
TimeEstimate.format(self, format_str)Source line 5566
| Parameter | Passing convention | Default / required |
|---|---|---|
format_str | positional or keyword | required |
TimeEstimate.remaining(self)Source line 5590
Decorators: @property
No caller-supplied parameters are declared.
TimeEstimate.percent_done(self)Source line 5593
Decorators: @property
No caller-supplied parameters are declared.
TimeEstimate.percent_done_str(self)Source line 5596
Decorators: @property
No caller-supplied parameters are declared.
TimeEstimate.estimate(self)Source line 5599
Decorators: @property
No caller-supplied parameters are declared.
TimeEstimate.estimate_str(self)Source line 5602
Decorators: @property
No caller-supplied parameters are declared.
TimeEstimate.duration(self)Source line 5605
Decorators: @property
No caller-supplied parameters are declared.
TimeEstimate.end_duration_estimate(self)Source line 5611
Decorators: @property
No caller-supplied parameters are declared.
TimeEstimate.duration_str(self)Source line 5617
Decorators: @property
No caller-supplied parameters are declared.
TimeEstimate.avg_duration(self)Source line 5620
Decorators: @property
No caller-supplied parameters are declared.
TimeEstimate.avg_duration_str(self)Source line 5629
Decorators: @property
No caller-supplied parameters are declared.
TimeEstimate.print_results(self)Source line 5631
No caller-supplied parameters are declared.
TimeEstimate.txt_results(self)Source line 5635
No caller-supplied parameters are declared.
class ReverseListIterSource line 5641
Construct: ReverseListIter(item)
Declared functions, properties, and nested objects:
ReverseListIter.__init__ — methodReverseListIter.__iter__ — methodReverseListIter.__next__ — methodReverseListIter.__init__(self, item)Source line 5642
| Parameter | Passing convention | Default / required |
|---|---|---|
item | positional or keyword | required |
ReverseListIter.__iter__(self)Source line 5646
No caller-supplied parameters are declared.
ReverseListIter.__next__(self)Source line 5649
No caller-supplied parameters are declared.
make_json_parsable(d)Source line 5656
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
dict_print(d, indent=2, parse=True)Source line 5692
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
indent | positional or keyword | 2 |
parse | positional or keyword | True |
class TxtParserExpSource line 5704
Construct: TxtParserExp(format_txt, var_chars=['<', '>'], handle_not_found=False, possible_chars=['[', ']'])
Fields assigned by the constructor: format_txt, formats, handle_not_found, possible_chars, var_chars. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
TxtParserExp.__init__ — methodTxtParserExp.__call__ — methodTxtParserExp.__init__(self, format_txt, var_chars=['<', '>'], handle_not_found=False, possible_chars=['[', ']'])Source line 5705
| Parameter | Passing convention | Default / required |
|---|---|---|
format_txt | positional or keyword | required |
var_chars | positional or keyword | ['<', '>'] |
handle_not_found | positional or keyword | False |
possible_chars | positional or keyword | ['[', ']'] |
TxtParserExp.__call__(self, txt, **kwargs)Source line 5794
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
kwargs | extra keyword arguments (**kwargs) | optional collection |
class TxtParserSource line 5861
Construct: TxtParser(format_txt, var_chars=['<', '>'], handle_not_found=False, possible_chars=['[', ']'])
Fields assigned by the constructor: format_txt, formats, handle_not_found, possible_chars, regex_format, var_chars. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
TxtParser.__init__ — methodTxtParser.__call__ — methodTxtParser.__init__(self, format_txt, var_chars=['<', '>'], handle_not_found=False, possible_chars=['[', ']'])Source line 5867
| Parameter | Passing convention | Default / required |
|---|---|---|
format_txt | positional or keyword | required |
var_chars | positional or keyword | ['<', '>'] |
handle_not_found | positional or keyword | False |
possible_chars | positional or keyword | ['[', ']'] |
TxtParser.__call__(self, txt, **kwargs)Source line 5933
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
kwargs | extra keyword arguments (**kwargs) | optional collection |
class TxtParserBasicSource line 6024
Construct: TxtParserBasic(format_txt, var_chars=['<', '>'], handle_not_found=False)
Fields assigned by the constructor: format_txt, formats, handle_not_found, var_chars. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
TxtParserBasic.__init__ — methodTxtParserBasic.__call__ — methodTxtParserBasic.__init__(self, format_txt, var_chars=['<', '>'], handle_not_found=False)Source line 6025
| Parameter | Passing convention | Default / required |
|---|---|---|
format_txt | positional or keyword | required |
var_chars | positional or keyword | ['<', '>'] |
handle_not_found | positional or keyword | False |
TxtParserBasic.__call__(self, txt, **kwargs)Source line 6060
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
kwargs | extra keyword arguments (**kwargs) | optional collection |
split_multi_old(txt, *items, amt=None, cap_sensitive=True)Source line 6111
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
items | extra positional arguments (*args) | optional collection |
amt | keyword only | None |
cap_sensitive | keyword only | True |
split_old(txt, item, amt=None, cap_sensitive=True)Source line 6168
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
item | positional or keyword | required |
amt | positional or keyword | None |
cap_sensitive | positional or keyword | True |
split_multi(txt, *items, amt=None, cap_sensitive=True)Source line 6199
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
items | extra positional arguments (*args) | optional collection |
amt | keyword only | None |
cap_sensitive | keyword only | True |
split(txt, item, amt=None, cap_sensitive=True)Source line 6226
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
item | positional or keyword | required |
amt | positional or keyword | None |
cap_sensitive | positional or keyword | True |
class AndroidDeviceSource line 6235
Construct: AndroidDevice(r)
Fields assigned by the constructor: device, marketing_name, model, retail_branding. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
AndroidDevice._DeviceIndex — nested classAndroidDevice.model_index — methodAndroidDevice.opt_models — methodAndroidDevice.devices — methodAndroidDevice.data — methodAndroidDevice.__init__ — methodAndroidDevice.__str__ — methodAndroidDevice.__contains__ — methodAndroidDevice.get_model — methodAndroidDevice.__repr__ — methodclass AndroidDevice._DeviceIndexSource line 6239
Construct: AndroidDevice._DeviceIndex(d, attr, f_idx=0)
Fields assigned by the constructor: attr, d, f_idx, index. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
AndroidDevice._DeviceIndex.__init__ — methodAndroidDevice._DeviceIndex.get — methodAndroidDevice._DeviceIndex.__init__(self, d, attr, f_idx=0)Source line 6240
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
attr | positional or keyword | required |
f_idx | positional or keyword | 0 |
AndroidDevice._DeviceIndex.get(self, i)Source line 6276
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
AndroidDevice.model_index(cls)Source line 6295
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
AndroidDevice.opt_models(cls)Source line 6299
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
AndroidDevice.devices(cls)Source line 6310
Decorators: @ClassProperty
No caller-supplied parameters are declared.
AndroidDevice.data(cls)Source line 6318
Decorators: @ClassProperty
No caller-supplied parameters are declared.
AndroidDevice.__init__(self, r)Source line 6375
| Parameter | Passing convention | Default / required |
|---|---|---|
r | positional or keyword | required |
AndroidDevice.__str__(self)Source line 6380
No caller-supplied parameters are declared.
AndroidDevice.__contains__(self, value)Source line 6391
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
AndroidDevice.get_model(model)Source line 6393
| Parameter | Passing convention | Default / required |
|---|---|---|
model | positional or keyword | required |
AndroidDevice.__repr__(self)Source line 6406
No caller-supplied parameters are declared.
class AgentFormatSource line 6409
Construct: AgentFormat(parser, os, device=None, is_mobile=None, is_tablet=None)
Fields assigned by the constructor: device, is_mobile, is_tablet, os, parser. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
AgentFormat.__init__ — methodAgentFormat.__call__ — methodAgentFormat.__str__ — methodAgentFormat.__init__(self, parser, os, device=None, is_mobile=None, is_tablet=None)Source line 6410
| Parameter | Passing convention | Default / required |
|---|---|---|
parser | positional or keyword | required |
os | positional or keyword | required |
device | positional or keyword | None |
is_mobile | positional or keyword | None |
is_tablet | positional or keyword | None |
AgentFormat.__call__(self, *args, **kwargs)Source line 6416
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
kwargs | extra keyword arguments (**kwargs) | optional collection |
AgentFormat.__str__(self)Source line 6418
No caller-supplied parameters are declared.
class UserAgentSource line 6420
Construct: UserAgent(txt)
Fields assigned by the constructor: device, extra_info, os, os_version, txt. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
UserAgent.from_request — class methodUserAgent.Formats — nested classUserAgent.Version — nested classUserAgent.__init__ — methodUserAgent.base — decorated property (see guide)UserAgent.is_mobile — decorated property (see guide)UserAgent.is_crawler — propertyUserAgent.browser_version — decorated property (see guide)UserAgent.browser — decorated property (see guide)UserAgent.is_google — decorated property (see guide)UserAgent.is_bing — propertyUserAgent.is_bot — decorated property (see guide)UserAgent.from_request(cls, request)Source line 6486
Decorators: @classmethod
| Parameter | Passing convention | Default / required |
|---|---|---|
request | positional or keyword | required |
class UserAgent.FormatsSource line 6553
No constructor is declared here. Some utility classes group functions for direct class access; use the call style shown in the guide.
Declared functions, properties, and nested objects:
UserAgent.Formats._opt_iter — nested classUserAgent.Formats._opt_iters — nested classUserAgent.Formats.opt — methodclass UserAgent.Formats._opt_iterSource line 6554
Construct: UserAgent.Formats._opt_iter(opt, remove=[])
Fields assigned by the constructor: l, opt. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
UserAgent.Formats._opt_iter.__init__ — methodUserAgent.Formats._opt_iter.__iter__ — methodUserAgent.Formats._opt_iter.__next__ — methodUserAgent.Formats._opt_iter.__init__(self, opt, remove=[])Source line 6555
| Parameter | Passing convention | Default / required |
|---|---|---|
opt | positional or keyword | required |
remove | positional or keyword | [] |
UserAgent.Formats._opt_iter.__iter__(self)Source line 6568
No caller-supplied parameters are declared.
UserAgent.Formats._opt_iter.__next__(self)Source line 6571
No caller-supplied parameters are declared.
class UserAgent.Formats._opt_itersSource line 6573
No constructor is declared here. Some utility classes group functions for direct class access; use the call style shown in the guide.
Declared functions, properties, and nested objects:
UserAgent.Formats._opt_iters.i1 — methodUserAgent.Formats._opt_iters.i2 — methodUserAgent.Formats._opt_iters.i3 — methodUserAgent.Formats._opt_iters.i4 — methodUserAgent.Formats._opt_iters.i5 — methodUserAgent.Formats._opt_iters.i6 — methodUserAgent.Formats._opt_iters.i7 — methodUserAgent.Formats._opt_iters.i8 — methodUserAgent.Formats._opt_iters.i9 — methodUserAgent.Formats._opt_iters.i1(cls)Source line 6575
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
UserAgent.Formats._opt_iters.i2(cls)Source line 6580
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
UserAgent.Formats._opt_iters.i3(cls)Source line 6585
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
UserAgent.Formats._opt_iters.i4(cls)Source line 6590
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
UserAgent.Formats._opt_iters.i5(cls)Source line 6595
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
UserAgent.Formats._opt_iters.i6(cls)Source line 6600
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
UserAgent.Formats._opt_iters.i7(cls)Source line 6605
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
UserAgent.Formats._opt_iters.i8(cls)Source line 6610
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
UserAgent.Formats._opt_iters.i9(cls)Source line 6615
Decorators: @CachedClassProperty
No caller-supplied parameters are declared.
UserAgent.Formats.opt(text, base)Source line 6644
| Parameter | Passing convention | Default / required |
|---|---|---|
text | positional or keyword | required |
base | positional or keyword | required |
class UserAgent.VersionSource line 6816
Construct: UserAgent.Version(v_str)
Fields assigned by the constructor: extra, major, minor, patch, raw, short. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
UserAgent.Version.__init__ — methodUserAgent.Version.__lt__ — methodUserAgent.Version.__gt__ — methodUserAgent.Version.__eq__ — methodUserAgent.Version.__str__ — methodUserAgent.Version.__repr__ — methodUserAgent.Version.__init__(self, v_str)Source line 6817
| Parameter | Passing convention | Default / required |
|---|---|---|
v_str | positional or keyword | required |
UserAgent.Version.__lt__(self, other)Source line 6858
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
UserAgent.Version.__gt__(self, other)Source line 6872
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
UserAgent.Version.__eq__(self, other: object) -> boolSource line 6874
| Parameter | Passing convention | Default / required |
|---|---|---|
other: object | positional or keyword | required |
Return annotation: bool.
UserAgent.Version.__str__(self)Source line 6879
No caller-supplied parameters are declared.
UserAgent.Version.__repr__(self)Source line 6881
No caller-supplied parameters are declared.
UserAgent.__init__(self, txt)Source line 6900
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
UserAgent.base(self)Source line 6954
Decorators: @CachedProperty
No caller-supplied parameters are declared.
UserAgent.is_mobile(self)Source line 6963
Decorators: @CachedProperty
No caller-supplied parameters are declared.
UserAgent.is_crawler(self)Source line 6973
Decorators: @property
No caller-supplied parameters are declared.
UserAgent.browser_version(self)Source line 6980
Decorators: @CachedProperty
No caller-supplied parameters are declared.
UserAgent.browser(self)Source line 6986
Decorators: @CachedProperty
No caller-supplied parameters are declared.
UserAgent.is_google(self)Source line 7097
Decorators: @CachedProperty
No caller-supplied parameters are declared.
UserAgent.is_bing(self)Source line 7104
Decorators: @property
No caller-supplied parameters are declared.
UserAgent.is_bot(self)Source line 7107
Decorators: @CachedProperty
No caller-supplied parameters are declared.
class TimeSource line 7169
No constructor is declared here. Some utility classes group functions for direct class access; use the call style shown in the guide.
Declared functions, properties, and nested objects:
Time._TimestampFormat — nested classTime._Measure — nested classTime.to_min — methodTime.parse_datetime — methodTime.parse_time — methodTime.date_formats — methodTime.parse_date — methodclass Time._TimestampFormatSource line 7170
Construct: Time._TimestampFormat(name, parser=None)
Fields assigned by the constructor: name, parser, to_datetime. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Time._TimestampFormat.__init__ — methodTime._TimestampFormat.datetime_convert — methodTime._TimestampFormat.parser_func — methodTime._TimestampFormat.__call__ — methodTime._TimestampFormat.__init__(self, name, parser=None)Source line 7187
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
parser | positional or keyword | None |
Time._TimestampFormat.datetime_convert(self, func)Source line 7191
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
Time._TimestampFormat.parser_func(self, func)Source line 7193
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
Time._TimestampFormat.__call__(self, timestamp_str)Source line 7195
| Parameter | Passing convention | Default / required |
|---|---|---|
timestamp_str | positional or keyword | required |
class Time._MeasureSource line 7201
Construct: Time._Measure(name, short, char, seconds, *aliases)
Fields assigned by the constructor: aliases, char, name, seconds, short. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Time._Measure.__init__ — methodTime._Measure.__float__ — methodTime._Measure.__str__ — methodTime._Measure.__repr__ — methodTime._Measure.__contains__ — methodTime._Measure.__init__(self, name, short, char, seconds, *aliases)Source line 7202
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
short | positional or keyword | required |
char | positional or keyword | required |
seconds | positional or keyword | required |
aliases | extra positional arguments (*args) | optional collection |
Time._Measure.__float__(self)Source line 7208
No caller-supplied parameters are declared.
Time._Measure.__str__(self)Source line 7210
No caller-supplied parameters are declared.
Time._Measure.__repr__(self)Source line 7212
No caller-supplied parameters are declared.
Time._Measure.__contains__(self, other)Source line 7214
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
Time.to_min(amt, dur_str)Source line 7301
| Parameter | Passing convention | Default / required |
|---|---|---|
amt | positional or keyword | required |
dur_str | positional or keyword | required |
Time.parse_datetime(txt, day_first=None, tzinfo=None)Source line 7336
Parse common timestamps, returning None for invalid input. Numeric dates default to month-first unless the first field exceeds 12. True enforces day-first; False enforces month-first. Year-first dates are unambiguous. Missing date fields use today's UTC date; missing times use midnight. tzinfo supplies the timezone for inputs without an explicit zone. Explicit timezone offsets are preserved. Unix timestamps convert into tzinfo, or local time when omitted; other inputs remain naive when tzinfo is omitted. Eight unsigned digits are reserved for YYYYMMDD calendar dates. Two-part dotted numbers retain fractional Unix-second semantics.
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
day_first | positional or keyword | None |
tzinfo | positional or keyword | None |
Time.parse_time(txt)Source line 7480
Return duration seconds, or 0 for invalid input. A leading sign applies to the entire duration. Weeks are seven days; years are 365 days. Every numeric component must have a known unit.
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
Time.date_formats(*args)Source line 7522
Decorators: @CachedClassProperty
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
Time.parse_date(txt)Source line 7545
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
is_class_instance(t)Source line 7587
| Parameter | Passing convention | Default / required |
|---|---|---|
t | positional or keyword | required |
class WebRequestInfoSource line 7594
Construct: WebRequestInfo(user_agent, ip)
Fields assigned by the constructor: ip_raw, ua, ua_raw. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
WebRequestInfo.__init__ — methodWebRequestInfo.ip — decorated property (see guide)WebRequestInfo.is_google_confirm — methodWebRequestInfo.is_bing_confirm — methodWebRequestInfo.is_baidu_confirm — methodWebRequestInfo.is_yahoo_confirm — methodWebRequestInfo.is_yandex_confirm — methodWebRequestInfo.is_crawler_confirm — methodWebRequestInfo.__init__(self, user_agent, ip)Source line 7595
| Parameter | Passing convention | Default / required |
|---|---|---|
user_agent | positional or keyword | required |
ip | positional or keyword | required |
WebRequestInfo.ip(self)Source line 7600
Decorators: @CachedProperty
No caller-supplied parameters are declared.
WebRequestInfo.is_google_confirm(self, two_way_confirm=True)Source line 7602
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
WebRequestInfo.is_bing_confirm(self, two_way_confirm=True)Source line 7605
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
WebRequestInfo.is_baidu_confirm(self, two_way_confirm=True)Source line 7608
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
WebRequestInfo.is_yahoo_confirm(self, two_way_confirm=True)Source line 7611
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
WebRequestInfo.is_yandex_confirm(self, two_way_confirm=True)Source line 7614
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
WebRequestInfo.is_crawler_confirm(self, two_way_confirm=True)Source line 7617
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
is_json_parsable(d)Source line 7667
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
epoch(epoch_timestamp=None)Source line 7713
| Parameter | Passing convention | Default / required |
|---|---|---|
epoch_timestamp | positional or keyword | None |
class ActionQueueSource line 7720
Construct: ActionQueue(queue_file='queue.json', queue_file_type=None, loop_interval=60, remove_on_err=True)
Fields assigned by the constructor: actions, logger, loop_count, loop_interval, queue_db, queue_file, queue_file_type, remove_on_err, run_queue. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
ActionQueue.Item — nested classActionQueue.__init__ — methodActionQueue.items — decorated property (see guide)ActionQueue._check_iter — nested classActionQueue.start — methodActionQueue.run — async methodActionQueue.to_thread — methodActionQueue.action — methodActionQueue.create_action — async methodclass ActionQueue.ItemSource line 7723
Construct: ActionQueue.Item(d, q)
Fields assigned by the constructor: action, activate, created, d, data, id, q. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
ActionQueue.Item.__init__ — methodActionQueue.Item.remove — async methodActionQueue.Item.hash — decorated property (see guide)ActionQueue.Item.__repr__ — methodActionQueue.Item.__init__(self, d, q)Source line 7724
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
q | positional or keyword | required |
async ActionQueue.Item.remove(self)Source line 7732
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
ActionQueue.Item.hash(self)Source line 7754
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ActionQueue.Item.__repr__(self)Source line 7759
No caller-supplied parameters are declared.
ActionQueue.__init__(self, queue_file='queue.json', queue_file_type=None, loop_interval=60, remove_on_err=True)Source line 7761
| Parameter | Passing convention | Default / required |
|---|---|---|
queue_file | positional or keyword | 'queue.json' |
queue_file_type | positional or keyword | None |
loop_interval | positional or keyword | 60 |
remove_on_err | positional or keyword | True |
async ActionQueue.items(self)Source line 7817
Decorators: @CachedProperty
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class ActionQueue._check_iterSource line 7874
Construct: ActionQueue._check_iter(i, q)
Fields assigned by the constructor: i, q. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
ActionQueue._check_iter.__init__ — methodActionQueue._check_iter.hash — methodActionQueue._check_iter.__iter__ — methodActionQueue._check_iter.__next__ — methodActionQueue._check_iter.sort — methodActionQueue._check_iter.__init__(self, i, q)Source line 7875
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
q | positional or keyword | required |
ActionQueue._check_iter.hash(self)Source line 7878
No caller-supplied parameters are declared.
ActionQueue._check_iter.__iter__(self)Source line 7883
No caller-supplied parameters are declared.
ActionQueue._check_iter.__next__(self)Source line 7888
No caller-supplied parameters are declared.
ActionQueue._check_iter.sort(self)Source line 7908
No caller-supplied parameters are declared.
ActionQueue.start(self)Source line 7949
No caller-supplied parameters are declared.
async ActionQueue.run(self)Source line 7951
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
ActionQueue.to_thread(self)Source line 7953
No caller-supplied parameters are declared.
ActionQueue.action(self, func)Source line 7966
| Parameter | Passing convention | Default / required |
|---|---|---|
func | positional or keyword | required |
async ActionQueue.create_action(self, action, data=None, activate=None)Source line 7973
| Parameter | Passing convention | Default / required |
|---|---|---|
action | positional or keyword | required |
data | positional or keyword | None |
activate | positional or keyword | None |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class iCalendarSource line 8070
Construct: iCalendar(name, uid, default_organizer_name=None, default_organizer_email=None)
Fields assigned by the constructor: default_organizer_email, default_organizer_name, events, name, uid, url. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
iCalendar.property_formatter — methodiCalendar.date_formatter — methodiCalendar.datetime_formatter — methodiCalendar.Event — nested classiCalendar.__init__ — methodiCalendar.add_event — methodiCalendar.generate — methodiCalendar.property_formatter(name, value, properties={})Source line 8071
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
value | positional or keyword | required |
properties | positional or keyword | {} |
iCalendar.date_formatter(dt)Source line 8078
| Parameter | Passing convention | Default / required |
|---|---|---|
dt | positional or keyword | required |
iCalendar.datetime_formatter(dt)Source line 8091
| Parameter | Passing convention | Default / required |
|---|---|---|
dt | positional or keyword | required |
class iCalendar.EventSource line 8118
Construct: iCalendar.Event(ical, name, uid, dt_start, dt_end=None, description=None, organizer_name=None, organizer_email=None, location=None)
Fields assigned by the constructor: description, dt_end, dt_start, ical, location, name, organizer_email, organizer_name, uid. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
iCalendar.Event.__init__ — methodiCalendar.Event.generate — methodiCalendar.Event.__init__(self, ical, name, uid, dt_start, dt_end=None, description=None, organizer_name=None, organizer_email=None, location=None)Source line 8119
| Parameter | Passing convention | Default / required |
|---|---|---|
ical | positional or keyword | required |
name | positional or keyword | required |
uid | positional or keyword | required |
dt_start | positional or keyword | required |
dt_end | positional or keyword | None |
description | positional or keyword | None |
organizer_name | positional or keyword | None |
organizer_email | positional or keyword | None |
location | positional or keyword | None |
iCalendar.Event.generate(self)Source line 8129
No caller-supplied parameters are declared.
iCalendar.__init__(self, name, uid, default_organizer_name=None, default_organizer_email=None)Source line 8154
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
uid | positional or keyword | required |
default_organizer_name | positional or keyword | None |
default_organizer_email | positional or keyword | None |
iCalendar.add_event(self, name, uid, dt_start, dt_end=None, description=None, organizer_name=None, organizer_email=None, location=None)Source line 8161
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
uid | positional or keyword | required |
dt_start | positional or keyword | required |
dt_end | positional or keyword | None |
description | positional or keyword | None |
organizer_name | positional or keyword | None |
organizer_email | positional or keyword | None |
location | positional or keyword | None |
iCalendar.generate(self)Source line 8180
No caller-supplied parameters are declared.
class vCardSource line 8196
Construct: vCard(first_name, last_name, address=None, organization=None, title=None, url=None)
Fields assigned by the constructor: address, address_types, emails, first_name, full_name, last_name, organization, phones, title, url. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
vCard.property_formatter — methodvCard.date_formatter — methodvCard.datetime_formatter — methodvCard.__init__ — methodvCard.add_phone — methodvCard.add_email — methodvCard.set_organization — methodvCard.set_address — methodvCard.set_title — methodvCard.set_url — methodvCard.__str__ — methodvCard.generate — methodvCard.property_formatter(name, value, properties={})Source line 8197
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
value | positional or keyword | required |
properties | positional or keyword | {} |
vCard.date_formatter(dt)Source line 8204
| Parameter | Passing convention | Default / required |
|---|---|---|
dt | positional or keyword | required |
vCard.datetime_formatter(dt)Source line 8217
| Parameter | Passing convention | Default / required |
|---|---|---|
dt | positional or keyword | required |
vCard.__init__(self, first_name, last_name, address=None, organization=None, title=None, url=None)Source line 8244
| Parameter | Passing convention | Default / required |
|---|---|---|
first_name | positional or keyword | required |
last_name | positional or keyword | required |
address | positional or keyword | None |
organization | positional or keyword | None |
title | positional or keyword | None |
url | positional or keyword | None |
vCard.add_phone(self, phone, phone_types=['HOME', 'VOICE'])Source line 8255
| Parameter | Passing convention | Default / required |
|---|---|---|
phone | positional or keyword | required |
phone_types | positional or keyword | ['HOME', 'VOICE'] |
vCard.add_email(self, email, email_types=['INTERNET', 'WORK'])Source line 8272
| Parameter | Passing convention | Default / required |
|---|---|---|
email | positional or keyword | required |
email_types | positional or keyword | ['INTERNET', 'WORK'] |
vCard.set_organization(self, organization)Source line 8286
| Parameter | Passing convention | Default / required |
|---|---|---|
organization | positional or keyword | required |
vCard.set_address(self, address, address_types=['HOME'])Source line 8293
| Parameter | Passing convention | Default / required |
|---|---|---|
address | positional or keyword | required |
address_types | positional or keyword | ['HOME'] |
vCard.set_title(self, title)Source line 8316
| Parameter | Passing convention | Default / required |
|---|---|---|
title | positional or keyword | required |
vCard.set_url(self, url)Source line 8323
| Parameter | Passing convention | Default / required |
|---|---|---|
url | positional or keyword | required |
vCard.__str__(self)Source line 8330
No caller-supplied parameters are declared.
vCard.generate(self)Source line 8332
No caller-supplied parameters are declared.
class AddressSource line 9244
Represents an address with properties for address line 1, address line 2, city, state, and zip code.
Construct: Address(d, correct_address=True, parse_address=True)
Fields assigned by the constructor: address1, address2, city, parsed_address, state, zip. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Address.__init__ — methodAddress.__str__ — methodAddress.to_dict — methodAddress.get_dict — methodAddress.parsed_address — decorated property (see guide)Address.compare_address — decorated property (see guide)Address.street — propertyAddress.address — propertyAddress.address2_int — decorated property (see guide)Address.street2 — propertyAddress.zip_code — propertyAddress.postal_code — propertyAddress.__repr__ — methodAddress.__eq__ — methodAddress.parse_address — methodAddress.__init__(self, d, correct_address=True, parse_address=True)Source line 9253
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
correct_address | positional or keyword | True |
parse_address | positional or keyword | True |
Address.__str__(self)Source line 9409
No caller-supplied parameters are declared.
Address.to_dict(self)Source line 9414
No caller-supplied parameters are declared.
Address.get_dict(self)Source line 9422
No caller-supplied parameters are declared.
Address.parsed_address(self)Source line 9426
Decorators: @CachedProperty
No caller-supplied parameters are declared.
Address.compare_address(self)Source line 9430
Decorators: @CachedProperty
No caller-supplied parameters are declared.
Address.street(self)Source line 9434
Decorators: @property
No caller-supplied parameters are declared.
Address.address(self)Source line 9437
Decorators: @property
No caller-supplied parameters are declared.
Address.address2_int(self)Source line 9440
Decorators: @CachedProperty
No caller-supplied parameters are declared.
Address.street2(self)Source line 9443
Decorators: @property
No caller-supplied parameters are declared.
Address.zip_code(self)Source line 9446
Decorators: @property
No caller-supplied parameters are declared.
Address.postal_code(self)Source line 9449
Decorators: @property
No caller-supplied parameters are declared.
Address.__repr__(self)Source line 9452
No caller-supplied parameters are declared.
Address.__eq__(self, value: object) -> boolSource line 9455
Check if the current Address object is equal to another object.
Args:
value (object): The object to compare with.
Returns:
bool: True if the objects are equal, False otherwise.
| Parameter | Passing convention | Default / required |
|---|---|---|
value: object | positional or keyword | required |
Return annotation: bool.
Address.parse_address(txt)Source line 9489
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
async run_code(code, **kwargs)Source line 9657
| Parameter | Passing convention | Default / required |
|---|---|---|
code | positional or keyword | required |
kwargs | extra keyword arguments (**kwargs) | optional collection |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class CodeFormatSource line 9711
Construct: CodeFormat()
Fields assigned by the constructor: con_lexer, formatter, lexer, trace_lexer. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
CodeFormat.__init__ — methodCodeFormat.styling — methodCodeFormat.code_format — methodCodeFormat.console_format — methodCodeFormat.traceback_format — methodCodeFormat.__init__(self)Source line 9712
No caller-supplied parameters are declared.
CodeFormat.styling(self)Source line 9717
No caller-supplied parameters are declared.
CodeFormat.code_format(self, txt, linenos=False)Source line 9722
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
linenos | positional or keyword | False |
CodeFormat.console_format(self, txt, linenos=False)Source line 9724
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
linenos | positional or keyword | False |
CodeFormat.traceback_format(self, txt, linenos=False)Source line 9726
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
linenos | positional or keyword | False |
class StandardRequestSource line 9790
Construct: StandardRequest(request)
Fields assigned by the constructor: cookies, headers, method, remote, request, url, user_agent. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
StandardRequest.__init__ — methodStandardRequest.path — decorated property (see guide)StandardRequest.scheme — decorated property (see guide)StandardRequest.query_string — decorated property (see guide)StandardRequest.query — decorated property (see guide)StandardRequest.args — propertyStandardRequest.ip — propertyStandardRequest.ip_info — decorated property (see guide)StandardRequest.body — decorated property (see guide)StandardRequest.load — async methodStandardRequest.__await__ — methodStandardRequest.__init__(self, request)Source line 9791
| Parameter | Passing convention | Default / required |
|---|---|---|
request | positional or keyword | required |
StandardRequest.path(self)Source line 9876
Decorators: @CachedProperty
No caller-supplied parameters are declared.
StandardRequest.scheme(self)Source line 9880
Decorators: @CachedProperty
No caller-supplied parameters are declared.
StandardRequest.query_string(self)Source line 9884
Decorators: @CachedProperty
No caller-supplied parameters are declared.
StandardRequest.query(self)Source line 9888
Decorators: @CachedProperty
No caller-supplied parameters are declared.
StandardRequest.args(self)Source line 9892
Decorators: @property
No caller-supplied parameters are declared.
StandardRequest.ip(self)Source line 9895
Decorators: @property
No caller-supplied parameters are declared.
async StandardRequest.ip_info(self)Source line 9898
Decorators: @CachedProperty
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
StandardRequest.body(self)Source line 9902
Decorators: @CachedProperty
No caller-supplied parameters are declared.
async StandardRequest.load(self)Source line 9909
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
StandardRequest.__await__(self)Source line 9915
No caller-supplied parameters are declared.
class ListIndexSource line 9919
Construct: ListIndex(d, key=str, f_idx=0, nested_indexes=None)
Fields assigned by the constructor: d, f_idx, index, key, nested_indexes. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
ListIndex.__init__ — methodListIndex.get — methodListIndex.get_ci — methodListIndex.get_list — methodListIndex.get_ci_list — methodListIndex.get_index — methodListIndex.get_index_ci — methodListIndex.add — methodListIndex.append — methodListIndex.count — methodListIndex.__contains__ — methodListIndex.__iter__ — methodListIndex.__getitem__ — methodListIndex.__len__ — methodListIndex.__init__(self, d, key=str, f_idx=0, nested_indexes=None)Source line 9920
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
key | positional or keyword | str |
f_idx | positional or keyword | 0 |
nested_indexes | positional or keyword | None |
ListIndex.get(self, i, case_insensitive=False)Source line 9963
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
case_insensitive | positional or keyword | False |
ListIndex.get_ci(self, i)Source line 9984
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
ListIndex.get_list(self, i, case_insensitive=False)Source line 10004
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
case_insensitive | positional or keyword | False |
ListIndex.get_ci_list(self, i)Source line 10027
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
ListIndex.get_index(self, i, case_insensitive=False)Source line 10049
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
case_insensitive | positional or keyword | False |
ListIndex.get_index_ci(self, i)Source line 10070
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
ListIndex.add(self, i)Source line 10160
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
ListIndex.append(self, i)Source line 10179
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
ListIndex.count(self, i)Source line 10181
| Parameter | Passing convention | Default / required |
|---|---|---|
i | positional or keyword | required |
ListIndex.__contains__(self, other)Source line 10183
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
ListIndex.__iter__(self)Source line 10185
No caller-supplied parameters are declared.
ListIndex.__getitem__(self, value)Source line 10187
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
ListIndex.__len__(self)Source line 10193
No caller-supplied parameters are declared.
class SortedListSource line 10199
Construct: SortedList(d, key=str, reverse=False)
Fields assigned by the constructor: d, key, reverse. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
SortedList.__init__ — methodSortedList.append — methodSortedList.add — methodSortedList.__contains__ — methodSortedList.__iter__ — methodSortedList.__getitem__ — methodSortedList.__len__ — methodSortedList.__init__(self, d, key=str, reverse=False)Source line 10200
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
key | positional or keyword | str |
reverse | positional or keyword | False |
SortedList.append(self, new)Source line 10207
| Parameter | Passing convention | Default / required |
|---|---|---|
new | positional or keyword | required |
SortedList.add(self, new_value)Source line 10209
| Parameter | Passing convention | Default / required |
|---|---|---|
new_value | positional or keyword | required |
SortedList.__contains__(self, other)Source line 10275
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
SortedList.__iter__(self)Source line 10277
No caller-supplied parameters are declared.
SortedList.__getitem__(self, value)Source line 10279
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
SortedList.__len__(self)Source line 10281
No caller-supplied parameters are declared.
class AttrDictSource line 10284
Construct: AttrDict(data={})
Declared functions, properties, and nested objects:
AttrDict.__init__ — methodAttrDict.__getattr__ — methodAttrDict.__setattr__ — methodAttrDict.__getitem__ — methodAttrDict.__setitem__ — methodAttrDict.__delitem__ — methodAttrDict.get — methodAttrDict.__init__(self, data={})Source line 10285
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | {} |
AttrDict.__getattr__(self, name)Source line 10287
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
AttrDict.__setattr__(self, name, value)Source line 10293
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
value | positional or keyword | required |
AttrDict.__getitem__(self, key)Source line 10296
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
AttrDict.__setitem__(self, key, value)Source line 10299
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
value | positional or keyword | required |
AttrDict.__delitem__(self, key)Source line 10302
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
AttrDict.get(self, name, default=None)Source line 10305
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
default | positional or keyword | None |
count_print(v, max_lines=None)Source line 10310
| Parameter | Passing convention | Default / required |
|---|---|---|
v | positional or keyword | required |
max_lines | positional or keyword | None |
class ServerAnalyticsSource line 10326
Construct: ServerAnalytics()
Fields assigned by the constructor: recent_requests. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
ServerAnalytics.__init__ — methodServerAnalytics.__init__(self)Source line 10327
No caller-supplied parameters are declared.
class ReqInfoSource line 10331
Construct: ReqInfo(*args)
Fields assigned by the constructor: ip, method, time, url, user_agent. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
ReqInfo.__init__ — methodReqInfo.to_dict — methodReqInfo.get_id — methodReqInfo.link_info — decorated property (see guide)ReqInfo.path — propertyReqInfo.ua_raw — propertyReqInfo.user_agent_info — decorated property (see guide)ReqInfo.device — decorated property (see guide)ReqInfo.browser — decorated property (see guide)ReqInfo.os — decorated property (see guide)ReqInfo.is_mobile — decorated property (see guide)ReqInfo.browser — decorated property (see guide)ReqInfo.ip_info — decorated property (see guide)ReqInfo.country — decorated property (see guide)ReqInfo.region — decorated property (see guide)ReqInfo.city — decorated property (see guide)ReqInfo.asn — decorated property (see guide)ReqInfo.org — decorated property (see guide)ReqInfo.location — decorated property (see guide)ReqInfo.hostname — decorated property (see guide)ReqInfo.is_google_confirm — methodReqInfo.is_bing_confirm — methodReqInfo.is_baidu_confirm — methodReqInfo.is_yahoo_confirm — methodReqInfo.is_yandex_confirm — methodReqInfo.is_crawler_confirm — methodReqInfo.__init__(self, *args)Source line 10332
| Parameter | Passing convention | Default / required |
|---|---|---|
args | extra positional arguments (*args) | optional collection |
ReqInfo.to_dict(self)Source line 10349
No caller-supplied parameters are declared.
ReqInfo.get_id(self)Source line 10357
No caller-supplied parameters are declared.
ReqInfo.link_info(self)Source line 10367
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.path(self)Source line 10370
Decorators: @property
No caller-supplied parameters are declared.
ReqInfo.ua_raw(self)Source line 10373
Decorators: @property
No caller-supplied parameters are declared.
ReqInfo.user_agent_info(self)Source line 10376
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.device(self)Source line 10379
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.browser(self)Source line 10383
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.os(self)Source line 10386
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.is_mobile(self)Source line 10389
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.browser(self)Source line 10392
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.ip_info(self)Source line 10396
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.country(self)Source line 10404
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.region(self)Source line 10407
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.city(self)Source line 10410
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.asn(self)Source line 10413
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.org(self)Source line 10416
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.location(self)Source line 10419
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.hostname(self)Source line 10422
Decorators: @CachedProperty
No caller-supplied parameters are declared.
ReqInfo.is_google_confirm(self, two_way_confirm=True)Source line 10426
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
ReqInfo.is_bing_confirm(self, two_way_confirm=True)Source line 10429
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
ReqInfo.is_baidu_confirm(self, two_way_confirm=True)Source line 10432
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
ReqInfo.is_yahoo_confirm(self, two_way_confirm=True)Source line 10435
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
ReqInfo.is_yandex_confirm(self, two_way_confirm=True)Source line 10438
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
ReqInfo.is_crawler_confirm(self, two_way_confirm=True)Source line 10441
| Parameter | Passing convention | Default / required |
|---|---|---|
two_way_confirm | positional or keyword | True |
class VersionSource line 10498
Construct: Version(v_str)
Fields assigned by the constructor: extra, major, minor, patch, raw, short. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Version.__init__ — methodVersion.__lt__ — methodVersion.__gt__ — methodVersion.__le__ — methodVersion.__ge__ — methodVersion.__eq__ — methodVersion.__str__ — methodVersion.__repr__ — methodVersion.__init__(self, v_str)Source line 10499
| Parameter | Passing convention | Default / required |
|---|---|---|
v_str | positional or keyword | required |
Version.__lt__(self, other)Source line 10535
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
Version.__gt__(self, other)Source line 10551
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
Version.__le__(self, other)Source line 10553
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
Version.__ge__(self, other)Source line 10555
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
Version.__eq__(self, other: object) -> boolSource line 10557
| Parameter | Passing convention | Default / required |
|---|---|---|
other: object | positional or keyword | required |
Return annotation: bool.
Version.__str__(self)Source line 10564
No caller-supplied parameters are declared.
Version.__repr__(self)Source line 10566
No caller-supplied parameters are declared.
class ExtraSource line 10585
Construct: Extra(data, identifier, db, table_name, column_name='extra', identifier_column='id', as_dict=False)
Fields assigned by the constructor: as_dict. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Extra.__init__ — methodExtra.encoded — propertyExtra.__getitem__ — methodExtra.__setitem__ — methodExtra.__delitem__ — methodExtra.__iter__ — methodExtra.__len__ — methodExtra.__str__ — methodExtra.__contains__ — methodExtra.get — methodExtra.set — methodExtra.append — methodExtra.add — methodExtra.remove — methodExtra.save — async methodExtra.__init__(self, data, identifier, db, table_name, column_name='extra', identifier_column='id', as_dict=False)Source line 10588
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
identifier | positional or keyword | required |
db | positional or keyword | required |
table_name | positional or keyword | required |
column_name | positional or keyword | 'extra' |
identifier_column | positional or keyword | 'id' |
as_dict | positional or keyword | False |
Extra.encoded(self)Source line 10621
Decorators: @property
No caller-supplied parameters are declared.
Extra.__getitem__(self, key)Source line 10630
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
Extra.__setitem__(self, key, value)Source line 10632
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
value | positional or keyword | required |
Extra.__delitem__(self, key)Source line 10634
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
Extra.__iter__(self)Source line 10636
No caller-supplied parameters are declared.
Extra.__len__(self)Source line 10638
No caller-supplied parameters are declared.
Extra.__str__(self)Source line 10640
No caller-supplied parameters are declared.
Extra.__contains__(self, key)Source line 10642
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
Extra.get(self, key, default=None)Source line 10644
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
default | positional or keyword | None |
Extra.set(self, key, value)Source line 10646
| Parameter | Passing convention | Default / required |
|---|---|---|
key | positional or keyword | required |
value | positional or keyword | required |
Extra.append(self, value)Source line 10648
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
Extra.add(self, value)Source line 10650
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
Extra.remove(self, value)Source line 10652
| Parameter | Passing convention | Default / required |
|---|---|---|
value | positional or keyword | required |
async Extra.save(self)Source line 10654
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class PhoneNumberSource line 10658
Construct: PhoneNumber(number)
Fields assigned by the constructor: area_code, country_code, number. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
PhoneNumber.__init__ — methodPhoneNumber.e164 — propertyPhoneNumber.domestic_format — propertyPhoneNumber.international_format — propertyPhoneNumber.__str__ — methodPhoneNumber.__eq__ — methodPhoneNumber.__len__ — methodPhoneNumber.__getattr__ — methodPhoneNumber.__init__(self, number)Source line 10659
| Parameter | Passing convention | Default / required |
|---|---|---|
number | positional or keyword | required |
PhoneNumber.e164(self)Source line 10673
Decorators: @property
No caller-supplied parameters are declared.
PhoneNumber.domestic_format(self)Source line 10676
Decorators: @property
No caller-supplied parameters are declared.
PhoneNumber.international_format(self)Source line 10679
Decorators: @property
No caller-supplied parameters are declared.
PhoneNumber.__str__(self)Source line 10681
No caller-supplied parameters are declared.
PhoneNumber.__eq__(self, other)Source line 10683
| Parameter | Passing convention | Default / required |
|---|---|---|
other | positional or keyword | required |
PhoneNumber.__len__(self)Source line 10700
No caller-supplied parameters are declared.
PhoneNumber.__getattr__(self, name)Source line 10702
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
class PermissionSource line 10707
No constructor is declared here. Some utility classes group functions for direct class access; use the call style shown in the guide.
Declared functions, properties, and nested objects:
Permission.evaluate_permission — methodPermission.evaluate_permission(primary, evaluate)Source line 10708
| Parameter | Passing convention | Default / required |
|---|---|---|
primary | positional or keyword | required |
evaluate | positional or keyword | required |
class pluginsSource line 10726
No constructor is declared here. Some utility classes group functions for direct class access; use the call style shown in the guide.
Declared functions, properties, and nested objects:
plugins.Mailgun — nested classplugins.Twilio — nested classplugins.UserManager — nested classclass plugins.MailgunSource line 10727
Construct: plugins.Mailgun(api_key, domain, default_from=None, default_archive_to=None)
Fields assigned by the constructor: api_key, default_archive_to, default_from, domain. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.Mailgun.__init__ — methodplugins.Mailgun.send_email — async methodplugins.Mailgun.__init__(self, api_key, domain, default_from=None, default_archive_to=None)Source line 10728
| Parameter | Passing convention | Default / required |
|---|---|---|
api_key | positional or keyword | required |
domain | positional or keyword | required |
default_from | positional or keyword | None |
default_archive_to | positional or keyword | None |
async plugins.Mailgun.send_email(self, subject, to, from_email=None, text=None, html=None, template=None, cc=None, bcc=None, reply_to=None, template_variables=None, archive_to=None)Source line 10733
| Parameter | Passing convention | Default / required |
|---|---|---|
subject | positional or keyword | required |
to | positional or keyword | required |
from_email | positional or keyword | None |
text | positional or keyword | None |
html | positional or keyword | None |
template | positional or keyword | None |
cc | positional or keyword | None |
bcc | positional or keyword | None |
reply_to | positional or keyword | None |
template_variables | positional or keyword | None |
archive_to | positional or keyword | None |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class plugins.TwilioSource line 10780
Construct: plugins.Twilio(account_sid, auth_token, default_from=None)
Fields assigned by the constructor: account_sid, auth_token, default_from. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.Twilio.__init__ — methodplugins.Twilio.send_sms — async methodplugins.Twilio.LookupNumber — nested classplugins.Twilio.lookup — async methodplugins.Twilio.identity_match — async methodplugins.Twilio.line_status — async methodplugins.Twilio.is_line_active — async methodplugins.Twilio.__init__(self, account_sid, auth_token, default_from=None)Source line 10781
| Parameter | Passing convention | Default / required |
|---|---|---|
account_sid | positional or keyword | required |
auth_token | positional or keyword | required |
default_from | positional or keyword | None |
async plugins.Twilio.send_sms(self, to, from_phone=None, body=None, media_url=None)Source line 10786
| Parameter | Passing convention | Default / required |
|---|---|---|
to | positional or keyword | required |
from_phone | positional or keyword | None |
body | positional or keyword | None |
media_url | positional or keyword | None |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class plugins.Twilio.LookupNumber(PhoneNumber)Source line 10819
A parsed Twilio Lookup response with PhoneNumber behavior.
Construct: plugins.Twilio.LookupNumber(phone_number, lookup_fields, raw_response)
Fields assigned by the constructor: caller_name, calling_country_code, identity_match, iso_country_code, line_status, line_type_intelligence, lookup_fields, national_format, payload, raw_response, requested_fields, url, valid, validation_errors. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.Twilio.LookupNumber.CallerName — nested classplugins.Twilio.LookupNumber.IdentityMatch — nested classplugins.Twilio.LookupNumber.LineStatus — nested classplugins.Twilio.LookupNumber.LineTypeIntelligence — nested classplugins.Twilio.LookupNumber.__init__ — methodplugins.Twilio.LookupNumber.phone_number — propertyplugins.Twilio.LookupNumber.text — propertyplugins.Twilio.LookupNumber.json — methodplugins.Twilio.LookupNumber.raise_for_status — methodclass plugins.Twilio.LookupNumber.CallerNameSource line 10822
Construct: plugins.Twilio.LookupNumber.CallerName(data)
Fields assigned by the constructor: caller_name, caller_type, error_code, payload. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.Twilio.LookupNumber.CallerName.__init__(self, data)Source line 10823
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
class plugins.Twilio.LookupNumber.IdentityMatchSource line 10829
Construct: plugins.Twilio.LookupNumber.IdentityMatch(data)
Fields assigned by the constructor: address_country_match, address_line_match, address_lines_match, city_match, date_of_birth_match, error_code, error_message, first_name_match, last_name_match, national_id_match, payload, postal_code_match, state_match, summary_score. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.Twilio.LookupNumber.IdentityMatch.__init__(self, data)Source line 10830
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
class plugins.Twilio.LookupNumber.LineStatusSource line 10847
Construct: plugins.Twilio.LookupNumber.LineStatus(data)
Fields assigned by the constructor: error_code, payload, status. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.Twilio.LookupNumber.LineStatus.__init__(self, data)Source line 10848
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
plugins.Twilio.LookupNumber.LineStatus.is_line_active(self)Source line 10854
Decorators: @property
True when active/reachable, False when inactive/unreachable, otherwise None.
No caller-supplied parameters are declared.
class plugins.Twilio.LookupNumber.LineTypeIntelligenceSource line 10863
Construct: plugins.Twilio.LookupNumber.LineTypeIntelligence(data)
Fields assigned by the constructor: carrier_name, error_code, mobile_country_code, mobile_network_code, payload, type. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.Twilio.LookupNumber.LineTypeIntelligence.__init__(self, data)Source line 10864
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
plugins.Twilio.LookupNumber.__init__(self, phone_number, lookup_fields, raw_response)Source line 10872
| Parameter | Passing convention | Default / required |
|---|---|---|
phone_number | positional or keyword | required |
lookup_fields | positional or keyword | required |
raw_response | positional or keyword | required |
plugins.Twilio.LookupNumber.phone_number(self)Source line 10909
Decorators: @property
No caller-supplied parameters are declared.
plugins.Twilio.LookupNumber.text(self)Source line 10913
Decorators: @property
No caller-supplied parameters are declared.
plugins.Twilio.LookupNumber.json(self)Source line 10916
No caller-supplied parameters are declared.
plugins.Twilio.LookupNumber.raise_for_status(self)Source line 10921
No caller-supplied parameters are declared.
async plugins.Twilio.lookup(self, phone_number, lookup_fields, **params)Source line 10934
Look up a phone number and return a LookupNumber. Fields listed below: - caller_name = name of a caller if available ($.01) - identity_match = match of a phone number to a person ($.10) - line_status = line status of a phone number ($.007) - line_type_intelligence = line type intelligence of a phone number ($.008) Docs: https://www.twilio.com/docs/lookup/v2-api Pricing: https://www.twilio.com/en-us/user-authentication-identity/pricing/lookup
| Parameter | Passing convention | Default / required |
|---|---|---|
phone_number | positional or keyword | required |
lookup_fields | positional or keyword | required |
params | extra keyword arguments (**kwargs) | optional collection |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.Twilio.identity_match(self, phone_number, first_name=None, last_name=None, address=None, date_of_birth=None, lookup_fields='identity_match', **params)Source line 10967
| Parameter | Passing convention | Default / required |
|---|---|---|
phone_number | positional or keyword | required |
first_name | positional or keyword | None |
last_name | positional or keyword | None |
address | positional or keyword | None |
date_of_birth | positional or keyword | None |
lookup_fields | positional or keyword | 'identity_match' |
params | extra keyword arguments (**kwargs) | optional collection |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.Twilio.line_status(self, phone)Source line 11013
| Parameter | Passing convention | Default / required |
|---|---|---|
phone | positional or keyword | required |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.Twilio.is_line_active(self, phone)Source line 11015
Returns True if the line is active, False if inactive, and None if unknown.
| Parameter | Passing convention | Default / required |
|---|---|---|
phone | positional or keyword | required |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class plugins.UserManagerSource line 11022
Construct: plugins.UserManager(dbm, tbl_name='users', mfa_tbl=None, session_validator=None)
Fields assigned by the constructor: db, dbm, hash_func, mfa_tbl, session_validator, tbl_name. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.UserManager.__init__ — methodplugins.UserManager.mfa — decorated property (see guide)plugins.UserManager.users — decorated property (see guide)plugins.UserManager.add_user — async methodplugins.UserManager.get_user — async methodplugins.UserManager.get_session — async methodplugins.UserManager.User — nested classplugins.UserManager.UserSession — nested classplugins.UserManager.MFA — nested classplugins.UserManager.__init__(self, dbm, tbl_name='users', mfa_tbl=None, session_validator=None) -> NoneSource line 11028
| Parameter | Passing convention | Default / required |
|---|---|---|
dbm | positional or keyword | required |
tbl_name | positional or keyword | 'users' |
mfa_tbl | positional or keyword | None |
session_validator | positional or keyword | None |
Return annotation: None.
async plugins.UserManager.mfa(self)Source line 11105
Decorators: @AsyncProperty
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.UserManager.users(self)Source line 11114
Decorators: @CachedProperty
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.UserManager.add_user(self, username, password)Source line 11120
| Parameter | Passing convention | Default / required |
|---|---|---|
username | positional or keyword | required |
password | positional or keyword | required |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.UserManager.get_user(self, d)Source line 11136
| Parameter | Passing convention | Default / required |
|---|---|---|
d | positional or keyword | required |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.UserManager.get_session(self, token)Source line 11145
| Parameter | Passing convention | Default / required |
|---|---|---|
token | positional or keyword | required |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class plugins.UserManager.UserSource line 11150
Construct: plugins.UserManager.User(data, um)
Fields assigned by the constructor: data, id, password, salt, sessions, username. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.UserManager.User.__init__ — methodplugins.UserManager.User.check_password — methodplugins.UserManager.User.update_password — async methodplugins.UserManager.User.get_session — async methodplugins.UserManager.User.save_sessions — async methodplugins.UserManager.User.add_session — async methodplugins.UserManager.User.set_username — async methodplugins.UserManager.User.__init__(self, data, um)Source line 11151
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
um | positional or keyword | required |
plugins.UserManager.User.check_password(self, password)Source line 11162
| Parameter | Passing convention | Default / required |
|---|---|---|
password | positional or keyword | required |
async plugins.UserManager.User.update_password(self, password)Source line 11164
| Parameter | Passing convention | Default / required |
|---|---|---|
password | positional or keyword | required |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.UserManager.User.get_session(self, token)Source line 11173
| Parameter | Passing convention | Default / required |
|---|---|---|
token | positional or keyword | required |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.UserManager.User.save_sessions(self)Source line 11177
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.UserManager.User.add_session(self, req, extra=None)Source line 11183
| Parameter | Passing convention | Default / required |
|---|---|---|
req | positional or keyword | required |
extra | positional or keyword | None |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.UserManager.User.set_username(self, username)Source line 11200
| Parameter | Passing convention | Default / required |
|---|---|---|
username | positional or keyword | required |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class plugins.UserManager.UserSessionSource line 11203
Construct: plugins.UserManager.UserSession(base_data, u)
Fields assigned by the constructor: created, extra, ip, token, user, user_agent. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.UserManager.UserSession.Validation — nested classplugins.UserManager.UserSession.__init__ — methodplugins.UserManager.UserSession.delete — async methodplugins.UserManager.UserSession.raw_data — propertyplugins.UserManager.UserSession.encoded — propertyplugins.UserManager.UserSession.ip_info — decorated property (see guide)plugins.UserManager.UserSession.location — decorated property (see guide)plugins.UserManager.UserSession.time_since_created — propertyplugins.UserManager.UserSession.validate — async methodclass plugins.UserManager.UserSession.ValidationSource line 11236
Construct: plugins.UserManager.UserSession.Validation(max_duration=None, ip=None, check_user_agent=False, max_distance=None, function=None)
Fields assigned by the constructor: check_user_agent, function, ip, max_distance, max_duration. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.UserManager.UserSession.Validation.__init__(self, max_duration=None, ip=None, check_user_agent=False, max_distance=None, function=None)Source line 11237
| Parameter | Passing convention | Default / required |
|---|---|---|
max_duration | positional or keyword | None |
ip | positional or keyword | None |
check_user_agent | positional or keyword | False |
max_distance | positional or keyword | None |
function | positional or keyword | None |
plugins.UserManager.UserSession.Validation.__call__(self, session, req)Source line 11245
| Parameter | Passing convention | Default / required |
|---|---|---|
session | positional or keyword | required |
req | positional or keyword | required |
plugins.UserManager.UserSession.__init__(self, base_data, u)Source line 11283
| Parameter | Passing convention | Default / required |
|---|---|---|
base_data | positional or keyword | required |
u | positional or keyword | required |
async plugins.UserManager.UserSession.delete(self)Source line 11304
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
plugins.UserManager.UserSession.raw_data(self)Source line 11308
Decorators: @property
No caller-supplied parameters are declared.
plugins.UserManager.UserSession.encoded(self)Source line 11319
Decorators: @property
No caller-supplied parameters are declared.
async plugins.UserManager.UserSession.ip_info(self)Source line 11322
Decorators: @CachedProperty(expire=20000)
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
async plugins.UserManager.UserSession.location(self)Source line 11325
Decorators: @CachedProperty(expire=3600)
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
plugins.UserManager.UserSession.time_since_created(self)Source line 11328
Decorators: @property
No caller-supplied parameters are declared.
async plugins.UserManager.UserSession.validate(self, req)Source line 11330
| Parameter | Passing convention | Default / required |
|---|---|---|
req | positional or keyword | required |
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
class plugins.UserManager.MFASource line 11332
Construct: plugins.UserManager.MFA(data, um)
Fields assigned by the constructor: created_at, data, id, type, user_id. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
plugins.UserManager.MFA.__init__ — methodplugins.UserManager.MFA.delete — async methodplugins.UserManager.MFA.__init__(self, data, um)Source line 11333
| Parameter | Passing convention | Default / required |
|---|---|---|
data | positional or keyword | required |
um | positional or keyword | required |
async plugins.UserManager.MFA.delete(self)Source line 11340
No caller-supplied parameters are declared.
Declared with async def. Normal calls return an awaitable, or an async generator if the body yields. Decorated properties may be accessed differently; follow the object guide.
haversine(lat1, lon1, lat2, lon2, use_miles=False)Source line 11346
| Parameter | Passing convention | Default / required |
|---|---|---|
lat1 | positional or keyword | required |
lon1 | positional or keyword | required |
lat2 | positional or keyword | required |
lon2 | positional or keyword | required |
use_miles | positional or keyword | False |
word_to_digit(word)Source line 11373
| Parameter | Passing convention | Default / required |
|---|---|---|
word | positional or keyword | required |
name_to_normal(name)Source line 11405
| Parameter | Passing convention | Default / required |
|---|---|---|
name | positional or keyword | required |
convert_to_normal(txt)Source line 11799
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
convert_to_single_letters(txt)Source line 11908
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
equivilency_convert(txt)Source line 11924
| Parameter | Passing convention | Default / required |
|---|---|---|
txt | positional or keyword | required |
class MatchingSource line 11954
Configurable string matching with numbered algorithm selections.
Settings.matching_method:
0 = Legacy positional matching (default; ignores trailing characters
for fuzzy comparisons and retains the original exact-match behavior).
1 = Positional mismatches, including unmatched trailing characters.
2 = Levenshtein: insertions, deletions, and substitutions.
3 = Optimal String Alignment (OSA): also permits adjacent swaps,
with restrictions on overlapping edits.
4 = Full Damerau-Levenshtein: permits overlapping edits and adjacent swaps.
5 = Jaro-Winkler: character similarity with a shared-prefix bonus.
Settings.within_method:
0 = Legacy substring matching (default; uses the original algorithm
regardless of matching_method).
1 = Query-length character windows, scored with matching_method.
2 = Consecutive word windows with the query's word count, scored with
matching_method. Word boundaries are retained before scoring even
when ignore_spaces=True. Extra middle names are not ignored.
DEFAULT_MATCHING_METHOD and DEFAULT_WITHIN_METHOD initially equal 0.
Settings resolves omitted method arguments from these class attributes at
creation time; existing settings retain their selections. Passing 0 explicitly
always selects legacy behavior. Calls without settings create a fresh default
configuration, retaining the other defaults from Matching.default_settings.
Methods.select returns similarity from 0.0 to 1.0 (1.0 means identical),
suitable for comparison with Settings.fuzzy_threshold. Methods 1 through 4
use 1 - differences / max(lengths); method 5 uses Jaro-Winkler similarity.
RapidFuzz accelerates methods 2 through 5 when RAPIDFUZZ_IMPORTED is True;
otherwise the pure-Python implementations are used. The underlying *_local
methods return distances instead of similarity and do not normalize inputs.
Example:
settings = Matching.Settings(
matching_method=3, within_method=2, fuzzy_threshold=.8
)
Matching.within("Maria", "Member Maira Active", settings) # True
No constructor is declared here. Some utility classes group functions for direct class access; use the call style shown in the guide.
Declared functions, properties, and nested objects:
Matching.Methods — nested classMatching.Settings — nested classMatching.fuzzy_match — methodMatching.fuzzy_within — methodMatching.match — methodMatching.within — methodclass Matching.MethodsSource line 11998
No constructor is declared here. Some utility classes group functions for direct class access; use the call style shown in the guide.
Declared functions, properties, and nested objects:
Matching.Methods.select — class methodMatching.Methods.select_within — class methodMatching.Methods.fuzzy_local — static methodMatching.Methods.levenshtein_local — methodMatching.Methods.osa_local — static methodMatching.Methods.damerau_levenshtein_local — static methodMatching.Methods.jaro_winkler_local — static methodMatching.Methods.fuzzy_local_within — static methodMatching.Methods.token_window_within — static methodMatching.Methods.select(cls, str1, str2, matching_method=0)Source line 12000
Decorators: @classmethod
Return similarity from 0 to 1 (1 means identical). Methods: 0 legacy positional, 1 positional including trailing text, 2 Levenshtein, 3 OSA, 4 unrestricted DL, 5 Jaro-Winkler. Method 0 lowercases and ignores trailing characters. Other methods are case-sensitive; callers apply normalization before selection. Empty pairs score 1; one empty string scores 0 for every method.
| Parameter | Passing convention | Default / required |
|---|---|---|
str1 | positional or keyword | required |
str2 | positional or keyword | required |
matching_method | positional or keyword | 0 |
Matching.Methods.select_within(cls, str1, str2, matching_method=0, within_method=0, ignore_spaces=False, match_asterisk=False)Source line 12047
Decorators: @classmethod
Return the best window similarity, or None if no window fits. 0 uses legacy fixed character windows and positional scoring, 1 uses fixed character windows and matching_method, 2 uses equal-word-count token windows and matching_method. Tokenization happens before optional space removal for scoring. Wildcards mask characters at the same position within each window.
| Parameter | Passing convention | Default / required |
|---|---|---|
str1 | positional or keyword | required |
str2 | positional or keyword | required |
matching_method | positional or keyword | 0 |
within_method | positional or keyword | 0 |
ignore_spaces | positional or keyword | False |
match_asterisk | positional or keyword | False |
Matching.Methods.fuzzy_local(txt1, txt2)Source line 12101
Decorators: @staticmethod
Return case-sensitive positional differences, including extra characters. Uses the original fuzzy_match positional comparison without normalization or a threshold. Returns an integer distance, like the other methods.
| Parameter | Passing convention | Default / required |
|---|---|---|
txt1 | positional or keyword | required |
txt2 | positional or keyword | required |
Matching.Methods.levenshtein_local(s1, s2)Source line 12116
| Parameter | Passing convention | Default / required |
|---|---|---|
s1 | positional or keyword | required |
s2 | positional or keyword | required |
Matching.Methods.osa_local(s1, s2)Source line 12163
Decorators: @staticmethod
Return case-sensitive Optimal String Alignment edit distance. Adapted from RapidFuzz 3.13.0, _osa_distance_hyrroe2003: https://github.com/rapidfuzz/RapidFuzz/blob/v3.13.0/src/rapidfuzz/distance/OSA_py.py Returns an integer distance; performs no normalization.
| Parameter | Passing convention | Default / required |
|---|---|---|
s1 | positional or keyword | required |
s2 | positional or keyword | required |
Matching.Methods.damerau_levenshtein_local(s1, s2)Source line 12212
Decorators: @staticmethod
Return case-sensitive unrestricted Damerau-Levenshtein edit distance. Adapted from RapidFuzz 3.13.0, _damerau_levenshtein_distance_zhao: https://github.com/rapidfuzz/RapidFuzz/blob/v3.13.0/src/rapidfuzz/distance/DamerauLevenshtein_py.py Returns an integer distance; performs no normalization.
| Parameter | Passing convention | Default / required |
|---|---|---|
s1 | positional or keyword | required |
s2 | positional or keyword | required |
Matching.Methods.jaro_winkler_local(s1, s2, prefix_weight=0.1)Source line 12264
Decorators: @staticmethod
Return case-sensitive Jaro-Winkler distance in the range 0.0 to 1.0. Zero means identical. This is a fractional distance, not an edit count. No normalization or acceptance threshold is applied. prefix_weight must be between 0 and 0.25; up to four shared prefix characters are rewarded when Jaro similarity exceeds 0.7. Adapted from RapidFuzz 3.13.0, Jaro and JaroWinkler similarity: https://github.com/rapidfuzz/RapidFuzz/blob/v3.13.0/src/rapidfuzz/distance/Jaro_py.py https://github.com/rapidfuzz/RapidFuzz/blob/v3.13.0/src/rapidfuzz/distance/JaroWinkler_py.py
| Parameter | Passing convention | Default / required |
|---|---|---|
s1 | positional or keyword | required |
s2 | positional or keyword | required |
prefix_weight | positional or keyword | 0.1 |
Matching.Methods.fuzzy_local_within(query, text)Source line 12338
Decorators: @staticmethod
Return minimum positional differences over query-length windows. Uses the existing fuzzy_within window selection with raw difference counts instead of a threshold. Case-sensitive; no normalization. An empty query returns 0. Returns None if the query exceeds text length.
| Parameter | Passing convention | Default / required |
|---|---|---|
query | positional or keyword | required |
text | positional or keyword | required |
Matching.Methods.token_window_within(query, text, distance_method=None, extra_words=0)Source line 12364
Decorators: @staticmethod
Return the closest consecutive word window and its difference count. Defaults to OSA with the query's word count. extra_words expands the window sizes in both directions; it must be a nonnegative integer. Splits on whitespace and rejoins with single spaces. Other casing, accent, and punctuation normalization is the caller's responsibility. Returns None for empty inputs or when no window fits. Ties favor the smaller window, then the earliest position. end_word is exclusive.
| Parameter | Passing convention | Default / required |
|---|---|---|
query | positional or keyword | required |
text | positional or keyword | required |
distance_method | positional or keyword | None |
extra_words | positional or keyword | 0 |
class Matching.SettingsSource line 12412
normalize: convert to normalized form (ex. "héllô" -> "hello")
extraneous_characters: convert to single letters (ex. "hello" -> "helo")
ignore_spaces: ignore spaces (ex. "he llo" == "hello")
match_asterisk: match '*' as a wildcard (ex. "h*llo" == "hello")
fuzzy_threshold: how close (in % of characters) the strings must be to be considered a match (ex. "12345" == "12344" with threshold .8)
phonetic: convert text to a phonetic form (ex. "Derrick" == "Derrik")
matching_method: 0 legacy, 1 positional, 2 Levenshtein, 3 OSA,
4 Damerau-Levenshtein, 5 Jaro-Winkler
within_method: 0 legacy, 1 character windows, 2 token windows
None resolves the corresponding class default when settings are created.
Construct: Matching.Settings(normalize=True, extraneous_characters=False, ignore_spaces=False, match_asterisk=False, fuzzy_threshold=1, phonetic=False, matching_method=None, within_method=None)
Fields assigned by the constructor: extraneous_characters, fuzzy_threshold, ignore_spaces, match_asterisk, matching_method, normalize, phonetic, within_method. Some assignments may be conditional; see the object guide for meaning and lifecycle.
Declared functions, properties, and nested objects:
Matching.Settings.__init__ — methodMatching.Settings.__init__(self, normalize=True, extraneous_characters=False, ignore_spaces=False, match_asterisk=False, fuzzy_threshold=1, phonetic=False, matching_method=None, within_method=None)Source line 12423
| Parameter | Passing convention | Default / required |
|---|---|---|
normalize | positional or keyword | True |
extraneous_characters | positional or keyword | False |
ignore_spaces | positional or keyword | False |
match_asterisk | positional or keyword | False |
fuzzy_threshold | positional or keyword | 1 |
phonetic | positional or keyword | False |
matching_method | positional or keyword | None |
within_method | positional or keyword | None |
Matching.fuzzy_match(txt1, txt2, threshold=0.8, matching_method=None)Source line 12485
Compare case-insensitive selector similarity against threshold. Omitted matching_method uses DEFAULT_MATCHING_METHOD. Method 0 retains the original empty-input ZeroDivisionError for backwards compatibility.
| Parameter | Passing convention | Default / required |
|---|---|---|
txt1 | positional or keyword | required |
txt2 | positional or keyword | required |
threshold | positional or keyword | 0.8 |
matching_method | positional or keyword | None |
Matching.fuzzy_within(txt1, txt2, threshold=0.8, matching_method=None, within_method=None)Source line 12498
Compare the best selector window similarity against threshold. Omitted methods use the corresponding class defaults. Nonlegacy windows are case-insensitive. Method 0 retains original character-window behavior, including the empty-query ZeroDivisionError.
| Parameter | Passing convention | Default / required |
|---|---|---|
txt1 | positional or keyword | required |
txt2 | positional or keyword | required |
threshold | positional or keyword | 0.8 |
matching_method | positional or keyword | None |
within_method | positional or keyword | None |
Matching.match(txt1, txt2, settings=None)Source line 12520
| Parameter | Passing convention | Default / required |
|---|---|---|
txt1 | positional or keyword | required |
txt2 | positional or keyword | required |
settings | positional or keyword | None |
Matching.within(txt1, txt2, settings=None)Source line 12562
Check if txt1 is within txt2 based on settings
| Parameter | Passing convention | Default / required |
|---|---|---|
txt1 | positional or keyword | required |
txt2 | positional or keyword | required |
settings | positional or keyword | None |