Metadata-Version: 2.5
Name: benzene-gcp
Version: 0.1.0b1
Summary: Benzene Google Cloud Functions host — HTTP + Pub/Sub transport bindings and a Pub/Sub outbound client.
Project-URL: Homepage, https://github.com/daniellepelley/benzene-python
Project-URL: Specification, https://github.com/daniellepelley/Benzene/tree/main/docs/specification
Author: Benzene
License-Expression: MIT
License-File: LICENSE
Keywords: benzene,cloud-functions,gcp,google-cloud,hexagonal,pubsub
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: benzene-core>=0.0.1
Requires-Dist: benzene-http>=0.0.1
Provides-Extra: pubsub
Requires-Dist: google-cloud-pubsub>=2.0; extra == 'pubsub'
Description-Content-Type: text/markdown

# benzene-gcp

Host [Benzene Python](https://github.com/daniellepelley/benzene-python) handlers on **Google Cloud
Functions** — behind an HTTP trigger and a Pub/Sub trigger, with a Pub/Sub outbound client — the
same handlers, no rewrite. Depends on `benzene-core` and `benzene-http`.

```bash
pip install benzene-gcp            # add [pubsub] for the real outbound client
```

```python
from benzene.gcp import GcpFunctionsApp, http_function, pubsub_function

app = GcpFunctionsApp(http_router=router, registry=registry)

# Functions Framework entry points:
orders_http = http_function(app)         # @functions_framework.http
orders_pubsub = pubsub_function(app)     # @functions_framework.cloud_event
```

- **HTTP trigger** — delegates to the `benzene.http` binding (route → topic, status mapping).
- **Pub/Sub trigger** — topic from the `topic` message attribute; one scope per message; a failure
  result is raised so Pub/Sub redelivers.
- **Outbound** — `PubSubMessageSender` implements the `benzene.core.MessageSender` port over
  `google-cloud-pubsub` (optional extra), forwarding headers as message attributes.

Test both triggers in memory with `benzene.gcp.testing` (native event builders + a test host) —
see the runnable `examples/gcp_orders/`. Mirrors .NET's `Benzene.GoogleCloud.Functions.*`, and
contributes the `benzene.gcp` subpackage to the shared `benzene` namespace.
