Skip to content

Write replication metadata to PBF diffs in pyosmium-get-changes - #332

Closed
Sealdot wants to merge 1 commit into
osmcode:masterfrom
Sealdot:codex/get-changes-pbf-header
Closed

Sealdot wants to merge 1 commit into
osmcode:masterfrom
Sealdot:codex/get-changes-pbf-header

Conversation

@Sealdot

@Sealdot Sealdot commented Nov 22, 2026

Copy link
Copy Markdown

Fixes #179.

When pyosmium-get-changes writes a PBF diff, store the replication service URL, the last downloaded sequence number, and that sequence's UTC state timestamp in the file header. A size limit or interrupted download can stop before the requested end. The header and sequence file use the actual download boundary in both cases.

Reuse the header construction for apply_diffs_to_file. A matching state supplies the timestamp. If it is missing, malformed, or describes another sequence, keep the sequence number and URL. The stored URL omits HTTP user information and fragments.

Tested on macOS arm64 with CPython 3.12 and the osmium 4.3.2 native extensions. All 84 replication and CLI tests passed, including five new regression cases. A local HTTP replication service also exercised the installed console entry, real PBF readback, resuming with -O, binary stdout, compressed files, partial downloads and XML. The repository flake8 check passed. The full native build, full test suite and mypy were not run locally.

Prepared with assistance from OpenAI Codex.

@lonvia

lonvia commented Nov 22, 2026

Copy link
Copy Markdown
Member

I'm sorry but we don't take PRs that are mass-generated with AI agents.

@lonvia lonvia closed this Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

pyosmium-get-changes - Write changes to header

2 participants