Clockify connector
Time entries, projects, users, and reporting for workforce operations.
Use this as an implementation starting point: adapt the worked example to the requested dataset and the source documentation. See Custom API for the shared SDK pattern and document-upload workflow.
What this connector is for
Time entries, projects, users, and reporting for workforce operations.
A connector owns access to the source. Separate syncs shape selected resources into tables for analysis and downstream transformations using the Python SDK.
Data and tables you can pull
These are representative dataset families to consider, not a claim that the worked example implements every resource. Access, fields, and availability depend on the source account, product edition, and permissions. Use the vendor reference to select concrete resources.
| Suggested table | One row represents |
|---|---|
workspaces | a workspace |
users | a user |
projects | a project |
tasks | a task |
time_entries | a time entry |
tags | a tag |
Relationships and extraction considerations
Choose stable object IDs and preserve references between related resources. Nested arrays may need child tables. The listed names are proposed output datasets; validate the actual endpoint, fields, permissions, and pagination before adding each sync.
Connecting to Clockify
Connects through the source's HTTP API using the API credentials defined in the connection configuration. Set api_key, workspace_id in the connection configuration.
Additional resources may require additional scopes. Connection settings belong to the connector; dataset filters and resource selection belong to each sync. See the CLI workflow for registration and configuration.
Connection settings used by the example
| Setting | Requirement | Purpose |
|---|---|---|
api_key | Required; secret | Credential or scope value used by the Clockify API example. |
workspace_id | Required | Credential or scope value used by the Clockify API example. |
requirements.in
Save these dependencies in requirements.in alongside connector.py; the example includes packages used by its sync. Install the published vortexify package for local development. Keep sync-specific dependencies in the sync's own requirements.in when splitting the implementation into separate resources.
vortexify==0.1.1
httpx>=0.27,<1
pandas>=2,<3No separately installed database driver is needed by this HTTP example.
Worked example: sync users
users — Reads records from the users API resource. Includes activeWorkspace, defaultWorkspace, email, id, name and the complete record as JSON in document.
The complete files below implement only this example resource. They illustrate the current SDK signatures, a separate preview, bounded DataFrame output, and source-specific extraction. They do not establish complete source coverage. Live credentials and platform ingestion have not been used to validate this guide.
With default paths, place the connector files in connectors/clockify/ and sync files in connectors/clockify/syncs/users/. Use your project configuration if it specifies different paths.
Connection schema: config.json
This file contains a JSON Schema, not actual credential values. Provide those through platform configuration.
{
"type": "object",
"properties": {
"api_key": {
"type": "string",
"title": "Api Key",
"description": "Credential or scope value used by the Clockify API example.",
"x-vortexify-secret": true,
"order": 0
},
"workspace_id": {
"type": "string",
"title": "Workspace Id",
"description": "Credential or scope value used by the Clockify API example.",
"order": 1
}
},
"required": [
"api_key",
"workspace_id"
]
}Connector: connector.py
import httpx
from vortexify import Column, Connector, DiscoveredTable
class ClockifyConnector(Connector):
vendor_domain = "clockify.me"
def client(self):
if self._client is None or self._client.is_closed:
self._client = httpx.Client(
base_url="https://api.clockify.me/api/v1/",
headers={
"Accept": "application/json",
"X-Api-Key": self.config["api_key"],
},
timeout=60,
follow_redirects=False,
)
return self._client
def check(self) -> bool:
cfg = self.config
page_size = 1
path = "workspaces/" + str(cfg["workspace_id"]) + "/users"
params = {}
params["page-size"] = page_size
params["page"] = 1
response = self.client().get(path, params=params)
response.raise_for_status()
payload = response.json()
values = [payload]
for part in []:
children = []
for value in values:
if part == "*":
if isinstance(value, list):
children.extend(value)
elif isinstance(value, dict):
children.extend(value.values())
elif isinstance(value, dict) and part in value:
children.append(value[part])
elif isinstance(value, dict) and value:
raise ValueError("Missing API record container")
values = children
records = []
for value in values:
if isinstance(value, list):
records.extend(value)
elif isinstance(value, dict):
records.append(value)
elif value is not None:
raise ValueError("Unexpected API record container")
return True
def discover(self) -> list[DiscoveredTable]:
return [
DiscoveredTable(
name="users",
schema=[
Column(name="activeWorkspace", type="string"),
Column(name="defaultWorkspace", type="string"),
Column(name="email", type="string"),
Column(name="id", type="string"),
Column(name="name", type="string"),
Column(name="document", type="string"),
],
)
]
def close(self) -> None:
if self._client is not None:
try:
self._client.close()
finally:
self._client = NoneSync schema: syncs/users/config.json
{
"type": "object",
"properties": {},
"required": []
}Sync: syncs/users/sync.py
from collections.abc import Iterator
from math import isfinite
import json
import pandas as pd
from vortexify import Sync
class ClockifyUsersSync(Sync):
def preview(self) -> pd.DataFrame:
cfg = self.connector.config
page_size = 50
path = "workspaces/" + str(cfg["workspace_id"]) + "/users"
params = {}
params["page-size"] = page_size
params["page"] = 1
response = self.client.get(path, params=params)
response.raise_for_status()
payload = response.json()
values = [payload]
for part in []:
children = []
for value in values:
if part == "*":
if isinstance(value, list):
children.extend(value)
elif isinstance(value, dict):
children.extend(value.values())
elif isinstance(value, dict) and part in value:
children.append(value[part])
elif isinstance(value, dict) and value:
raise ValueError("Missing API record container")
values = children
records = []
for value in values:
if isinstance(value, list):
records.extend(value)
elif isinstance(value, dict):
records.append(value)
elif value is not None:
raise ValueError("Unexpected API record container")
if not isinstance(records, list) or any(
(not isinstance(record, dict) for record in records)
):
raise ValueError(
"Unexpected API record shape; refusing a partial successful sync"
)
records = records[:100]
rows = []
for record in records:
row = {
"activeWorkspace": record.get("activeWorkspace"),
"defaultWorkspace": record.get("defaultWorkspace"),
"email": record.get("email"),
"id": record.get("id"),
"name": record.get("name"),
"document": json.dumps(record, ensure_ascii=False, default=str),
}
rows.append(
{
key: (
json.dumps(value, ensure_ascii=False, default=str)
if isinstance(value, (dict, list))
else value
)
for key, value in row.items()
}
)
return pd.DataFrame(
rows,
columns=[
"activeWorkspace",
"defaultWorkspace",
"email",
"id",
"name",
"document",
],
dtype=object,
)
def extract(
self, *, avg_row_size_bytes: float | None = None
) -> Iterator[pd.DataFrame]:
memory_mib = self.compute.memory if self.compute else None
memory_mib = memory_mib if memory_mib is not None and memory_mib > 0 else 1024
target_bytes = min(16 * 1024 * 1024, max(1, memory_mib * 1024 * 1024 // 20))
batch_size = 100
if avg_row_size_bytes is not None:
if not isfinite(avg_row_size_bytes) or avg_row_size_bytes <= 0:
raise ValueError("avg_row_size_bytes must be finite and positive")
batch_size = max(1, int(target_bytes / max(1.0, avg_row_size_bytes) / 4))
batch_size = min(batch_size, 50)
cfg = self.connector.config
page_size = batch_size
path = "workspaces/" + str(cfg["workspace_id"]) + "/users"
params = {}
params["page-size"] = page_size
params["page"] = 1
seen_pages = set()
while True:
response = self.client.get(path, params=params)
response.raise_for_status()
payload = response.json()
values = [payload]
for part in []:
children = []
for value in values:
if part == "*":
if isinstance(value, list):
children.extend(value)
elif isinstance(value, dict):
children.extend(value.values())
elif isinstance(value, dict) and part in value:
children.append(value[part])
elif isinstance(value, dict) and value:
raise ValueError("Missing API record container")
values = children
records = []
for value in values:
if isinstance(value, list):
records.extend(value)
elif isinstance(value, dict):
records.append(value)
elif value is not None:
raise ValueError("Unexpected API record container")
if not isinstance(records, list) or any(
(not isinstance(record, dict) for record in records)
):
raise ValueError(
"Unexpected API record shape; refusing a partial successful sync"
)
rows = []
for record in records:
row = {
"activeWorkspace": record.get("activeWorkspace"),
"defaultWorkspace": record.get("defaultWorkspace"),
"email": record.get("email"),
"id": record.get("id"),
"name": record.get("name"),
"document": json.dumps(record, ensure_ascii=False, default=str),
}
rows.append(
{
key: (
json.dumps(value, ensure_ascii=False, default=str)
if isinstance(value, (dict, list))
else value
)
for key, value in row.items()
}
)
for start in range(0, len(rows), batch_size):
yield pd.DataFrame(
rows[start : start + batch_size],
columns=[
"activeWorkspace",
"defaultWorkspace",
"email",
"id",
"name",
"document",
],
dtype=object,
)
if len(records) < page_size:
break
params["page"] += 1Running and extending the example
Register the connector before the sync and commit each resource separately:
vortexify create connector clockify
vortexify create sync clockify/usersEdit the files, inspect vortexify status, and use the CLI guide to commit and configure them. Registration alone does not run extraction or deploy the connector.
Preview must run with a fresh connector and disposable state. The extraction implementation determines full/incremental behavior; merely setting a mode does not implement change capture. API/driver failures propagate unless explicitly handled in the code. Check source limits and single-record/response sizes as well as output batch size.
Sources and further reading
- Vendor API and data reference — Resource definitions, authentication, fields, and source-specific limits. Check the selected resource's reference when extending the example.
- Vortexify connector and sync contracts — Client ownership, discovery, preview isolation, and DataFrame extraction.
- Vortexify CLI workflow — Project paths, resource registration, source commits, and credential configuration.