Skip to main content

TrB proto — Python

Сгенерированные protobuf/gRPC stubs для Python-сервисов TrB.

Установка

pip install trb-proto

Зафиксировать версию (как в Docker-сервисе indicators):

pip install trb-proto==1.0.34

Пакет публикуется на PyPI при релизе (make rel).

Пример: gRPC-клиент

import grpc
from indicators import indicators_pb2 as pb
from indicators import indicators_pb2_grpc

channel = grpc.insecure_channel("localhost:9093")
stub = indicators_pb2_grpc.IndicatorsStub(channel)

supported = stub.ListSupported(pb.ListSupportedRequest())
print([i.name for i in supported.indicators])

Пример: gRPC-сервер

from concurrent import futures

import grpc
from indicators import indicators_pb2_grpc

class IndicatorsServicer(indicators_pb2_grpc.IndicatorsServicer):
    ...

server = grpc.server(futures.ThreadPoolExecutor(max_workers=4))
indicators_pb2_grpc.add_IndicatorsServicer_to_server(IndicatorsServicer(), server)
server.add_insecure_port("[::]:9093")
server.start()
server.wait_for_termination()

Docker (TrB_backend)

ARG TRB_PROTO_VERSION=1.0.34
RUN pip install "trb-proto==${TRB_PROTO_VERSION}"

В .env:

TRB_PROTO_VERSION=1.0.34
TRB_PROTO_SOURCE=pypi

До первой публикации на PyPI: TRB_PROTO_SOURCE=git (установка из GitHub-тега).

Локальная разработка

# editable install из соседнего репозитория
pip install -e ../TrB_proto

# после изменения proto
cd TrB_proto && make gene

Trusted Publisher (PyPI)

Pending publisher до первого релиза, если проекта ещё нет:

Поле Значение
PyPI project name trb-proto
Owner Mar1eena
Repository TrB_proto
Workflow name release.yml
Environment name (пусто)

GitHub Actions workflow: .github/workflows/release.yml, action pypa/gh-action-pypi-publish@v1.14.2.

Зависимости пакета

  • protobuf>=4.25.0
  • grpcio>=1.60.0

← Корневой README

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trb_proto-1.0.42.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

trb_proto-1.0.42-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file trb_proto-1.0.42.tar.gz.

File metadata

  • Download URL: trb_proto-1.0.42.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trb_proto-1.0.42.tar.gz
Algorithm Hash digest
SHA256 4a891ff4c58fafc47a30ebb95c2763f72ef9f10800b93a28deb8a0ed5a5f6b79
MD5 7a09e40061e45e403a64f5400360dd75
BLAKE2b-256 cb0a29356ff79ff3dd7a654e2f49f93d63bdfa6b30baad0b7557b96629ddd9d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for trb_proto-1.0.42.tar.gz:

Publisher: release.yml on Mar1eena/TrB_proto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trb_proto-1.0.42-py3-none-any.whl.

File metadata

  • Download URL: trb_proto-1.0.42-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trb_proto-1.0.42-py3-none-any.whl
Algorithm Hash digest
SHA256 c83f2d9f41e8fe5eaa8eca5d8834df960ae1f3d5d8a85388e98269c571a30848
MD5 84d4e840be4ba9a22df10e5ab79f511c
BLAKE2b-256 4e519cfeb5fa437c0686891036d65a30b21d9c4aa73b44091ce6589fdba4763f

See more details on using hashes here.

Provenance

The following attestation bundles were made for trb_proto-1.0.42-py3-none-any.whl:

Publisher: release.yml on Mar1eena/TrB_proto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.0.44

2 files

1.0.43

2 files

This release

1.0.42 This release

2 files

1.0.41

2 files

1.0.40

2 files

1.0.39

2 files

1.0.38

2 files

1.0.37

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