Skip to main content

golded-ftn

Repository: golded-ftn-python. The distribution remains golded-ftn; imports use golded_ftn. The source is public on GitHub. Version 1.2.1 is available on PyPI.

Install with Python 3.12 or newer:

python -m pip install golded-ftn==1.2.1

Shared FTN message values, reader/writer protocols and text helpers for Python 3.12+. No runtime dependencies. No concrete format readers, writers, database access or Nornir integration.

For development, clone the repository, then build and install a local wheel:

git clone https://github.com/golded-dev/golded-ftn-python.git
cd golded-ftn-python
uv sync --locked
uv build
python -m pip install dist/golded_ftn-1.2.1-py3-none-any.whl
from golded_ftn import FtnAddress, detect_charset, parse_body, parse_message, to_utf8

address = FtnAddress.from_string("2:236/77.1@fidonet")
assert str(address) == "2:236/77.1@fidonet"
raw = b"\x01CHRS: IBMPC 2\r\nBruger m\x9bde\x00"
text = parse_body(to_utf8(raw, detect_charset(raw)))
assert text.endswith("Bruger møde")
assert parse_message(text).charset == "IBMPC 2"
from golded_ftn import OutgoingMessage, repair_mojibake, synthetic_id

message = OutgoingMessage(
    from_name="Alice", to_name="Bob", subject="Ping", body_text="Hello"
)
identity = synthetic_id(
    message.from_name, message.to_name, message.subject, None, message.body_text
)
assert identity.startswith("hash:sha256:")
result = repair_mojibake("Bruger m°de")
assert result.text == "Bruger møde"
assert result.changed

Decoding is strict by default. Pass errors="replace" or errors="ignore" explicitly when lossy decoding is intended. An unknown declared charset uses the configured fallback. FTN aliases also work as fallback names. An invalid fallback always raises LookupError, even when the message declares a known charset.

Values are frozen, slotted and keyword-only. Collections are tuples. Date fields use datetime; the package never guesses a timezone. Unknown metadata stays None. Parsed address fields remain strings; outgoing addresses use FtnAddress.

Control parsing retains valid unknown kludges, repeated fields and raw routing strings. Both parse_message and extract_msgid ignore quoted examples, accept case-insensitive kludge names and use the first MSGID. Interior nulls are preserved; trailing nulls are removed from parsed values. ControlLine.raw is a text line without its line separator, including trailing nulls; it is never original source bytes.

Repair is opt-in and returns a new value. Its confidence is a heuristic score, not a probability. It is tuned to the PHP package's European-language fixtures, not a general encoding detector. Repair normalizes line endings even if no line is repaired; changed reports repairs only.

Synthetic IDs hash the exact UTF-8 JSON array of names, subject, date and complete body. Consumers choose date formatting. These IDs neither prove identical source records nor replace a supplied MSGID.

See the complete API reference, PHP API mapping, contributing, release checks and security.

Archive reading

ReaderOptions() keeps strict reading. Concrete readers may support an explicit archive mode with a required report callback:

from golded_ftn import ReaderIssue, ReaderOptions

issues: list[ReaderIssue] = []
options = ReaderOptions(archive_mode=True, on_issue=issues.append)
assert options.archive_mode

Each ReaderIssue identifies the format, actual source path, record identity and physical byte offset when known. Its action is recovered, skipped or stopped; its code and detail explain the deviation without including message contents. Multiple issues may describe one record. A recovery describes an accepted metadata or decoding deviation; a later skip still excludes that record. A stop means the area traversal is incomplete, even if earlier messages were returned. Filesystem and callback failures propagate. The format package defines the allowed recoveries; core does not read or repair files.

Metadata

Release files for golded-ftn 1.2.1

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

Source distribution (sdist)

Source distribution for golded-ftn 1.2.1
File Size Uploaded
golded_ftn-1.2.1.tar.gz 85.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for golded-ftn 1.2.1
File Interpreter ABI Platform
golded_ftn-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 100.1 kB

Release files / golded_ftn-1.2.1.tar.gz

Download URL golded_ftn-1.2.1.tar.gz
Size 85.8 kB
Tags Source
SHA-256 checksum
How to use checksums
90141aa6810d7ddcc64e24e6befca49c11ab64e52549e16723f9244a13f9540c
BLAKE2b-256 checksum
How to use checksums
d1ee59db850923300cc068aef7d7dab075142e57d6f57c5c17f4aacdfbb5bc7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

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

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / golded_ftn-1.2.1-py3-none-any.whl

Download URL golded_ftn-1.2.1-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b1b476ac9c88e41bf842689ac7328c3c78ec18b37a38a9da08e235577962e0e
BLAKE2b-256 checksum
How to use checksums
7ee2f409f71e73c1e4ca175ea17518509dc7e6ed921ff05d125bf7e623f08cd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

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

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

1.2.2

2 release files

This release

1.2.1 This release

2 release files

1.2.0

2 release files

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