Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pccw parser #301

Merged
merged 8 commits into from
Jan 3, 2025
Merged

Add Pccw parser #301

merged 8 commits into from
Jan 3, 2025

Conversation

snitass
Copy link
Contributor

@snitass snitass commented Jan 2, 2025

This code implements parsers for PCCW (a telecommunications company) circuit maintenance email notifications. It consists of two main classes:

HtmlParserPccw: Parses the HTML content of maintenance emails to extract:

  • Provider name (PCCW Global)
  • Customer account information
  • Maintenance window start and end times

SubjectParserPccw: Parses the email subject line to extract:

  • Maintenance ID
  • Status (defaults to COMPLETED)
  • Summary information

The parsers use regular expressions and string manipulation to extract relevant information from the email content. The datetime values are handled in a specific format ("%d/%m/%Y %H:%M:%S") and converted to timestamps.

tests/unit/test_e2e.py Outdated Show resolved Hide resolved
@chadell
Copy link
Collaborator

chadell commented Jan 3, 2025

In the CI, there is an error due to Python 3.8 support:

    def _extract_maintenance_window(self, soup: ResultSet) -> tuple[datetime, datetime]:
E   TypeError: 'type' object is not subscriptable

-> The syntax tuple[datetime, datetime] is subscriptable typing, which is supported only in Python 3.9+.
Because Python3.8 is EOL, I'm gonna drop support in develop for the next release.
#302

Copy link
Collaborator

@chadell chadell left a comment

Choose a reason for hiding this comment

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

LGTM, many thanks @snitass !

@chadell chadell merged commit 60319aa into networktocode:develop Jan 3, 2025
15 checks passed
@snitass snitass deleted the pccw-parser branch January 3, 2025 20:05
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