unstructured-platform-plugins 0.1.1.dev1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/PKG-INFO +1 -1
- unstructured_platform_plugins-0.1.2/unstructured_platform_plugins/__version__.py +1 -0
- unstructured_platform_plugins-0.1.2/unstructured_platform_plugins/etl_uvicorn/__init__.py +0 -0
- unstructured_platform_plugins-0.1.1.dev1/unstructured_platform_plugins/__init__.py +0 -13
- unstructured_platform_plugins-0.1.1.dev1/unstructured_platform_plugins/__version__.py +0 -1
- unstructured_platform_plugins-0.1.1.dev1/unstructured_platform_plugins/invocation_scope.py +0 -63
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/.gitignore +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/LICENSE.md +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/README.md +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/pyproject.toml +0 -0
- {unstructured_platform_plugins-0.1.1.dev1/unstructured_platform_plugins/etl_uvicorn → unstructured_platform_plugins-0.1.2/unstructured_platform_plugins}/__init__.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/etl_uvicorn/api_generator.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/etl_uvicorn/main.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/etl_uvicorn/otel.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/etl_uvicorn/utils.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/generated/__init__.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/generated/error_audience_v1.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/generated/invocation_context_v1.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/invocation_context.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/invocation_settings.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/schema/__init__.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/schema/filedata_meta.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/schema/json_schema.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/schema/model.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/schema/usage.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/schema/utils.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/type_hints.py +0 -0
- {unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/unstructured_platform_plugins/validate_api.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: unstructured_platform_plugins
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Wrapper to convert arbitrary code into a uvicorn/fastapi implementation for Unstructured Platform
|
|
5
5
|
License-File: LICENSE.md
|
|
6
6
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.2" # pragma: no cover
|
|
File without changes
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from unstructured_platform_plugins.invocation_scope import (
|
|
2
|
-
InvocationIdentity,
|
|
3
|
-
current_invocation_identity,
|
|
4
|
-
invocation_scratch_dir,
|
|
5
|
-
)
|
|
6
|
-
from unstructured_platform_plugins.invocation_settings import current_invocation_context
|
|
7
|
-
|
|
8
|
-
__all__ = [
|
|
9
|
-
"InvocationIdentity",
|
|
10
|
-
"current_invocation_context",
|
|
11
|
-
"current_invocation_identity",
|
|
12
|
-
"invocation_scratch_dir",
|
|
13
|
-
]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.1.dev1" # pragma: no cover
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"""Identity and filesystem scope for the current invocation."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import hashlib
|
|
6
|
-
import os
|
|
7
|
-
import re
|
|
8
|
-
from dataclasses import dataclass, fields
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
from uuid import uuid4
|
|
11
|
-
|
|
12
|
-
from unstructured_platform_plugins.invocation_settings import current_invocation_context
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@dataclass(frozen=True)
|
|
16
|
-
class InvocationIdentity:
|
|
17
|
-
job_id: str | None
|
|
18
|
-
tenant_id: str | None
|
|
19
|
-
org_id: str | None
|
|
20
|
-
workflow_id: str | None
|
|
21
|
-
attribution_id: str | None
|
|
22
|
-
dag_node_id: str | None
|
|
23
|
-
dag_node_type: str | None
|
|
24
|
-
dag_node_subtype: str | None
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def current_invocation_identity() -> InvocationIdentity:
|
|
28
|
-
"""Read identity from the bound context, or the environment when no context is bound."""
|
|
29
|
-
context = current_invocation_context()
|
|
30
|
-
values = {}
|
|
31
|
-
for field in fields(InvocationIdentity):
|
|
32
|
-
values[field.name] = (
|
|
33
|
-
getattr(context, field.name, None)
|
|
34
|
-
if context is not None
|
|
35
|
-
else os.getenv(field.name.upper())
|
|
36
|
-
)
|
|
37
|
-
return InvocationIdentity(**values)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def _segment(value: str | None) -> str:
|
|
41
|
-
if not value:
|
|
42
|
-
return "unknown"
|
|
43
|
-
safe = re.sub(r"[^a-zA-Z0-9_.-]", "_", value)
|
|
44
|
-
if safe in {".", ".."} or safe != value or len(safe) > 96:
|
|
45
|
-
digest = hashlib.sha256(value.encode()).hexdigest()[:16]
|
|
46
|
-
safe = f"{safe[:79].strip('.') or 'unknown'}-{digest}"
|
|
47
|
-
return safe
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def invocation_scratch_dir(root: str | os.PathLike[str], *, create: bool = True) -> Path:
|
|
51
|
-
"""Return an invocation directory, or the unchanged root when no context is bound."""
|
|
52
|
-
path = Path(root)
|
|
53
|
-
context = current_invocation_context()
|
|
54
|
-
if context is not None:
|
|
55
|
-
identity = current_invocation_identity()
|
|
56
|
-
invocation_id = context.invocation_id
|
|
57
|
-
if not invocation_id and context.record_ids is None and context.invocation_ids is None:
|
|
58
|
-
invocation_id = context.record_id
|
|
59
|
-
path = path / _segment(identity.job_id) / _segment(identity.dag_node_id)
|
|
60
|
-
path = path / _segment(invocation_id or uuid4().hex)
|
|
61
|
-
if create:
|
|
62
|
-
path.mkdir(parents=True, exist_ok=True)
|
|
63
|
-
return path
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unstructured_platform_plugins-0.1.1.dev1 → unstructured_platform_plugins-0.1.2}/pyproject.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|