You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

nats-py

Package Overview
Dependencies
Maintainers
4
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nats-py - pypi Package Compare versions

Comparing version
2.13.0
to
2.13.1
+1
-1
PKG-INFO
Metadata-Version: 2.4
Name: nats-py
Version: 2.13.0
Version: 2.13.1
Summary: NATS client for Python

@@ -5,0 +5,0 @@ Author-email: Waldemar Quevedo <wally@synadia.com>

@@ -7,3 +7,3 @@ [build-system]

name = "nats-py"
version = "2.13.0"
version = "2.13.1"
authors = [

@@ -10,0 +10,0 @@ { name="Waldemar Quevedo", email="wally@synadia.com" },

Metadata-Version: 2.4
Name: nats-py
Version: 2.13.0
Version: 2.13.1
Summary: NATS client for Python

@@ -5,0 +5,0 @@ Author-email: Waldemar Quevedo <wally@synadia.com>

@@ -88,2 +88,14 @@ # Copyright 2021 The NATS Authors

@staticmethod
def _parse_utc_iso(time_string: str) -> datetime.datetime:
"""Parse an ISO 8601 timestamp (with nanoseconds) into a UTC datetime."""
# Replace Z with UTC offset
s = time_string.replace("Z", "+00:00")
# Trim fractional seconds to 6 digits (microsecond precision)
date_part, frac_tz = s.split(".", 1)
frac, tz = frac_tz.split("+")
frac = frac[:6] # keep only microseconds
s = f"{date_part}.{frac}+{tz}"
return datetime.datetime.fromisoformat(s).astimezone(datetime.timezone.utc)
@classmethod

@@ -396,5 +408,3 @@ def from_response(cls: type[_B], resp: Dict[str, Any]) -> _B:

if "leader_since" in resp and resp["leader_since"]:
resp["leader_since"] = datetime.datetime.fromisoformat(
cls._python38_iso_parsing(resp["leader_since"])
).astimezone(datetime.timezone.utc)
resp["leader_since"] = cls._parse_utc_iso(resp["leader_since"])
return super().from_response(resp)

@@ -717,17 +727,4 @@

@classmethod
def _python38_iso_parsing(cls, time_string: str):
# Replace Z with UTC offset
s = time_string.replace("Z", "+00:00")
# Trim fractional seconds to 6 digits
date_part, frac_tz = s.split(".", 1)
frac, tz = frac_tz.split("+")
frac = frac[:6] # keep only microseconds
s = f"{date_part}.{frac}+{tz}"
return s
@classmethod
def from_response(cls, resp: Dict[str, Any]):
resp["time"] = datetime.datetime.fromisoformat(cls._python38_iso_parsing(resp["time"])).astimezone(
datetime.timezone.utc
)
resp["time"] = cls._parse_utc_iso(resp["time"])
return super().from_response(resp)

@@ -734,0 +731,0 @@

Sorry, the diff of this file is too big to display