
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
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 | Years / weeks 1 - 52. |
WEEK_DAY | Weeks | Days of the week | Weeks 1 - 52 / Monday - Sunday. |
DOW_HOUR | Days of the week | Hour of day | Monday - Sunday / 24 hours. |
DAY_HOUR | Days | Hour of day | Days 1 - 356 / 24 hours. |
The full documentation can be viewed on the project GitHub Page.
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
)
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
)
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
)
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
)
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
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
cd docs
make html
FAQs
Data clock charts using matplotlib.
We found that dataclocklib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.