Skip to main content

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

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mac-4mater-1.0.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mac_4mater-1.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

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

Hashes for mac-4mater-1.0.tar.gz
Algorithm Hash digest
SHA256 77bc606ebe03fc20bec622b450a713bcf1d839f7bc89255d3b3082d037b10a5a
MD5 83f7d076476a85343f8bde9939ecb5a3
BLAKE2b-256 b81465ddf7832867e5fe219cd9be1273ea664331e0a546f68c53068aa011f0b5

See more details on using hashes here.

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

Hashes for mac_4mater-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e56f3bd2f87b37c3841d92b0a4335fe3e2c988f32ff0e3f913113be86e029b36
MD5 3b03336ba6293a088001871cedd1f350
BLAKE2b-256 0ec2087e2906a3254b9f4dce0d08c33553f96a3b2e992cc77f9d21810f30aec0

See more details on using hashes here.

Supported by

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