25 lines
634 B
Python
25 lines
634 B
Python
from collections.abc import Mapping
|
|
from enum import Enum
|
|
from typing import Any
|
|
|
|
class ContentType(str, Enum):
|
|
HTML = "text/html"
|
|
PDF = "application/pdf"
|
|
XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
CSV = "text/csv"
|
|
JSON = "application/json"
|
|
XML = "application/xml"
|
|
|
|
class Content:
|
|
raw: bytes
|
|
source: str
|
|
content_type: ContentType | None
|
|
metadata: Mapping[str, Any] | None
|
|
def __init__(
|
|
self,
|
|
raw: bytes,
|
|
source: str,
|
|
content_type: ContentType | None = ...,
|
|
metadata: Mapping[str, Any] | None = ...,
|
|
) -> None: ...
|