Skip to main content

July

July

A small library for creating pretty heatmaps of daily data.

Features

  • Get rid of the eternal matplotlib tweaking every time you want to plot data in proper calendar format.
  • Generate GitHub activity overview-like heatmaps of your daily data.
  • Automatic handling of missing dates in input date range.
  • July does not rely only pandas (though it accepts it). Only numpy arrays and native Python data structures are used internally.
  • Accepted date formats: datetime.datetime, datetime.date, str, pd.DatetimeIndex

Install

$ pip install july

Usage

import numpy as np
import matplotlib.pyplot as plt
import july
from july.utils import date_range

dates = date_range("2020-01-01", "2020-12-31")
data = np.random.randint(0, 14, len(dates))
# GitHub Activity like plot (for someone with consistently random work patterns).
july.heatmap(dates, data, title='Github Activity', cmap="github")

GitHub heatmap

# Here, 'osl_df' is a pandas df. 
july.heatmap(osl_df.date, osl_df.temp, cmap="golden", colorbar=True, title="Average temperatures: Oslo , Norway")

Golden heatmap

# More exhaustive example using useless, but pretty colours.
july.heatmap(dates=dates, 
             data=data, 
             cmap='Pastel1',
             month_grid=True, 
             horizontal=True,
             value_label=False,
             date_label=False,
             weekday_label=True,
             month_label=True, 
             year_label=True,
             colorbar=False,
             fontfamily="monospace",
             fontsize=12,
             title=None,
             titlesize='large',
             dpi=100)

Pastel heatmap

# Month plot with dates.
july.month_plot(dates, data, month=5, date_label=True, ax=axes[0])
# Month plot with values.
july.month_plot(dates, data, month=5, value_label=True, ax=axes[1])

Month plot

# Calendar plot. 
july.calendar_plot(dates, data)

Calendar plot

Why "July"?

Main reason: All the obvious names like calplot, calmap, and calendarplot were all already taken by similar packages. This had me looking for a new name that wouldn't get easily mixed up with the other packages.

The reasoning was roughly as follows:

  • Heatmap + month → Hot month → July :sparkles:

Also, as a summer loving person stuck in the Northern hemisphere, July is my favourite month by a light year.

Release notes

  • v0.1.0: Working build but with minimal documentation.
  • v0.1.1: Fix relative image link in readme.
  • v0.1.2: Remove unnecessary argument from rcmod to be compatible with matplotlib versions earlier than v3.4.x.
  • v0.1.3: Fix week number labelling bug in month_plot() and calendar_plot()

TODO:

  • Fix slight misalignment of plot and cbar when date_grid and colorbar are used in conjunction.
  • Document everything...
  • Add type hints.
  • Add automatic date handling for strings of more types than just YYYY-MM-DD.

Metadata

Release files for july 0.1.3

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

Source distribution (sdist)

Source distribution for july 0.1.3
File Size Uploaded
july-0.1.3.tar.gz 13.5 kB Details

Built distribution (wheel)

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

Total release size: 26.5 kB

Release files / july-0.1.3.tar.gz

Download URL july-0.1.3.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d315c249210a7f608e27d2077eecbebe90bf6627a0faae934da6c416652ca423
BLAKE2b-256 checksum
How to use checksums
ae8cd8e28b4a74eeb0bcae2bbbd2c7559b84ec23e21cfb822fd060cc514c6ec3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.0

Release files / july-0.1.3-py3-none-any.whl

Download URL july-0.1.3-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f934a407cdc328830344adb1fb140c34bada34e27da5e069f80a2617d1d1d915
BLAKE2b-256 checksum
How to use checksums
3f0e420372c1576d3e60833d19fcddce4694366cd14d3526df1e8a79ad8dfddd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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