Skip to main content

Data Clock Visualisation Library

PyPI - Version PyPI - Downloads Python Version from PEP 621 TOML GitHub Actions Workflow Status GitHub deployments

Introduction

This library allows the user to create data clock graphs, using the matplotlib Python library.

Data clocks visually summarise temporal data in two dimensions, revealing seasonal or cyclical patterns and trends over time. A data clock is a circular chart that divides a larger unit of time into rings and subdivides it by a smaller unit of time into wedges, creating a set of temporal bins.

These temporal bins are symbolised using graduated colors that correspond to a count or aggregated value taking place in each time period.

The table below details the currently supported chart modes and the corresponding rings and wedges:

Mode Rings Wedges Description
YEAR_MONTH Years Months Years / January - December.
YEAR_WEEK Years Weeks Calendar years / weeks 1 - 52.
WEEK_DAY Weeks Days of the week ISO weeks / Monday - Sunday.
DOW_HOUR Days of the week Hour of day Monday - Sunday / 24 hours.
DAY_HOUR Days Hour of day Days 1 - 366 / 24 hours.

The full documentation can be viewed on the project GitHub Page.

Example charts

Chart examples have been generated using UK Department for Transport data 2010 - 2015.

import pandas as pd
from dataclocklib.charts import dataclock

data = pd.read_parquet(
    "https://raw.githubusercontent.com/andyrids/dataclocklib/main/tests/data/traffic_data.parquet.gzip"
)

chart_data, fig, ax = dataclock(
    data=data,
    date_column="Date_Time",
    mode="DOW_HOUR",
    spine_color="darkslategrey",
    grid_color="black",
    default_text=False,
)

Data clock chart

import pandas as pd
from dataclocklib.charts import dataclock

data = pd.read_parquet(
    "https://raw.githubusercontent.com/andyrids/dataclocklib/main/tests/data/traffic_data.parquet.gzip"
)

chart_data, fig, ax = dataclock(
    data=data,
    date_column="Date_Time",
    mode="DOW_HOUR",
    spine_color="darkslategrey",
    grid_color="black",
    default_text=True,
)

Data clock chart

import pandas as pd
from dataclocklib.charts import dataclock

data = pd.read_parquet(
    "https://raw.githubusercontent.com/andyrids/dataclocklib/main/tests/data/traffic_data.parquet.gzip"
)

chart_data, fig, ax = dataclock(
    data=data,
    date_column="Date_Time",
    mode="DOW_HOUR",
    default_text=True,
    spine_color="darkslategrey",
    grid_color="black",
    chart_title="**CUSTOM TITLE**",
    chart_subtitle="**CUSTOM SUBTITLE**",
    chart_period="**CUSTOM PERIOD**",
    chart_source="Source: UK Department for Transport",
    dpi=150,
)

Data clock chart

import pandas as pd
from dataclocklib.charts import dataclock

data = pd.read_parquet(
    "https://raw.githubusercontent.com/andyrids/dataclocklib/main/tests/data/traffic_data.parquet.gzip"
)

chart_data, fig, ax = dataclock(
    data=data.query("Date_Time.dt.year.eq(2010)"),
    date_column="Date_Time",
    agg_column="Number_of_Casualties",
    agg="sum",
    mode="DOW_HOUR",
    cmap_name="X26",
    cmap_reverse=True,
    spine_color="honeydew",
    grid_color="honeydew",
    default_text=True,
    chart_title="UK Traffic Accident Casualties",
    chart_subtitle=None,
    chart_period="Period: 2010",
    chart_source="Source: https://data.dft.gov.uk/road-accidents-safety-data/dft-road-casualty-statistics-collision-last-5-years.csv",
    dpi=300,
)

Data clock chart

Installation

You can install using pip:

python -m pip install dataclocklib

To install from GitHub use:

python -m pip install git+https://github.com/andyrids/dataclocklib.git

Development Installation

Astral uv is used as the Python package manager. To install uv see the installation guide @ uv documentation.

Clone the repository:

git clone git@github.com:andyrids/dataclocklib.git
cd dataclocklib

Sync the dependencies, including the dev dependency group and optional dependencies with uv:

uv sync --all-extras

Activate the virtual environment:

. .venv/bin/activate

Common development tasks are just recipes (run just to list them):

just setup      # uv sync --all-extras, install the prek git hooks, update .secrets.baseline
just coverage   # run the tests with a coverage report

Sphinx documentation

Build the HTML documentation into docs/build/html (warnings are treated as errors):

just docs

Serve it locally with live reload, or remove the build output:

just docs-serve
just docs-clean

Metadata

Release files for dataclocklib 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dataclocklib 0.3.1
File Size Uploaded
dataclocklib-0.3.1.tar.gz 31.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dataclocklib 0.3.1
File Interpreter ABI Platform
dataclocklib-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 62.2 kB

Release files / dataclocklib-0.3.1.tar.gz

Download URL dataclocklib-0.3.1.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6fcf5c7e7e2beafa9a57f3dc4351269823bb0e408843fca75ad980901341bb1a
BLAKE2b-256 checksum
How to use checksums
0b9d045083294a37354ab190f80223fd93da998ce55f2fa91184bc4d9942d74b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / dataclocklib-0.3.1-py3-none-any.whl

Download URL dataclocklib-0.3.1-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfae89060edc6ddc3a6f28fccbb54815b3870ea2cb3b93a0226e2b9fcbc21016
BLAKE2b-256 checksum
How to use checksums
49c0a38f5f863a2f172becfdcb32acc440f15cc2e2bf79e9e1f43c61f590a91c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page