Skip to main content

Proton Lib (Python)

Cliente Python da plataforma Proton. A automação usa esta biblioteca para reportar ao Proton o progresso, o status, os logs, os parâmetros e os recursos de cada execução.

Distribuição: protoncloud-sdk. Import: proton.

from proton.proton_automation import start_component, end_component, update_run_status
from proton.run_status import RunStatus

Instalação

pip install protoncloud-sdk

ou, com uv:

uv add protoncloud-sdk

Configuração

Host e token são resolvidos nesta ordem — a mesma convenção das bibliotecas Java do Proton:

  1. Variável de ambiente — PROTON_HOST, PROTON_TOKEN
  2. proton.ini no diretório de execução

Quando a automação roda pelo Proton Runner, ele injeta PROTON_HOST e PROTON_TOKEN no processo, apontando para o servidor de onde a execução nasceu. É isso que permite o mesmo projeto rodar em qualquer ambiente sem editar arquivo — e sem guardar token no repositório.

O arquivo continua válido e é a única fonte quando se roda a automação fora do runner:

[server]
hostname = https://app.protoncloud.com.br/api
token = <token>

[reports]
video_record = false
video_upload = true

O token pode vir com ou sem o prefixo Bearer ; a biblioteca normaliza e nunca o duplica.

Não versione o proton.ini com o token preenchido: prefira deixá-lo fora do controle de versão e deixar o runner fornecer as credenciais.

Fixando o ambiente do projeto

Para um teste apontado a outro servidor, ou um projeto que precise ignorar o que o runner injeta:

[server]
config_precedence = file

Sem isso, quando o valor injetado difere do arquivo, a biblioteca imprime uma linha dizendo qual venceu. O valor do token nunca é impresso, porque a saída da automação sobe como log da execução no Proton.

Contexto da execução

variável origem uso
idDatasetRun runner identifica a execução; sem ela a biblioteca fica inerte (is_proton_execution() é False)
PROTON_HOST runner ou proton.ini base da API
PROTON_TOKEN runner ou proton.ini autenticação
idRunProgress definida pela própria biblioteca em start_component() componente em andamento

Fora de uma execução do Proton, is_proton_execution() é False e as chamadas viram no-op — o mesmo teste roda localmente sem falar com o servidor.

Migrando de uma cópia local da pasta proton/

Projetos que carregam esta biblioteca como uma pasta proton/ copiada migram em dois passos:

  1. adicione protoncloud-sdk às dependências;
  2. apague a pasta proton/ do projeto.

O segundo passo não é opcional: a pasta local tem precedência sobre o pacote instalado, e enquanto ela existir o projeto continua executando a cópia antiga.

Metadata

Release files for protoncloud-sdk 5.0.0

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

Source distribution (sdist)

Source distribution for protoncloud-sdk 5.0.0
File Size Uploaded
protoncloud_sdk-5.0.0.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for protoncloud-sdk 5.0.0
File Interpreter ABI Platform
protoncloud_sdk-5.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.1 kB

Release files / protoncloud_sdk-5.0.0.tar.gz

Download URL protoncloud_sdk-5.0.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2921ab765dba2210c8edc5368a23814434f38ca9276ff768325833f46f9d60d8
BLAKE2b-256 checksum
How to use checksums
b12b254cced8ee64271b44f9ce1913a3841cf3604542289bf68171108935977b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / protoncloud_sdk-5.0.0-py3-none-any.whl

Download URL protoncloud_sdk-5.0.0-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a92e13e002508fca83660ae20b8fe9f5c0962ecb54f320dad2c18928c3b705e
BLAKE2b-256 checksum
How to use checksums
b7ba79c338c3c8b082e9996dc78f7053ad4543d48fa1921ae0b5164d2ebb8c31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

5.2.1

2 release files

5.2.0

2 release files

5.1.0

2 release files

This release

5.0.0 This release

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