contextbase-plugin-clickup 0.2.4__py3-none-any.whl

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.
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.3
2
+ Name: contextbase-plugin-clickup
3
+ Version: 0.2.4
4
+ Summary: ClickUp API plugin for ContextBase (PyAirbyte-backed)
5
+ Author: Alizain Feerasta
6
+ Author-email: Alizain Feerasta <alizain.feerasta@gmail.com>
7
+ Requires-Dist: contextbase-shared-plugins==0.2.4
8
+ Requires-Dist: dagster==1.12.14
9
+ Requires-Python: >=3.14, <3.15
@@ -0,0 +1,9 @@
1
+ plugin_clickup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ plugin_clickup/binding_config.py,sha256=tULa3aZPdYnJvyQ5OcpdnUGc-3oc_7rWeb7HQWevNEQ,233
3
+ plugin_clickup/component.py,sha256=boMlujICdzrAwKHEAICNE7mJPro3m10vYHH6RpUM4Ag,3432
4
+ plugin_clickup/defs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ plugin_clickup/defs/defs.yaml,sha256=Rmwkhi_wl8pcClbmmjmnw3m6k5QVEZmCHeNc_APMo0Q,52
6
+ plugin_clickup/plugin.json,sha256=egIxQlufSOZYFIkSl1XBoQRiYDdreuizMssKUjFP9n4,83
7
+ contextbase_plugin_clickup-0.2.4.dist-info/WHEEL,sha256=i9aSRDivn5iP9LaR1BLQX2GNAuriQWPsFwbbWygTX2k,81
8
+ contextbase_plugin_clickup-0.2.4.dist-info/METADATA,sha256=XCTe8Zmj22_nU0sPHyNLGhMwiEAmc25UY4CjzDPYd0Q,330
9
+ contextbase_plugin_clickup-0.2.4.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.11.15
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
File without changes
@@ -0,0 +1,9 @@
1
+ from __future__ import annotations
2
+
3
+ from pydantic import StrictBool
4
+
5
+ from shared_plugins.bindings import BaseBindingConfigModel
6
+
7
+
8
+ class ClickupBindingConfig(BaseBindingConfigModel):
9
+ include_closed_tasks: StrictBool | None = None
@@ -0,0 +1,100 @@
1
+ import dagster as dg
2
+ from dagster import AssetExecutionContext
3
+ from shared_plugins.automation import non_overlapping_automation_condition
4
+ from shared_plugins.bindings import (
5
+ parse_binding_config,
6
+ require_api_key,
7
+ )
8
+ from shared_plugins.control_plane import ControlPlaneClient
9
+ from shared_plugins.dlt import resolve_partition_binding
10
+ from shared_plugins.naming import (
11
+ dagster_airbyte_sync_asset_key,
12
+ dagster_asset_group_name,
13
+ dagster_asset_tags,
14
+ dagster_partition_def_name,
15
+ dagster_pool_name,
16
+ plugin_id_from_module,
17
+ )
18
+ from shared_plugins.pyairbyte import (
19
+ build_pyairbyte_source,
20
+ require_pyairbyte_selected_stream_names,
21
+ run_pyairbyte_sync,
22
+ )
23
+ from shared_types.api_key_auth import ApiKeyAuth
24
+
25
+ from .binding_config import ClickupBindingConfig
26
+
27
+ PLUGIN_ID = plugin_id_from_module(__file__)
28
+ DOCKER_IMAGE = "airbyte/source-clickup-api:0.3.45"
29
+ SOURCE_UPDATED_AT_FIELDS = {
30
+ "task": "date_updated",
31
+ }
32
+
33
+
34
+ def _build_connector_config(
35
+ cfg: ClickupBindingConfig,
36
+ auth: ApiKeyAuth,
37
+ ) -> dict[str, object]:
38
+ return {
39
+ **cfg.model_dump(mode="json", exclude_none=True),
40
+ "api_token": auth.api_key,
41
+ }
42
+
43
+
44
+ class ClickupSyncComponent(dg.Component):
45
+ def build_defs(self, context: dg.ComponentLoadContext) -> dg.Definitions:
46
+ partitions_def = dg.DynamicPartitionsDefinition(
47
+ name=dagster_partition_def_name(PLUGIN_ID)
48
+ )
49
+
50
+ @dg.asset(
51
+ key=dagster_airbyte_sync_asset_key(PLUGIN_ID),
52
+ group_name=dagster_asset_group_name(PLUGIN_ID),
53
+ tags=dagster_asset_tags(PLUGIN_ID),
54
+ automation_condition=non_overlapping_automation_condition(
55
+ dg.AutomationCondition.on_missing()
56
+ | dg.AutomationCondition.on_cron("*/15 * * * *")
57
+ ),
58
+ partitions_def=partitions_def,
59
+ pool=dagster_pool_name(PLUGIN_ID),
60
+ )
61
+ def clickup_sync_asset(
62
+ context: AssetExecutionContext,
63
+ control_plane: dg.ResourceParam[ControlPlaneClient],
64
+ ):
65
+ binding = resolve_partition_binding(
66
+ context=context,
67
+ control_plane=control_plane,
68
+ plugin_id=PLUGIN_ID,
69
+ )
70
+ binding_id = str(binding.binding_id)
71
+ cfg = parse_binding_config(binding, ClickupBindingConfig)
72
+ auth = require_api_key(binding)
73
+ selected_stream_names = require_pyairbyte_selected_stream_names(binding)
74
+
75
+ connector_config = _build_connector_config(cfg, auth)
76
+ source = build_pyairbyte_source(
77
+ docker_image=DOCKER_IMAGE,
78
+ connector_config=connector_config,
79
+ )
80
+
81
+ return run_pyairbyte_sync(
82
+ context=context,
83
+ plugin_id=PLUGIN_ID,
84
+ binding_id=binding_id,
85
+ selected_stream_names=selected_stream_names,
86
+ source_updated_at_fields=SOURCE_UPDATED_AT_FIELDS,
87
+ source=source,
88
+ )
89
+
90
+ automation_sensor = dg.AutomationConditionSensorDefinition(
91
+ name="clickup_automation_sensor",
92
+ target=dg.AssetSelection.assets(clickup_sync_asset),
93
+ default_status=dg.DefaultSensorStatus.RUNNING,
94
+ minimum_interval_seconds=30,
95
+ )
96
+
97
+ return dg.Definitions(
98
+ assets=[clickup_sync_asset],
99
+ sensors=[automation_sensor],
100
+ )
File without changes
@@ -0,0 +1 @@
1
+ type: plugin_clickup.component.ClickupSyncComponent
@@ -0,0 +1,7 @@
1
+ {
2
+ "auth": {
3
+ "type": "api_key"
4
+ },
5
+ "mode": "dagster",
6
+ "plugin_id": "clickup"
7
+ }