Platform-independent pure-Python module to get a MAC address
arping
ArpFile
method succeeds, use it instead of ArpingHost
(this should fix #86, for realsies this time).ArpingHost
Announcement: Compatibility with Python versions older than 3.7 (2.7, 3.4, 3.5, and 3.6) is deprecated and will be removed in getmac 1.0.0. If you are stuck on an unsupported Python, consider loosely pinning the version of this package in your dependency list, e.g. getmac<1.0.0
or getmac~=0.9.0
.
Announcement: Compatibility with Python versions older than 3.7 (2.7, 3.4, 3.5, and 3.6) is deprecated and will be removed in getmac 1.0.0. If you are stuck on an unsupported Python, consider loosely pinning the version of this package in your dependency list, e.g. getmac<1.0.0
or getmac~=0.9.0
.
Announcement: Compatibility with Python versions older than 3.6 (2.7, 3.4, and 3.5) is deprecated and will be removed in getmac 1.0.0. If you are stuck on an unsupported Python, consider loosely pinning the version of this package in your dependency list, e.g. getmac<1.0.0
or getmac~=0.9.0
.
This release is a complete rewrite of getmac from the ground up.
Refer to docs/rewrite.md for a in-depth explanation of the rewrite changes.
The new system has a number of benefits
route get default
)sunos
(Which applies to any system where platform.system() == SunOS
).arping
(POSIX) or SendARP
(Windows) will now always be used instead of sending a UDP packet when looking for the MAC of a IPv4 host, if they're available and operable (otherwise, UDP + ARP table check will be used like before).DEBUG>=1
or -d
)--override-port
(this was already possible in Python via getmac.getmac.PORT
, but wasn't configurable via the CLI. Now it is!).--override-platform
argument (CLI) or getmac.getmac.OVERRIDE_PLATFORM
variable (Python). This will force methods for that platform to be used, regardless of the actual platform. Here's an example forcing linux
to be used as the platform: getmac -i eth0 --override-platform linux
. In version 1.0.0, this feature will added as an argument to get_mac_address()
.--force-method
argument (CLI) or getmac.getmac.FORCE_METHOD
variable (Python). This is useful for troubleshotting issues, general debugging, and testing changes. Example: getmac -v -dddd --ip 192.168.0.1 --force-method ctypeshost
getmac
from the ground up. Refer to docs/rewrite.md
for a in-depth explanation of the rewrite changes
None
, as expected, instead of raising an exception (socket.gaierror
).netstat
on older Linux distros (such as Ubuntu 12.04)ifconfig
parsing. It should now be far more reliable and accurate across all platforms.root
)./proc/net/route
parsing (this affected Android and potentially other platforms)route get default
)getmac.1
/getmac2.1
). They were severely out of date and unused. May re-add at a later date.flake8-pytest-style
and flake8-annotations
packaging/rpm/
. This stuff hasn't been updated since 0.6.0, may remove in the future and leave distro packaging to distro maintainers.This pre-release is a complete rewrite of getmac from the ground up.
If you want to test the new changes, use the --pre
argument to pip install
pip install --pre -U getmac
It's passing tests and seems to be operable. However, with a change this large there are inevitably issues that the tests or I don't catch, so I'm doing a series of pre-releases until I'm 99% confident in it's stability. Refer to docs/rewrite.md for a in-depth explanation of the rewrite changes.
See previous pre-releases or CHANGELOG.md to full details on this pre-release.
This pre-release is a complete rewrite of getmac from the ground up.
If you want to test the new changes, use the --pre
argument to pip install
pip install --pre -U getmac
It's passing tests and seems to be operable. However, with a change this large there are inevitably issues that the tests or I don't catch, so I'm doing a series of pre-releases until I'm 99% confident in it's stability. Refer to docs/rewrite.md for a in-depth explanation of the rewrite changes.
The new system has a number of benefits
See CHANGELOG.md to full details on this pre-release.
Announcement: Compatibility with Python versions older than 3.6 (2.7, 3.4, and 3.5) is deprecated and will be removed in getmac 1.0.0. If you are stuck on an unsupported Python, considor loosely pinning the version of this package in your dependency list, e.g. getmac<1
.
arping
in addition to the existing iputils one (contributed by Ville Skyttä (@scop) in #52 and #54)Announcement: Python 2 compatibility will be dropped in getmac 1.0.0, which will be finished sometime in 2020. If you are stuck on Python 2, consider loosely pinning the version in your dependencies list, e.g. getmac<1
. I will continue to fix reported bugs and accept patches for the last release before 1.0.0, however active development will cease and new features will not be backported.
arping
as last resortvulture
, several Flake8 plugins