A simple tool for formatting MAC addresses
Project description
mac-formatter
A simple library to convert MAC-addresses to different formats.
How to use in terminal(cli).
positional arguments:
mac_address: The MAC address to format
options:
-h, --help: show this help message and exit
-f, --format: {colon,dot,line,twoline,space,blank}, The format to use. If not specified, all formats will be printed.
-u, --uppercase: Prints the MAC address in uppercase.
-l, --lowercase: Prints the MAC address in lowercase.
Example usage:
mac-formatter 01ab02cd03ef -f dot
output:
01ab.02cd.03ef
How to use in your code.
from mac_formatter import MacFormatter
mac_address = '01:ab:02:cd:03:ef'
mac = MacFormatter(mac_address)
print(mac.dot)
print(mac.line)
print(mac.space)
print(mac.colon)
print(mac.blank)
output:
01ab.02cd.03ef
01-ab-02-cd-03-ef
01 ab 02 cd 03 ef
01:ab:02:cd:03:ef
01ab02cd03ef
---
thamuppet
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mac-formatter-0.3.6.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file mac-formatter-0.3.6.tar.gz
.
File metadata
- Download URL: mac-formatter-0.3.6.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 004e74780d07be43e4a3e8f732f81683f5ddaccde39f306c08e0baa223e2cbfd |
|
MD5 | af0d65ff176aeae76244024359564352 |
|
BLAKE2b-256 | 29c9e6b4feaab24c5c75221ad5dec4fb2e845c0b3f1b36620c029c88019b23a7 |
File details
Details for the file mac_formatter-0.3.6-py3-none-any.whl
.
File metadata
- Download URL: mac_formatter-0.3.6-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e012897e82bac2fbd045cc1df1483002975a74a059ec1f9f4ce92f06f6bfc13 |
|
MD5 | ecce999d76f1e6133dd62e58a558063e |
|
BLAKE2b-256 | 3d2f4c85f08739eced5a4dd26f6685568a24826bb14c867043d4dae0ba81e6c0 |