Coverage for src\ingress_recipient\__init__.py: 100%

1"""ingress-recipient - Python SDK for receiving data from vikdata ingress cores.

2

3 This SDK provides server-side dependencies and types for services that

4 receive processed data FROM ingress cores after the 5-stage pipeline:

5 1. Auth - Validate API key/JWT

6 2. Validate - JSON Schema validation

7 3. Transform - Field mapping, enrichment

8 4. Route - Destination selection

9 5. Dispatch - Send to recipients

10

11 Example:

12 ```python

13 from ingress_recipient import RecipientData, validate_recipient_data

14 from fastapi import APIRouter, Depends

15

16 router = APIRouter()

17

18 @router.post("/destinations/telemetry")

19 async def receive_telemetry(

20 data: RecipientData = Depends(validate_recipient_data),

21 ):

22 # Process data...

23 await save_telemetry(data)

24 return {"status": "accepted"}

25 ```

26"""

27

28 from .fastapi import ValidatedRecipientData, validate_recipient_data

29 from .types import RecipientData, RecipientMetadata, RecipientResponse

30 from .validation import safe_validate_recipient_data

31 from .validation import validate_recipient_data as validate_data

32

33 __version__ = "1.0.0"

34

35 __all__ = [

36 # Types

37 "RecipientData",

38 "RecipientMetadata",

39 "RecipientResponse",

40 # FastAPI dependency

41 "validate_recipient_data",

42 "ValidatedRecipientData",

43 # Validation utilities

44 "validate_data",

45 "safe_validate_recipient_data",

46]