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

Metadata

Release files for cloud-detect 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloud-detect 0.0.9
File Size Uploaded
cloud-detect-0.0.9.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cloud-detect 0.0.9
File Interpreter ABI Platform
cloud_detect-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / cloud-detect-0.0.9.tar.gz

Download URL cloud-detect-0.0.9.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fd4fb6e9aa87c7d1d148abf180b7a8d56918d44e471c4cef73b0f7ee2ca81514
BLAKE2b-256 checksum
How to use checksums
3027229e2ed0cb9941cf03f176bf1a4328c2f714c3927dbf9e6099121313f9c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

Release files / cloud_detect-0.0.9-py3-none-any.whl

Download URL cloud_detect-0.0.9-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc5a0216cfdf56715076fcfcf7e5c505af6a1e40f209142db394b127a3e70f37
BLAKE2b-256 checksum
How to use checksums
94736869d99777139f65316028f4e1950404149db6762baef5aa2ee877963093
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

Release history Release notifications | RSS feed

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

This release

0.0.9 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release 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