pybgpkitstream 0.1.4__tar.gz → 0.1.5__tar.gz
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.
- {pybgpkitstream-0.1.4 → pybgpkitstream-0.1.5}/PKG-INFO +1 -1
- {pybgpkitstream-0.1.4 → pybgpkitstream-0.1.5}/pyproject.toml +1 -1
- {pybgpkitstream-0.1.4 → pybgpkitstream-0.1.5}/src/pybgpkitstream/bgpkitstream.py +2 -3
- {pybgpkitstream-0.1.4 → pybgpkitstream-0.1.5}/src/pybgpkitstream/bgpstreamconfig.py +11 -1
- {pybgpkitstream-0.1.4 → pybgpkitstream-0.1.5}/README.md +0 -0
- {pybgpkitstream-0.1.4 → pybgpkitstream-0.1.5}/src/pybgpkitstream/__init__.py +0 -0
- {pybgpkitstream-0.1.4 → pybgpkitstream-0.1.5}/src/pybgpkitstream/bgpelement.py +0 -0
- {pybgpkitstream-0.1.4 → pybgpkitstream-0.1.5}/src/pybgpkitstream/cli.py +0 -0
- {pybgpkitstream-0.1.4 → pybgpkitstream-0.1.5}/src/pybgpkitstream/py.typed +0 -0
|
@@ -116,9 +116,8 @@ class BGPKITStream:
|
|
|
116
116
|
self.urls = {"rib": defaultdict(list), "update": defaultdict(list)}
|
|
117
117
|
for data_type in self.data_type:
|
|
118
118
|
items: list[BrokerItem] = self.broker.query(
|
|
119
|
-
ts_start=
|
|
120
|
-
|
|
121
|
-
ts_end=datetime.datetime.fromtimestamp(self.ts_end),
|
|
119
|
+
ts_start=int(self.ts_start - 60),
|
|
120
|
+
ts_end=int(self.ts_end),
|
|
122
121
|
collector_id=self.collector_id,
|
|
123
122
|
data_type=data_type,
|
|
124
123
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime
|
|
2
|
-
from pydantic import BaseModel, Field, DirectoryPath
|
|
2
|
+
from pydantic import BaseModel, Field, DirectoryPath, field_validator
|
|
3
3
|
from typing import Literal
|
|
4
4
|
from ipaddress import IPv4Address, IPv6Address
|
|
5
5
|
|
|
@@ -70,3 +70,13 @@ class BGPStreamConfig(BaseModel):
|
|
|
70
70
|
default=datetime.timedelta(hours=2),
|
|
71
71
|
description="Interval for the fetch/parse cycle (avoid long prefetch time)",
|
|
72
72
|
)
|
|
73
|
+
|
|
74
|
+
@field_validator("start_time", "end_time")
|
|
75
|
+
@classmethod
|
|
76
|
+
def normalize_to_utc(cls, dt: datetime.datetime) -> datetime.datetime:
|
|
77
|
+
# if naive datetime (not timezone-aware) assume it's UTC
|
|
78
|
+
if dt.tzinfo is None:
|
|
79
|
+
return dt.replace(tzinfo=datetime.timezone.utc)
|
|
80
|
+
# if timezone-aware, convert to utc
|
|
81
|
+
else:
|
|
82
|
+
return dt.astimezone(datetime.timezone.utc)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|