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, GCP, Azure and Digital Ocean hosts.
  • Supports skipping providers identification.
  • Logging integration.
  • Small and extensible.

Usage

>>> from cloud_detect import provider
>>> provider()
'aws'
>>> provider(excluded='aws')
'unknown'

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

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.5.tar.gz (6.0 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.5-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cloud-detect-0.0.5.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.9.0b1+

File hashes

Hashes for cloud-detect-0.0.5.tar.gz
Algorithm Hash digest
SHA256 25b8f8c3933e84a45ef6be0cc8907a6ac4fc50b33ad4b89233b857a63c100819
MD5 dd6ee30f9ee4cc9b6dae7f5479500172
BLAKE2b-256 454ae2836bfd4c868557b344a9b8a46a681ffe357af8668bd214357df72b962f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloud_detect-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.9.0b1+

File hashes

Hashes for cloud_detect-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4c84b854330e0841cac1c3c56e010136b8738f0e6231eb322e4b65bdaa9e85f0
MD5 b9c69a691edd8043d7949be6e52b5254
BLAKE2b-256 c1547faac4519f9628b5f0ebcfe3269e527034f6f8f288b58bb7da76a3afce08

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 Sentry Error logging StatusPage Status page