contextbase-plugin-clickup 0.0.0a1__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.0.0a1
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.0.0a1
8
+ Requires-Dist: dagster==1.12.14
9
+ Requires-Python: >=3.12, <3.13
@@ -0,0 +1,8 @@
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=QIjopU2sLtu2RpQzvXtJA2iiqCAwG0dhJ7gg7ZgGIqw,3465
4
+ plugin_clickup/plugin.json,sha256=egIxQlufSOZYFIkSl1XBoQRiYDdreuizMssKUjFP9n4,83
5
+ contextbase_plugin_clickup-0.0.0a1.dist-info/WHEEL,sha256=i9aSRDivn5iP9LaR1BLQX2GNAuriQWPsFwbbWygTX2k,81
6
+ contextbase_plugin_clickup-0.0.0a1.dist-info/entry_points.txt,sha256=y2lgw8R5EpwP6FXOvoGnV_H3M9xAwEIAxfwZfwTZr7Y,80
7
+ contextbase_plugin_clickup-0.0.0a1.dist-info/METADATA,sha256=kpIfOQT10cCTZBx89f7352Shd2N86JN72qcxmeufY4c,334
8
+ contextbase_plugin_clickup-0.0.0a1.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
@@ -0,0 +1,3 @@
1
+ [contextlayer.plugins]
2
+ clickup = plugin_clickup.component:ClickupSyncComponent
3
+
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.base_platform import BasePlatformClient
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 base_client import BindingAuth_ApiKey
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: BindingAuth_ApiKey,
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, extra_tags={"ctx_primary": "true"}),
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
+ base_platform: dg.ResourceParam[BasePlatformClient],
64
+ ):
65
+ binding = resolve_partition_binding(
66
+ context=context,
67
+ base_platform=base_platform,
68
+ plugin_id=PLUGIN_ID,
69
+ )
70
+ binding_id = 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
+ )
@@ -0,0 +1,7 @@
1
+ {
2
+ "auth": {
3
+ "type": "api_key"
4
+ },
5
+ "mode": "dagster",
6
+ "plugin_id": "clickup"
7
+ }