cdns 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cdns/__init__.py ADDED
@@ -0,0 +1,12 @@
1
+ from .domains import *
2
+ from .headers import *
3
+ from .cdn import *
4
+
5
+ __all__ = [
6
+ "compile_domain",
7
+ "compile_domains",
8
+ "matches",
9
+ "match_headers",
10
+ "CDN",
11
+ "IPRange",
12
+ ]
cdns/cdn.py ADDED
@@ -0,0 +1,19 @@
1
+ from dataclasses import dataclass
2
+ from typing import Literal
3
+
4
+
5
+ @dataclass
6
+ class IPRange:
7
+ range_type: Literal["ipv4", "ipv6", "combined"]
8
+ ranges: list[str] | None = None
9
+ last_updated: str | None = None # ISO8601 date
10
+ url: str | None = None
11
+
12
+
13
+ @dataclass
14
+ class CDN:
15
+ name: str
16
+ domains: list[str]
17
+ headers: list[dict[str, str | None]]
18
+ ranges: list[IPRange]
19
+ asns: list[int]