Skip to main content

LARA Django Organisms Store - gRPC API

This directory contains the gRPC interface for the lara-django-organisms-store application, providing a high-performance API for managing organism instances, baskets, orders, and wishlists in the LARA database.

Overview

The gRPC API provides remote procedure call access to the LARA Django Organisms Store service with support for multiple programming languages through protocol buffer definitions. It also contains a high-level Python interface for easy integration with Python applications.

Package: lara-django-organisms-store-grpc
Python Requirement: 3.13.*

Project Structure

api/grpc/
├── go/                          # Go gRPC client code
├── connect-es/                  # Connect-ES client code
├── connectrpc-es/               # ConnectRPC ES implementations
├── grpc-web/                    # gRPC-Web client code
├── gen/                         # Generated code from protobuf definitions
├── dist/                        # Distribution packages
├── pyproject.toml               # Python project configuration
└── python/                      # Python API module root
    └── lara_django_organisms_store_grpc/
        ├── lara_django_organisms_store_data_model.py   # Data model definitions
        ├── lara_django_organisms_store_interfaces.py   # High-level interface
        └── v1/
            └── *_pb2.py         # Generated protocol buffer code

## Installation

### Using uv (Recommended)

Install the `lara-django-organisms-store-grpc` package with uv for faster dependency resolution:

```bash
cd api/grpc
uv pip install .

Or with development dependencies:

uv pip install -e ".[dev]"

For development, install with editable mode and all dependency groups:

cd api/grpc
uv sync --all-groups

Using pip

Alternatively, install with pip:

pip install lara-django-organisms-store-grpc

Or from the local directory:

cd api/grpc
pip install .

Dependencies

  • Runtime: grpcio>=1.73.0
  • Development:
    • grpcio-tools>=1.73.0
    • pytest>=8,<9
    • pytest-cov>=6,<7
    • pytest-asyncio

Code Generation

Protocol buffer definitions are located in ../proto/lara_django_organisms_store_grpc/. To regenerate gRPC code from protobuf definitions, e.g. in case you changed the .proto file, use the Buf CLI:

cd api
buf generate

This will generate code for multiple targets as configured in buf.gen.yaml:

  • Python
  • Go
  • JavaScript/TypeScript (Connect-ES, ConnectRPC, gRPC-Web)

Running Tests

The test suite is located in api/tests/ and includes tests for all major entities:

Using uv

# From the api/grpc directory
uv run pytest api/tests/

# With coverage
uv run pytest api/tests/ --cov

Using pytest directly

# From the api/grpc directory
pytest api/tests/

# With coverage
pytest api/tests/ --cov

Test Files

  • test_lara_django_organisms_store_ExtraData_grpc.py - Extra data tests
  • test_lara_django_organisms_store_OrganismBasket_grpc.py - Organism basket tests
  • test_lara_django_organisms_store_OrganismInstance_grpc.py - Organism instance tests
  • test_lara_django_organisms_store_OrganismInstancesSubset_grpc.py - Organism instances subset tests
  • test_lara_django_organisms_store_OrganismLocalStore_grpc.py - Organism local store tests
  • test_lara_django_organisms_store_OrganismOrder_grpc.py - Organism order tests
  • test_lara_django_organisms_store_OrganismOrderItem_grpc.py - Organism order item tests
  • test_lara_django_organisms_store_OrganismWishlist_grpc.py - Organism wishlist tests

Usage Examples

Python Client

import grpc
from lara_django_organisms_store_grpc import organism_instance_pb2, organism_instance_pb2_grpc

# Create a channel to the gRPC server
channel = grpc.insecure_channel('localhost:50051')

# Create a stub (client)
stub = organism_instance_pb2_grpc.OrganismInstanceServiceStub(channel)

# Make a request
response = stub.GetOrganismInstance(organism_instance_pb2.GetOrganismInstanceRequest(id=1))
print(response)

# Don't forget to close the channel when done
channel.close()

For more comprehensive examples, see the demo clients in ../../demo_clients/.

Development

Building

The project uses the uv_build backend for building:

# Using uv (recommended)
uv build

# Or using Python build module
python -m build

Working with uv

This project is configured for uv with the following features:

  • Build Backend: uv_build>=0.9.0,<=0.10.0
  • Module Root: python/ (all Python gRPC code should be placed here)
  • Dependency Groups: Development dependencies are organized in groups

Common uv commands:

# Sync dependencies
uv sync

# Sync with development dependencies
uv sync --all-groups

# Add a new dependency
uv add package-name

# Add a development dependency
uv add --dev package-name

# Run a command in the uv environment
uv run python script.py

# Build the package
uv build

Module Root

The Python module root is configured at python/, meaning all Python gRPC code should be placed in that directory.

Documentation

Protocol Buffer Linting

The project uses Buf for linting and breaking change detection. Configuration is in ../buf.yaml:

  • Follows DEFAULT lint rules with specific exceptions
  • Breaking change detection enabled
  • Ignores certain Google type definitions

Contributing

Contributions are welcome! Please see the CONTRIBUTING.md file in the project root for guidelines.

When modifying protobuf definitions:

  1. Edit .proto files in ../proto/lara_django_organisms_store_grpc/
  2. Run buf generate to regenerate code
  3. Update tests as needed
  4. Run the test suite to ensure compatibility

License

See the LICENSE file in the project root.

Metadata

Release files for lara-django-organisms-store-grpc 0.2.113

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

Source distribution (sdist)

Source distribution for lara-django-organisms-store-grpc 0.2.113
File Size Uploaded Provenance Actions
lara_django_organisms_store_grpc-0.2.113.tar.gz 34.9 kB Without provenance Details for lara_django_organisms_store_grpc-0.2.113.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lara-django-organisms-store-grpc 0.2.113
File Interpreter ABI Platform Actions
lara_django_organisms_store_grpc-0.2.113-py3-none-any.whl Python 3 none any Details for lara_django_organisms_store_grpc-0.2.113-py3-none-any.whl

Total release size: 71.6 kB

Release files / lara_django_organisms_store_grpc-0.2.113.tar.gz

Download URL lara_django_organisms_store_grpc-0.2.113.tar.gz
Size 34.9 kB
Tags Source
SHA-256 checksum
How to use checksums
61e0b031696760b4fc8e6bb880e943cfee449d135f2361a05a0ff5987baff5be
BLAKE2b-256 checksum
How to use checksums
48f8c1d16312129798053d69af35a953843a4393bcaaf4b339db26ac4d3a07e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / lara_django_organisms_store_grpc-0.2.113-py3-none-any.whl

Download URL lara_django_organisms_store_grpc-0.2.113-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c87721157d8b9230602dfb7afe2b62611ef4ae510c0b8ee9cd16d6f64104ccb
BLAKE2b-256 checksum
How to use checksums
78c2c8f583318ecf117eeba1412a62fb90eae8f00393e74a89b634ec30eaf866
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.13.12

Security for lara-django-organisms-store-grpc 0.2.113

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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