Skip to content

Commit 29f6021

Browse files
committed
Resolve merge conflicts and update documentation
- Resolve merge conflicts in pyproject.toml and README.md - Update pyproject.toml for poetry 2.x build system with docs dependencies - Add project-specific content to placeholder docs (overview, getting started, use cases, FAQ, extending guide, release notes) - Create v2.10 release notes page required by docs build check - Add mkdocs build output to .gitignore - Fix ruff formatting and import sorting issues
1 parent dd35779 commit 29f6021

16 files changed

Lines changed: 916 additions & 343 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ venv.bak/
125125

126126
# mkdocs documentation
127127
/site
128+
/circuit-maintenance-parser/static/
128129

129130
# mypy
130131
.mypy_cache/

README.md

Lines changed: 25 additions & 199 deletions
Large diffs are not rendered by default.

circuit_maintenance_parser/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,8 @@
7979

8080
__version__ = metadata.version(__name__)
8181

82-
SUPPORTED_PROVIDER_NAMES = [
83-
provider.get_provider_type() for provider in SUPPORTED_PROVIDERS
84-
]
85-
SUPPORTED_ORGANIZER_EMAILS = [
86-
provider.get_default_organizer() for provider in SUPPORTED_PROVIDERS
87-
]
82+
SUPPORTED_PROVIDER_NAMES = [provider.get_provider_type() for provider in SUPPORTED_PROVIDERS]
83+
SUPPORTED_ORGANIZER_EMAILS = [provider.get_default_organizer() for provider in SUPPORTED_PROVIDERS]
8884

8985

9086
def init_provider(provider_type=None) -> Optional[GenericProvider]:

circuit_maintenance_parser/cli.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@
2121
)
2222
@click.option(
2323
"--provider-type",
24-
type=click.Choice(
25-
[provider.get_provider_type() for provider in SUPPORTED_PROVIDERS]
26-
),
24+
type=click.Choice([provider.get_provider_type() for provider in SUPPORTED_PROVIDERS]),
2725
default="genericprovider",
2826
help="Provider type.",
2927
)
30-
@click.option(
31-
"-v", "--verbose", count=True, help="Increase logging verbosity (repeatable)"
32-
)
28+
@click.option("-v", "--verbose", count=True, help="Increase logging verbosity (repeatable)")
3329
def main(provider_type, data_file, data_type, verbose):
3430
"""Entrypoint into CLI app."""
3531
# Default logging level is WARNING; specifying -v/--verbose repeatedly can lower the threshold.
Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,15 @@
11
# v1.0 Release Notes
22

3-
!!! warning "Developer Note - Remove Me!"
4-
Guiding Principles:
3+
This document describes all new features and changes in the `1.x` release series. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
54

6-
- Changelogs are for humans, not machines.
7-
- There should be an entry for every single version.
8-
- The same types of changes should be grouped.
9-
- Versions and sections should be linkable.
10-
- The latest version comes first.
11-
- The release date of each version is displayed.
12-
- Mention whether you follow Semantic Versioning.
5+
For a complete history of all releases, see the [full changelog](../../release_notes.md).
136

14-
Types of changes:
15-
16-
- `Added` for new features.
17-
- `Changed` for changes in existing functionality.
18-
- `Deprecated` for soon-to-be removed features.
19-
- `Removed` for now removed features.
20-
- `Fixed` for any bug fixes.
21-
- `Security` in case of vulnerabilities.
22-
23-
24-
This document describes all new features and changes in the release `1.0`. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
25-
26-
## Release Overview
27-
28-
- Major features or milestones
29-
- Achieved in this `x.y` release
30-
- Changes to compatibility with Nautobot and/or other apps, libraries etc.
31-
32-
## [v1.0.0] - 2026-03-05
7+
## v1.0.2 - 2021-05-05
338

349
### Added
3510

