Skip to main content

Simple functions to detect various runtime environments

Project description

ami

Development Status PyPI - Python Version PyPI - License PyPI - Version Codecov test coverage

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.

Examples

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()

Installation

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

Requirements

  • Python 3.11 or higher

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

ami-0.2.0.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

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

ami-0.2.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file ami-0.2.0.tar.gz.

File metadata

  • Download URL: ami-0.2.0.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ami-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3dfc754e13a5cd2484ec23f8f7ec4050dfb9c244d5e02b26737fe9e9befed2a2
MD5 735bfd39476ced1a5f0e4ba7d3705b3c
BLAKE2b-256 16197015be4c5471f0939dfda2cf22c4763e5580351c0eafdc38f70dc06b235c

See more details on using hashes here.

File details

Details for the file ami-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ami-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ami-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83b12308f45bf780a676dbeab132b448227a93a5ac7168cff8ab3899c7a23d81
MD5 0ee72be37c3032ae2bdb5b1f6d021db7
BLAKE2b-256 26a8c5571dba5c790e325fb271a8ed66ad6eef9c02f25c352aa25e716f4c5484

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