nbforager 0.8.8__tar.gz → 0.8.9__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.
- {nbforager-0.8.8 → nbforager-0.8.9}/PKG-INFO +1 -2
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/joiner.py +1 -1
- {nbforager-0.8.8 → nbforager-0.8.9}/pyproject.toml +1 -2
- nbforager-0.8.8/nbforager/foragers/ipv4.py +0 -85
- {nbforager-0.8.8 → nbforager-0.8.9}/LICENSE.txt +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/README.rst +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/__init__.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/__init__.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/base_ac.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/base_c.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/circuits.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/connector.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/core.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/dcim.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/extended_get.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/extras.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/ip_addresses.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/ipam.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/plugins_ca.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/status.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/tenancy.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/users.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/virtualization.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/api/wireless.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/constants.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/exceptions.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/__init__.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/base_fa.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/circuits.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/core.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/dcim.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/extras.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/forager.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/ipam.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/tenancy.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/users.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/virtualization.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/foragers/wireless.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/helpers.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/log.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/messages.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/nb_api.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/nb_cache.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/nb_forager.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/nb_tree.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/parser/__init__.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/parser/nb_custom.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/parser/nb_parser.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/parser/nb_value.py +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/py.typed +0 -0
- {nbforager-0.8.8 → nbforager-0.8.9}/nbforager/types_.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: nbforager
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.9
|
4
4
|
Summary: Python package designed to assist in working with the Netbox REST API. The filter parameters are identical to those in the Web UI filter form. It replaces brief data with full information, and Netbox objects are represented as a recursive multidimensional dictionary.
|
5
5
|
License: Apache-2.0
|
6
6
|
Keywords: netbox
|
@@ -22,7 +22,6 @@ Requires-Dist: requests (>=2,<3)
|
|
22
22
|
Requires-Dist: tabulate (>=0.9,<0.10)
|
23
23
|
Requires-Dist: vhelpers (>=0.3)
|
24
24
|
Project-URL: Bug Tracker, https://github.com/vladimirs-git/nbforager/issues
|
25
|
-
Project-URL: Download URL, https://github.com/vladimirs-git/nbforager/archive/refs/tags/0.8.8.tar.gz
|
26
25
|
Project-URL: homepage, https://github.com/vladimirs-git/nbforager
|
27
26
|
Project-URL: repository, https://github.com/vladimirs-git/nbforager
|
28
27
|
Description-Content-Type: text/x-rst
|
@@ -6,7 +6,7 @@ from vhelpers import vlist
|
|
6
6
|
|
7
7
|
from nbforager import helpers as h
|
8
8
|
from nbforager.api.base_c import BaseC
|
9
|
-
from
|
9
|
+
from netports import IPv4
|
10
10
|
from nbforager.nb_tree import NbTree
|
11
11
|
from nbforager.parser import nb_parser
|
12
12
|
from nbforager.parser.nb_value import NbValue
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "nbforager"
|
3
|
-
version = "0.8.
|
3
|
+
version = "0.8.9"
|
4
4
|
description = "Python package designed to assist in working with the Netbox REST API. The filter parameters are identical to those in the Web UI filter form. It replaces brief data with full information, and Netbox objects are represented as a recursive multidimensional dictionary."
|
5
5
|
authors = ["Vladimirs Prusakovs <vladimir.prusakovs@gmail.com>"]
|
6
6
|
readme = "README.rst"
|
@@ -19,7 +19,6 @@ classifiers = [
|
|
19
19
|
homepage = "https://github.com/vladimirs-git/nbforager"
|
20
20
|
repository = "https://github.com/vladimirs-git/nbforager"
|
21
21
|
"Bug Tracker" = "https://github.com/vladimirs-git/nbforager/issues"
|
22
|
-
"Download URL" = "https://github.com/vladimirs-git/nbforager/archive/refs/tags/0.8.8.tar.gz"
|
23
22
|
|
24
23
|
[tool.poetry.dependencies]
|
25
24
|
python = "^3.11"
|
@@ -1,85 +0,0 @@
|
|
1
|
-
"""IPv4 address representation in CIDR notation."""
|
2
|
-
|
3
|
-
from __future__ import annotations
|
4
|
-
|
5
|
-
from functools import total_ordering
|
6
|
-
from ipaddress import IPv4Interface, IPv4Network
|
7
|
-
|
8
|
-
|
9
|
-
@total_ordering
|
10
|
-
class IPv4:
|
11
|
-
"""IPv4 address representation in CIDR notation."""
|
12
|
-
|
13
|
-
def __init__(self, cidr: str, strict: bool = False):
|
14
|
-
"""Initialize IPv4 object with the given CIDR notation.
|
15
|
-
|
16
|
-
:param cidr: A string like '192.168.1.1/24'
|
17
|
-
:param strict: If True, IP must be valid network address (not host address).
|
18
|
-
:raises ValueError: If strict is True and a network address is not supplied.
|
19
|
-
"""
|
20
|
-
if strict:
|
21
|
-
IPv4Network(cidr, strict=strict)
|
22
|
-
self.interface = IPv4Interface(cidr)
|
23
|
-
|
24
|
-
def __repr__(self):
|
25
|
-
"""Representation of the object."""
|
26
|
-
return f"IPv4('{self.cidr}')"
|
27
|
-
|
28
|
-
def __str__(self):
|
29
|
-
"""String representation
|
30
|
-
|
31
|
-
:return: IPv4 address with prefixlen, A.B.C.D/LEN.
|
32
|
-
"""
|
33
|
-
return self.cidr
|
34
|
-
|
35
|
-
def __hash__(self) -> int:
|
36
|
-
"""Hash value of the object."""
|
37
|
-
return hash(self.interface.network)
|
38
|
-
|
39
|
-
def __eq__(self, other: IPv4, /) -> bool:
|
40
|
-
"""Check if two objects are equal.
|
41
|
-
|
42
|
-
:param other: Another object to compare.
|
43
|
-
:return: True if objects are equal, False otherwise.
|
44
|
-
"""
|
45
|
-
if not isinstance(other, IPv4):
|
46
|
-
return False
|
47
|
-
return self.interface == other.interface
|
48
|
-
|
49
|
-
def __lt__(self, other: IPv4, /) -> bool:
|
50
|
-
"""Compare two objects.
|
51
|
-
|
52
|
-
:param other: Another object to compare with.
|
53
|
-
"""
|
54
|
-
if not isinstance(other, IPv4):
|
55
|
-
return False
|
56
|
-
return self.interface < other.interface
|
57
|
-
|
58
|
-
def __contains__(self, other: IPv4, /) -> bool:
|
59
|
-
"""Check if all IPs in the other subnet are part of this network."""
|
60
|
-
return other.interface.network.subnet_of(self.interface.network)
|
61
|
-
|
62
|
-
@property
|
63
|
-
def ip(self) -> str:
|
64
|
-
"""IPv4 address without prefixlen, A.B.C.D."""
|
65
|
-
return str(self.interface.ip)
|
66
|
-
|
67
|
-
@property
|
68
|
-
def cidr(self) -> str:
|
69
|
-
"""IPv4 address with prefixlen, A.B.C.D/LEN."""
|
70
|
-
return str(self.interface.with_prefixlen)
|
71
|
-
|
72
|
-
@property
|
73
|
-
def is_private(self) -> bool:
|
74
|
-
"""IPv4 address is private."""
|
75
|
-
return bool(self.interface.ip.is_private)
|
76
|
-
|
77
|
-
@property
|
78
|
-
def net(self) -> str:
|
79
|
-
"""IPv4 network with prefixlen, A.B.C.D/LEN."""
|
80
|
-
return str(self.interface.network)
|
81
|
-
|
82
|
-
@property
|
83
|
-
def prefixlen(self) -> int:
|
84
|
-
"""IPv4 network with prefixlen, A.B.C.D/LEN."""
|
85
|
-
return self.interface.network.prefixlen
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|