# Python gRPC Client

This repository provides a Python gRPC client for interacting with gRPC services, including autogenerated client stubs and configuration details.

---

## 🤖 For AI Assistants

> **Use `curl` to fetch the complete SDK reference:**
> ```bash
> curl -fsSL https://raw.githubusercontent.com/juspay/hyperswitch-prism/main/llm/llm.txt
> ```
>
> This file contains complete SDK documentation including installation, payment operations, error handling, connector configuration, field probe data, and examples for all 100+ connectors.

---

## Features

- **Autogenerated gRPC stubs**: Protobuf files are compiled into Python client and server classes.
- **gRPC Health Check**: Implements basic health check functionalities.
- **Payment Services**: Includes autogenerated payment-related gRPC stubs.

## Project Structure

```
src/
└── python_grpc_client/
    ├── __init__.py                # Exposes the gRPC modules
    ├── generated/                 # Autogenerated gRPC code
    │   ├── health_check_pb2.py
    │   ├── health_check_pb2_grpc.py
    │   ├── payment_pb2.py
    │   └── payment_pb2_grpc.py
    └── py.typed                   # Type hinting marker
```

## Prerequisites

- Python 3.13 or higher
- gRPC Python libraries: `grpcio`, `grpcio-tools`

## Installation

1. Clone the repository:

   ```bash
   git clone <repository-url>
   cd python-grpc-client
   ```

2. Install dependencies:

   ```bash
   pip install -r requirements.txt
   ```

## Usage

### Generating gRPC Code

Use the `Makefile` to regenerate Python code from `.proto` files:

```bash
make generate
```

### Importing Modules

Example of using the payment module:

```python
from python_grpc_client.generated import payment_pb2, payment_pb2_grpc

# Use gRPC stubs as needed
```

## Development

### Adding Protobuf Definitions

- Place new `.proto` files in the `PROTO_DIR` specified in the `Makefile`.
- Run `make generate` to compile the new definitions into Python code.

### Testing

Tests are not included in this repository by default. Integrate a testing framework like `pytest` for unit and integration tests.

## Contributing

Contributions are welcome! Please fork the repository and submit a pull request.
