Skip to main content

Module that determines a host's cloud provider

Project description


PyPI - Python Version PyPI PyPI - License Build Status


cloud-detect is a Python module that determines a host's cloud provider. Highly inspired by the Go based Satellite, cloud-detect uses the same techniques (file systems and provider metadata) to properly identify cloud providers.


  • Supports identification of Alibaba, AWS, Azure, Digital Ocean, GCP, Oracle Cloud and Vultr hosts.
  • Fast and supports asyncio
  • Logging integration.
  • Small and extensible.


>>> from cloud_detect import provider
>>> provider()

>>> provider() # when tested in local/non-supported cloud env

Right now the only possible responses are: 'alibaba', 'aws', 'azure', 'do', 'gcp', 'oci', 'vultr' or 'unknown'

You can get the list of supported providers using

>>> from cloud_detect import SUPPORTED_PROVIDERS


Via pip:

pip install cloud-detect


Termination-handler uses cloud-detect to keep the handling of termination notices on spot/preemptible instances cloud-agnostic, making easier to operate the same tooling in various distinct environments.

How to contribute

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
  2. Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
  3. Write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug me until it gets merged and published.

Some things that would be great to have:

  • Add more cloud providers
  • Add codecov

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

cloud-detect-0.0.13.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

cloud_detect-0.0.13-py3-none-any.whl (11.1 kB view hashes)

Uploaded Python 3

Supported by

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