Skip to content

Add parser for provider/vendor RETN.#412

Merged
jvanderaa merged 5 commits intonetworktocode:developfrom
i3dnet-akoopen:retn-parser
May 6, 2026
Merged

Add parser for provider/vendor RETN.#412
jvanderaa merged 5 commits intonetworktocode:developfrom
i3dnet-akoopen:retn-parser

Conversation

@i3dnet-akoopen
Copy link
Copy Markdown
Contributor

@i3dnet-akoopen i3dnet-akoopen commented May 1, 2026

This is a HTML/Subject parser for provider/vendor RETN (its a well-known European/Asian provider of wavelength/IP products).

Tests seem to pass (4 tests included in the PR):

383 passed in 12.27s

circuit_maintenance_parser/parsers/retn.py 62 7 89%

All tests have passed!

@jvanderaa
Copy link
Copy Markdown
Contributor

Could you match the Colt parser's approach for date parsing? RETN sends dates in DD.MM.YYYY format (e.g. 07.05.2026), which dateutil.parser.parse() ambiguously parses as MM.DD.YYYY when both numbers are ≤ 12, silently producing wrong timestamps. Colt handles the same European format by passing dayfirst=True (see circuit_maintenance_parser/parsers/colt.py:54-55). Updating the two parser.parse(...) calls in circuit_maintenance_parser/parsers/retn.py:103,105 to do the same will fix retn1 (07.05.2026 is currently being decoded as 2026-07-05 instead of 2026-05-07); retn2 and retn3 happen to round-trip correctly today only because their day numbers (24, 26) are >12 and force dateutil into DD.MM mode. Expected JSON for retn1 will need to be regenerated after the fix.

@i3dnet-akoopen
Copy link
Copy Markdown
Contributor Author

Oh! Nicely spotted... that should be fixed now. The test-result for "retn1" had to be adjusted indeed. Tests have passed succesfully.

Copy link
Copy Markdown
Contributor

@jvanderaa jvanderaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you.

@jvanderaa jvanderaa merged commit 2f1a078 into networktocode:develop May 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants