ami
(Am I...?) is a collection of simple functions that allow your Python code to detect and adapt to the environment in which it is being run.
import ami
# Am I using Linux?
ami.using_linux()
# On an ARM CPU?
ami.using_arm_cpu()
# Am I running a virtual environment?
ami.using_virtualenv()
# Am I running in a container?
ami.using_container()
# Am I connected to the internet?
ami.online()
# Am I on battery power?
ami.using_battery_power()
Install the latest stable version of ami from PyPI:
pip install ami
If you'd like to add ami to a project managed with uv:
uv add ami
- Python 3.11 or higher
This project is licensed under the MIT License - see the LICENSE file for details.