Skip to main content

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,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


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.5.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

mac_formatter-0.3.5-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file mac-formatter-0.3.5.tar.gz.

File metadata

  • Download URL: mac-formatter-0.3.5.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

Hashes for mac-formatter-0.3.5.tar.gz
Algorithm Hash digest
SHA256 b9481130d64856092ad707362005983896678678abeb36c6eef8fc24a8317271
MD5 1cc310a09462f005e9899425b318551a
BLAKE2b-256 2d9661834ce2adf24fe2efa97e5800bfe485d816cfc99d5d1a2aea3922b9270b

See more details on using hashes here.

File details

Details for the file mac_formatter-0.3.5-py3-none-any.whl.

File metadata

File hashes

Hashes for mac_formatter-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dc35e3d0693cca3a3cad5707e3b1badd17ed5745cdecb7884b4a40d63333fa95
MD5 98c8a938bfe2797e396769d82095197c
BLAKE2b-256 745f0f893ab3cd674dd1c0dbdcb1f0aa08cbed4311f1e79445d66623e9f1ad6f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page