Skip to main content

stub files and type containers for proxmoxer

Project description

proxmoxer-stubs

Type annotations for data obtained by proxmoxer.ProxmoxAPI calls.

Usage

import typing
import proxmoxer

api = proxmoxer.ProxmoxAPI()

typing.reveal_type(api.cluster.replication("some-id").get())
replication.py:6: note: Revealed type is "TypedDict('proxmoxer_types.v9.core.ProxmoxAPI.Cluster.Replication.Id._Get.TypedDict', {'comment'?: builtins.str, 'digest'?: builtins.str, 'disable'?: builtins.bool, 'guest': builtins.int, 'id': builtins.str, 'jobnum': builtins.int, 'rate'?: builtins.float, 'remove_job'?: builtins.str, 'schedule'?: builtins.str, 'source'?: builtins.str, 'target': builtins.str, 'type': builtins.str})"
Success: no issues found in 1 source file
reveal_type(proxmoxer.ProxmoxAPI().cluster.firewall.groups("foo")(42).get().get("log"))
log.py:4: note: Revealed type is "Literal['emerg'] | Literal['alert'] | Literal['crit'] | Literal['err'] | Literal['warning'] | Literal['notice'] | Literal['info'] | Literal['debug'] | Literal['nolog'] | None"
Success: no issues found in 1 source file

For a legacy REST-API:

import typing

if typing.TYPE_CHECKING:
    import proxmoxer_types.v8 as proxmoxer
else:
    import proxmoxer

api = proxmoxer.ProxmoxAPI()

typing.reveal_type(api.cluster.replication("some-id").get())
legacy.py:10: note: Revealed type is "builtins.dict[Any, Any]"
Success: no issues found in 1 source file

Caveats

proxmoxer.ProxmoxAPI has several ways of expressing the same endpoint due to its magic implementation.

>>> api.cluster.replication("some-id")
ProxmoxResource (/cluster/replication/some-id)
>>>
>>> api("cluster/replication/some-id")
ProxmoxResource (/cluster/replication/some-id)
>>>
>>> api("cluster")("replication")("some-id")
ProxmoxResource (/cluster/replication/some-id)

Only the first form will produce useful typing insights.

Parameters to get, post, put, delete are currently not individually annotated.

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

proxmoxer_stubs-0.1.0.tar.gz (118.5 kB view details)

Uploaded Source

Built Distribution

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

proxmoxer_stubs-0.1.0-py3-none-any.whl (129.8 kB view details)

Uploaded Python 3

File details

Details for the file proxmoxer_stubs-0.1.0.tar.gz.

File metadata

  • Download URL: proxmoxer_stubs-0.1.0.tar.gz
  • Upload date:
  • Size: 118.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for proxmoxer_stubs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d6566d5531969bbc94782e5bf17bf27f948abc84c5d2d0a356e253a38724cef9
MD5 c724260e7f8180c1e3e4dad3e906521b
BLAKE2b-256 2477f7161f2f53a7cdb8de8c3e3c6deb015d79edd554930fabc5031ab677f176

See more details on using hashes here.

File details

Details for the file proxmoxer_stubs-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for proxmoxer_stubs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c2b68c399d1cae780dbf2d0d49088456b4123fb921acdc8b98d97ab74ddbe12
MD5 a116393156cb6b853a44993f6e6b1c0e
BLAKE2b-256 99e134eff21d7f64c6759c98588bb7aee15f1afa47abe609a1324d0d6629aea4

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