cosmpy.common package — cosmpy documentation

# cosmpy.common package

## Submodules

## cosmpy.common.rest_client module

Implementation of REST api client.

class cosmpy.common.rest_client.RestClient(rest_address: str)

  Bases: `object`

  REST api client.

  get(url_base_path: str, request: Optional[google.protobuf.message.Message] = None, used_params: Optional[List[str]] = None) → bytes

    Send a GET request

    Parameters

      - url_base_path – URL base path

      - request – Protobuf coded request

      - used_params – Parameters to be removed from request after converting it to dict

    Raises

      RuntimeError – if response code is not 200

    Returns

      Content of response

  post(url_base_path: str, request: google.protobuf.message.Message) → bytes

    Send a POST request

    Parameters

      - url_base_path – URL base path

      - request – Protobuf coded request

    Raises

      RuntimeError – if response code is not 200

    Returns

      Content of response

## cosmpy.common.types module

Common types

## Module contents

This package contains modules used across other modules in cosm.