Skip to main content

cloud-detect

PyPI - Python Version PyPI PyPI - License Build Status

About

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.

Features

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

Usage

>>> from cloud_detect import provider
>>> provider()
'aws'

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

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

You can get the list of supported providers using

>>> from cloud_detect import SUPPORTED_PROVIDERS

Installation

Via pip:

pip install cloud-detect

Examples

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 cloud providers (Vultr)
  • Add codecov

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.11.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

cloud_detect-0.0.11-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file cloud-detect-0.0.11.tar.gz.

File metadata

  • Download URL: cloud-detect-0.0.11.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for cloud-detect-0.0.11.tar.gz
Algorithm Hash digest
SHA256 55df2090089de4842d4c2ed83d78b1ff3481e1496a82776215d36bd1cf653b35
MD5 8d0647118696c8fb51daa57d916739e6
BLAKE2b-256 26cae0812492e6b1d5053faa616eb70000480702346dcebcadde015264fa0a51

See more details on using hashes here.

File details

Details for the file cloud_detect-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: cloud_detect-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for cloud_detect-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 823a4bab5e9bd99e7b4af8f35c344b4a3c39d37dcc58830c4eb095b80dc2af8f
MD5 e0580e53f648500ec2d74b8beed074c3
BLAKE2b-256 eb3b847bf437b3f80bc73fe56e0f5ad9eb044d343f317ac425961771714f89c7

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