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, Oracle Cloud and Vultr 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', 'vultr' 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 more cloud providers
  • 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.12.tar.gz (7.4 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.12-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cloud-detect-0.0.12.tar.gz
  • Upload date:
  • Size: 7.4 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.12.tar.gz
Algorithm Hash digest
SHA256 ca34852c1839aa7081ff2c2d423399cb1cbfa119069598eb9a44e1f9a3b7727a
MD5 e99c10bece608eed49b4ef8412b98b23
BLAKE2b-256 cd1458ee89f68393a3552dd05fdced636caaac4af43ca71439d50a6c9f569b05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloud_detect-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 10.9 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 3f3c7bc13c7674f3ee21689c41d78a80df668dca3843508616aaa0f88ae3013e
MD5 ec8131487f523dfeadc54864a2f93770
BLAKE2b-256 a5f3d348738080b19b4518688b60bd750f0f394fc569fd21d1c3b2938ee20c5e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

This release

0.0.12 This release

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page