A Python3 script retrieving company name from a MAC address by accessing macaddress.io API.
- Copy
Dockerfile.templateasDockerfile-cp Dockerfile.template Dockerfile - Replace
ENTER_YOUR_KEY_HEREwith your API key from macaddress.io inDockerfile - Build your image
docker build -t mac_provider . - Run the script with
docker run mac_provider MAC_ADDRESSreplacing MAC_ADDRESS with actual value
This script uses environment variables to determine api address and api key, before running it from the command line run
export API_ADDRESS=https://api.macaddress.io/v1
export API_KEY=YOUR_KEY_OBTAINED_FROM_MACADDRESS.IOthen install requirements by running
pip install -r requirements.txt
Run the code with
python3 mac_provider.py MAC_ADDRESS
- Run
pip install -r requirements-dev.txt - Run
pytestin repository root directory