pybgpkitstream 0.1.5__py3-none-any.whl → 0.1.6__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.
@@ -56,6 +56,15 @@ class Directory:
56
56
  pass
57
57
 
58
58
 
59
+ def get_shared_memory():
60
+ """Get a RAM-based temp path if available, otherwise fall back to default."""
61
+ if os.path.exists("/dev/shm"): # Linux tmpfs
62
+ return "/dev/shm"
63
+ elif os.path.exists("/Volumes/RAMDisk"): # macOS (if mounted)
64
+ return "/Volumes/RAMDisk"
65
+ return None # Fall back to default temp directory
66
+
67
+
59
68
  class BGPKITStream:
60
69
  def __init__(
61
70
  self,
@@ -73,7 +82,9 @@ class BGPKITStream:
73
82
  self.collector_id = collector_id
74
83
  self.data_type = data_type
75
84
  self.cache_dir: Directory | TemporaryDirectory = (
76
- Directory(cache_dir) if cache_dir else TemporaryDirectory()
85
+ Directory(cache_dir)
86
+ if cache_dir
87
+ else TemporaryDirectory(dir=get_shared_memory())
77
88
  )
78
89
  self.filters = filters
79
90
  self.max_concurrent_downloads = max_concurrent_downloads
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pybgpkitstream
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Drop-in replacement for PyBGPStream using BGPKIT
5
5
  Author: JustinLoye
6
6
  Author-email: JustinLoye <jloye@iij.ad.jp>
@@ -1,10 +1,10 @@
1
1
  pybgpkitstream/__init__.py,sha256=kNfv6bvDkaGKjlw0pr9LWVqOQtIGmIPk-VG1ZCBuA38,163
2
2
  pybgpkitstream/bgpelement.py,sha256=7mXSUmWThhIbKy2JVsLchoteve0BshT3uH8cdbAe0Go,1176
3
- pybgpkitstream/bgpkitstream.py,sha256=kaoGAx282FfE5I3_sHXN1Zhzkpr7y94ffI5ZePVydog,10609
3
+ pybgpkitstream/bgpkitstream.py,sha256=VU79Olu1wk_GNBMxsCKCMjMfSU5YoKA9WsCf-4sOMBk,10997
4
4
  pybgpkitstream/bgpstreamconfig.py,sha256=tFZEpqOoFMMNbyf6dzKHEtHZnEnm1Gv88hKy6BqTCq8,3299
5
5
  pybgpkitstream/cli.py,sha256=E0E1hO0fzGhy1skBopRufdewsiSy_mA-J8Gf2WxBRxo,4214
6
6
  pybgpkitstream/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- pybgpkitstream-0.1.5.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
8
- pybgpkitstream-0.1.5.dist-info/entry_points.txt,sha256=aWhImGlXLtRKkfyJHudcbSp5K5As4ZGL8wXZC0y6q4o,60
9
- pybgpkitstream-0.1.5.dist-info/METADATA,sha256=b_tSeDSOKUN7V2u0ooWWIxnHN_pQS4CXvcC9JwrJb_g,2953
10
- pybgpkitstream-0.1.5.dist-info/RECORD,,
7
+ pybgpkitstream-0.1.6.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
8
+ pybgpkitstream-0.1.6.dist-info/entry_points.txt,sha256=aWhImGlXLtRKkfyJHudcbSp5K5As4ZGL8wXZC0y6q4o,60
9
+ pybgpkitstream-0.1.6.dist-info/METADATA,sha256=yKcQtzIS0JFXppGsnMVnQRlhVp82_u6Es8Q1fgPLFqQ,2953
10
+ pybgpkitstream-0.1.6.dist-info/RECORD,,