1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-macaddress
7 SDESC[v11]= MAC hardware identifier module (3.11)
8 SDESC[v12]= MAC hardware identifier module (3.12)
9 HOMEPAGE= https://github.com/mentalisttraceur/python-macaddress
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/6e/40/cfad5b515667b0465a3169757b5c9f17639dc1da145c65248e5b9fe481d8
14 DISTFILE[1]= macaddress-2.0.2-py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY311 PY312
20 OPTIONS_STANDARD= none
21 VOPTS[v11]= PY311=ON PY312=OFF
22 VOPTS[v12]= PY311=OFF PY312=ON
24 DISTNAME= macaddress-2.0.2.dist-info
28 [PY311].USES_ON= python:v11,wheel
30 [PY312].USES_ON= python:v12,wheel
32 [FILE:2304:descriptions/desc.single]
36 A module for handling hardware identifiers like MAC addresses.
38 This module makes it easy to:
40 1. check if a string represents a valid MAC address, or a similar
41 hardware identifier like an EUI-64, OUI, etc,
43 2. convert between string and binary forms of MAC addresses and
44 other hardware identifiers,
48 Heavily inspired by the ipaddress module, but not yet quite
54 This library's version numbers follow the `SemVer 2.0.0
55 specification <https://semver.org/spec/v2.0.0.html>`_.
62 pip install macaddress
73 Classes are provided for the common hardware identifier
74 types: EUI48 (also available as MAC), EUI64,
75 OUI, and so on. If those aren't enough, you can
76 easily define others with just a few lines of code.
78 Parse or Validate String
79 ~~~~~~~~~~~~~~~~~~~~~~~~
81 When only one address type is valid:
83 All provided classes support the standard and common formats.
84 For example, the EUI48 class supports the following
89 >>> macaddress.EUI48('01-23-45-67-89-ab')
90 EUI48('01-23-45-67-89-AB')
91 >>> macaddress.EUI48('01:23:45:67:89:ab')
92 EUI48('01-23-45-67-89-AB')
93 >>> macaddress.EUI48('0123.4567.89ab')
94 EUI48('01-23-45-67-89-AB')
95 >>> macaddress.EUI48('0123456789ab')
96 EUI48('01-23-45-67-89-AB')
98 You can inspect what formats a hardware address class supports
99 by looking at its formats attribute:
103 >>> macaddress.OUI.formats
104 ('xx-xx-xx', 'xx:xx:xx', 'xxxxxx')
106 Each x in the format string matches one hexadecimal
107 "digit", and all other characters are matched literally.
109 If the string does not match one of the formats, a
110 ValueError is raised:
115 ... macaddress.MAC('foo bar')
116 ... except ValueError as error:
119 'foo bar' cannot be parsed as EUI48
121 If you need to parse in a format that isn't supported,
122 you can define a subclass and add the formats:
126 >>> class MAC(macaddress.MAC):
127 ... formats = macaddress.MAC.formats + (
128 ... 'xx-xx-xx-xx-xx-xx-',
129 ... 'xx:xx:xx:xx:xx:xx:',
130 ... 'xxxx.xxxx.xxxx.',
136 6f4a0430f9b5af6d98a582b8d527ba2cd3f0825fce5503a9ce5c73acb772c30f 8027 macaddress-2.0.2-py3-none-any.whl