convert mac to required format
Project description
Get mac address, correct and return in required format DOES NOT CHECK THE INPUT MAC ADDRESS FORMAT, just delete invalid characters and check len = 12 :param mac: mac address :param delimiter: separator character :param chunk: the number of characters before the separator output, mast be in [1, 2, 3, 4, 6]. 0 or None for output without delimiter :param capital: lowercase or uppercase return output str. default lowercase :return: mac address in required format
example: print(mac_4mater(‘ab.bg.55.55.55.53’, delimiter=’.’, chunk=4, capital=False)) ValueError: Invalid mac address ab.bg.55.55.55.53
print(mac_4mater(‘ab.bc.55.55.55.53’, delimiter=’.’, chunk=4)) abbc.5555.5553
print(mac_4mater(‘ab.bc55.55.55bbbbbbbbbbbbbb.53’, delimiter=’:’, chunk=4, capital=False)) ValueError: Invalid mac address ab.bc55.55.55bbbbbbbbbbbbbb.53
print(mac_4mater(‘ABrrrrrrrrrrrr.bc.55.55.55.53’, delimiter=’-’, chunk=2, capital=True)) AB-BC-55-55-55-53
print(mac_4mater(‘AB.bc.55.55.55.53’, delimiter=’:’, chunk=2, capital=True)) AB:BC:55:55:55:53
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mac-4mater-1.0.tar.gz.
File metadata
- Download URL: mac-4mater-1.0.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77bc606ebe03fc20bec622b450a713bcf1d839f7bc89255d3b3082d037b10a5a
|
|
| MD5 |
83f7d076476a85343f8bde9939ecb5a3
|
|
| BLAKE2b-256 |
b81465ddf7832867e5fe219cd9be1273ea664331e0a546f68c53068aa011f0b5
|
File details
Details for the file mac_4mater-1.0-py3-none-any.whl.
File metadata
- Download URL: mac_4mater-1.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e56f3bd2f87b37c3841d92b0a4335fe3e2c988f32ff0e3f913113be86e029b36
|
|
| MD5 |
3b03336ba6293a088001871cedd1f350
|
|
| BLAKE2b-256 |
0ec2087e2906a3254b9f4dce0d08c33553f96a3b2e992cc77f9d21810f30aec0
|