36-
### Changed
11+
- [#10](https://github.com/networktocode/circuit-maintenance-parser/pull/10) - Added `cli` command to run as a script.
3712

38-
### Fixed
13+
## v1.0.0 - 2021-04-29
3914

40-
- [#123](https://github.com/networktocode/circuit-maintenance-parser/issues/123) Fixed Tag filtering not working in job launch form.
15+
Initial release of the circuit-maintenance-parser library with support for parsing circuit maintenance notifications from Network Service Providers using the iCalendar BCOP standard format.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# v2.10 Release Notes
2+
3+
This document describes all new features and changes in the `2.10` release series. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4+
5+
## [v2.10.0 (2026-01-27)](https://github.com/networktocode/circuit-maintenance-parser/releases/tag/v2.10.0)
6+
7+
### Added
8+
9+
- [#330](https://github.com/networktocode/circuit-maintenance-parser/issues/330) - Add support for parsing AWS HTML format maintenance notification emails
10+
11+
### Dependencies
12+
13+
- [#360](https://github.com/networktocode/circuit-maintenance-parser/issues/360) - Updated lxml to include version 6
14+
- [#361](https://github.com/networktocode/circuit-maintenance-parser/issues/361) - Updated timezonefinder to v8.2.0
15+
- [#345](https://github.com/networktocode/circuit_maintenance_parser/issues/345) - Updated minimum Python version to 3.10 and upgraded dependencies including pytest (9.0), pylint (4.0), towncrier (25.8), backoff (2.2), and type stubs
16+
17+
### Housekeeping
18+
19+
- [#344](https://github.com/networktocode/circuit-maintenance-parser/issues/344) - Updated test coverage for the codebase

docs/dev/extending.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,70 @@
22

33
Extending the library is welcome, however it is best to open an issue first, to ensure that a PR would be accepted and makes sense in terms of features and design.
44

5+
## Adding a New Provider
6+
7+
Adding a new `Provider` is straightforward. Here's an example adding support for an imaginary provider, ABCDE, that uses HTML notifications.
8+
9+
### Step 1: Create the Parser
10+
11+
Create a new file `circuit_maintenance_parser/parsers/abcde.py` with your custom parser(s):
12+
13+
```python
14+
from typing import Dict
15+
import bs4 # type: ignore
16+
from bs4.element import ResultSet # type: ignore
17+
from circuit_maintenance_parser.parser import Html
18+
19+
class HtmlParserABCDE1(Html):
20+
def parse_html(self, soup: ResultSet) -> Dict:
21+
data = {}
22+
self._parse_bs(soup.find_all("b"), data)
23+
self._parse_tables(soup.find_all("table"), data)
24+
return [data]
25+
26+
def _parse_bs(self, btags: ResultSet, data: Dict):
27+
...
28+
29+
def _parse_tables(self, tables: ResultSet, data: Dict):
30+
...
31+
```
32+
33+
### Step 2: Create the Provider
34+
35+
Define a new class in `circuit_maintenance_parser/provider.py`:
36+
37+
```python
38+
class ABCDE(GenericProvider):
39+
_processors: List[GenericProcessor] = [
40+
CombinedProcessor(data_parsers=[EmailDateParser, HtmlParserABCDE1]),
41+
]
42+
_default_organizer = "noc@abcde.com"
43+
```
44+
45+
The `_processors` attribute is a list of `Processor` instances that use several data `Parsers`. The `_default_organizer` fills the `organizer` attribute if missing from the notification.
46+
47+
### Step 3: Expose the Provider
48+
49+
Update `circuit_maintenance_parser/__init__.py`:
50+
51+
```python
52+
from .provider import (
53+
GenericProvider,
54+
ABCDE,
55+
...
56+
)
57+
58+
SUPPORTED_PROVIDERS = (
59+
GenericProvider,
60+
ABCDE,
61+
...
62+
)
63+
```
64+
65+
### Step 4: Add Tests
66+
67+
- Add parser tests in `tests/unit/test_parsers.py`
68+
- Add provider/end-to-end tests in `tests/unit/test_e2e.py`
69+
- Add sample data in `tests/unit/data/abcde/`
70+
71+
You can anonymize IPv4 and IPv6 addresses in test data using `invoke anonymize-ips`.

docs/user/faq.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
# Frequently Asked Questions
2+
3+
## Q: My provider is not supported. What can I do?
4+
5+
You can extend the library by adding a new provider. See the [Extending the Library](../dev/extending.md) guide for instructions. Pull requests for new providers are always welcome!
6+
7+
## Q: The parser for my provider is returning incorrect data. What should I do?
8+
9+
Please [open an issue](https://github.com/networktocode/circuit-maintenance-parser/issues/new) with the details. If possible, include a sanitized sample of the notification data that is being parsed incorrectly.
10+
11+
## Q: Can I use the LLM-powered parser without a specific provider?
12+
13+
Yes, the LLM-powered parsers are automatically appended after all existing processors for each defined Provider when the appropriate environment variables are set. You can use them with any provider, including the `GenericProvider`.
14+
15+
## Q: How do I check if a maintenance was parsed by an LLM?
16+
17+
Each `Maintenance` object has a `metadata` attribute. Check `maintenance.metadata.generated_by_llm` to determine if LLM parsing was used.
18+
19+
## Q: Where can I get help?
20+
21+
Feel free to swing by the [Network to Code Slack](https://networktocode.slack.com/) (channel `#networktocode`). Sign up [here](http://slack.networktocode.com/) if you don't have an account.

docs/user/lib_getting_started.md

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,63 @@ To install the library, please follow the instructions detailed in the [Installa
88

99
## First steps with the Library
1010

11-
!!! warning "Developer Note - Remove Me!"
12-
What (with screenshots preferably) does it look like to perform the simplest workflow within the library once installed?
11+
### Parse an iCalendar Notification
1312

14-
## What are the next steps?
13+
The simplest use case is parsing a standard iCalendar (BCOP) notification:
14+
15+
```python
16+
from circuit_maintenance_parser import init_provider, NotificationData
17+
18+
# Initialize a generic provider (supports standard iCalendar format)
19+
provider = init_provider()
20+
21+
# Create notification data from raw iCalendar content
22+
raw_data = b"""BEGIN:VCALENDAR
23+
VERSION:2.0
24+
PRODID:-//Maint Note//https://github.com/maint-notification//
25+
BEGIN:VEVENT
26+
SUMMARY:Maint Note Example
27+
DTSTART;VALUE=DATE-TIME:20151010T080000Z
28+
DTEND;VALUE=DATE-TIME:20151010T100000Z
29+
DTSTAMP;VALUE=DATE-TIME:20151010T001000Z
30+
UID:42
31+
SEQUENCE:1
32+
X-MAINTNOTE-PROVIDER:example.com
33+
X-MAINTNOTE-ACCOUNT:137.035999173
34+
X-MAINTNOTE-MAINTENANCE-ID:WorkOrder-31415
35+
X-MAINTNOTE-IMPACT:OUTAGE
36+
X-MAINTNOTE-OBJECT-ID;X-MAINTNOTE-OBJECT-IMPACT=OUTAGE:circuit-1
37+
X-MAINTNOTE-STATUS:TENTATIVE
38+
ORGANIZER;CN="Example NOC":mailto:noone@example.com
39+
END:VEVENT
40+
END:VCALENDAR
41+
"""
42+
43+
data = NotificationData.init_from_raw("ical", raw_data)
44+
maintenances = provider.get_maintenances(data)
45+
46+
print(maintenances[0].to_json())
47+
```
48+
49+
### Parse a Provider-Specific Notification
1550

16-
!!! warning "Developer Note - Remove Me!"
17-
After taking the first steps, what else could the users look at doing.
51+
For providers that don't use the standard iCalendar format, initialize a provider-specific instance:
52+
53+
```python
54+
from circuit_maintenance_parser import init_provider
55+
56+
# Initialize a provider-specific parser (e.g., Zayo)
57+
zayo_provider = init_provider("zayo")
58+
```
59+
60+
### Use the CLI
61+
62+
The library also provides a command-line interface:
63+
64+
```bash
65+
circuit-maintenance-parser --data-file notification.eml --data-type email --provider-type zayo
66+
```
67+
68+
## What are the next steps?
1869

19-
You can check out the [Use Cases](./lib_use_cases.md) section for more examples.
70+
You can check out the [Use Cases](./lib_use_cases.md) section for more examples.

docs/user/lib_overview.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ This document provides an overview of the library including critical information
44

55
## Description
66

7+
`circuit-maintenance-parser` is a Python library that parses circuit maintenance notifications from Network Service Providers (NSPs), converting heterogeneous formats to a well-defined structured format.
8+
9+
Every network depends on external circuits provided by NSPs who interconnect them to the Internet, to office branches or to external service providers such as Public Clouds. These services occasionally require operation windows to upgrade or fix related issues, usually in the form of **circuit maintenance periods**. NSPs generally notify customers of these upcoming events so that customers can take actions to minimize impact.
10+
11+
The challenge is that almost every NSP defines its own maintenance notification format, even though the relevant information is mostly the same. This library parses notification formats from several providers and returns a standardized object struct, making it easier to process them.
12+
13+
The output format follows the [BCOP](https://github.com/jda/maintnote-std/blob/master/standard.md) defined during a NANOG meeting that promotes the usage of the iCalendar format.
714

815
## Audience (User Personas) - Who should use this Library?
916

10-
!!! warning "Developer Note - Remove Me!"
11-
Who is this meant for/ who is the common user of this library?
17+
- **Network Engineers** who need to automate the processing of circuit maintenance notifications from multiple providers.
18+
- **Network Operations Center (NOC) teams** who want to standardize how maintenance windows are tracked across different NSPs.
19+
- **Automation developers** building workflows that need to programmatically consume and act on circuit maintenance notifications.
1220

1321
## Authors and Maintainers
1422

15-
!!! warning "Developer Note - Remove Me!"
16-
Add the team and/or the main individuals maintaining this project. Include historical maintainers as well.
23+
This library is maintained by [Network to Code](https://www.networktocode.com/). For a full list of contributors, see the [GitHub contributors page](https://github.com/networktocode/circuit-maintenance-parser/graphs/contributors).

0 commit comments

Comments
 (0)