Python client for the Timing macOS app SQLite database
Project description
timingapp-python
Python client for the Timing macOS app SQLite database.
Provides read-only access to Timing's SQLite database (~/Library/Application Support/info.eurocomp.Timing2/SQLite.db) via SQLAlchemy 2.x ORM.
Credit: This is a Python port of timingapp-ruby by @marcoroth. The Ruby gem provides the same read-only database access via ActiveRecord; this library reimplements it idiomatically in Python using SQLAlchemy 2.x.
Note: This library was mostly generated by Claude Sonnet 4.6.
Requirements
- Python 3.12+
- SQLAlchemy 2.0+
- macOS with Timing app installed (for real usage)
Installation
pip install timingapp
Usage
from timingapp import open_database, AppActivity, Project, TaskActivity
from sqlalchemy import select
# Open the default Timing database (read-only)
db = open_database()
with db.session() as sess:
# Query all projects
projects = sess.scalars(select(Project)).all()
for p in projects:
print(p.title)
# Get archived projects
archived = sess.scalars(Project.archived()).all()
# Get running task activities
running = sess.scalars(TaskActivity.running()).all()
# Get deleted app activities
deleted = sess.scalars(AppActivity.deleted()).all()
# Access relationships
activity = sess.get(AppActivity, 1)
if activity:
print(activity.application.name)
print(activity.project.title)
print(activity.startDate) # UTC datetime
Models
| Model | Table | Notes |
|---|---|---|
AppActivity |
AppActivity |
Scopes: deleted() |
AppActivityWithStrings |
AppActivityWithStrings |
SQLite VIEW |
Application |
Application |
|
Device |
Device |
PK: localID |
Event |
Event |
|
EventSource |
EventSource |
Scopes: templates(), favorites() |
EventSourceTaskActivity |
EventSourceTaskActivity |
Scopes: deleted() |
Filter |
Filter |
Scopes: samples(), self-referential |
Integration |
Integration |
|
IntegrationLogResult |
integration_log_result |
|
IntegrationProject |
IntegrationProject |
|
Path |
Path |
|
Project |
Project |
Scopes: archived(), self-referential |
TaskActivity |
TaskActivity |
Scopes: running(), deleted() |
Title |
Title |
Export Script
The timing-export CLI script exports app activity for a given day as newline-delimited JSON (one JSON object per line) to stdout.
# Export today's activity
timing-export
# Export a specific date
timing-export 2026-03-15
Each line is a JSON object with the following fields:
| Field | Type | Description |
|---|---|---|
startDate |
ISO 8601 string or null | Activity start time (UTC) |
endDate |
ISO 8601 string or null | Activity end time (UTC) |
appName |
string or null | Application name |
windowTitle |
string or null | Window/document title |
path |
string or null | File path of the active document |
device |
string or null | Device display name |
Example output:
{"startDate": "2026-03-15T09:00:00+00:00", "endDate": "2026-03-15T09:12:34+00:00", "appName": "Code", "windowTitle": "README.md — timingapp-python", "path": "/Users/steven/tmp/timing/timingapp-python/README.md", "device": "My Mac"}
{"startDate": "2026-03-15T09:12:35+00:00", "endDate": "2026-03-15T09:45:00+00:00", "appName": "Safari", "windowTitle": "SQLAlchemy 2.0 Documentation", "path": null, "device": "My Mac"}
Development
# Install dev dependencies
uv sync --extra dev
# Run tests
uv run pytest
# Type check
uv run mypy src/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file timingapp-0.2.0.tar.gz.
File metadata
- Download URL: timingapp-0.2.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3eeb478c24ffd6125cc24941d11d3c6eb6976d6e026cb9cb6b02a8a528ed18c1
|
|
| MD5 |
ad18eeb1deb7066155dc5f55188b1704
|
|
| BLAKE2b-256 |
8850d709cc539299f39fe887815175226b39c75308dc39f519f225e3f7cacca6
|
Provenance
The following attestation bundles were made for timingapp-0.2.0.tar.gz:
Publisher:
publish.yml on SConaway/timingapp-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
timingapp-0.2.0.tar.gz -
Subject digest:
3eeb478c24ffd6125cc24941d11d3c6eb6976d6e026cb9cb6b02a8a528ed18c1 - Sigstore transparency entry: 1112510391
- Sigstore integration time:
-
Permalink:
SConaway/timingapp-python@222452cb6d84f8e7a8d688da41d573ca827bd40a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/SConaway
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@222452cb6d84f8e7a8d688da41d573ca827bd40a -
Trigger Event:
push
-
Statement type:
File details
Details for the file timingapp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: timingapp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a475dd0e81b41a68b9542cd870c23bddac61ae08a1a199a91a1980de611cf669
|
|
| MD5 |
d99d5af0d4978d0a95e7528cb5d75421
|
|
| BLAKE2b-256 |
c355fa684801671fd444256ba7f198b7805924dafe9c2285ef55998f867cd5b6
|
Provenance
The following attestation bundles were made for timingapp-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on SConaway/timingapp-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
timingapp-0.2.0-py3-none-any.whl -
Subject digest:
a475dd0e81b41a68b9542cd870c23bddac61ae08a1a199a91a1980de611cf669 - Sigstore transparency entry: 1112510420
- Sigstore integration time:
-
Permalink:
SConaway/timingapp-python@222452cb6d84f8e7a8d688da41d573ca827bd40a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/SConaway
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@222452cb6d84f8e7a8d688da41d573ca827bd40a -
Trigger Event:
push
-
Statement type: