Leather Charting Library
Leather is a Python charting library designed for quickly generating straightforward visualizations, often described as 'charting for 80% of humans.' It currently stands at version 0.4.1, with its last release in December 2025. The library focuses on ease of use and producing functional charts without extensive customization options.
Warnings
- breaking With the release of version 0.4.1, official support for Python 3.8 and 3.9 was dropped. While the 'requires_python' metadata might be broader, the package classifiers for 0.4.1 explicitly list Python 3.10, 3.11, 3.12, 3.13, and 3.14. Installations on Python 3.8 or 3.9 may encounter issues or be unsupported.
- gotcha Leather is designed for quick and simple charting. Extensive customization of chart styles is neither expected nor officially recommended. Attempting deep customization may require direct manipulation of the generated SVG or significant workarounds.
- gotcha When manually adjusting tick values using methods like `Chart.add_x_axis()` or `Chart.add_y_axis()`, the chart's scale is not automatically adjusted. This can result in custom tick labels falling outside the visible range of the rendered chart if not carefully aligned with the data bounds.
Install
-
pip install leather
Imports
- leather
import leather
Quickstart
import random
import leather
# Generate some random data
dot_data = [(random.randint(0, 250), random.randint(0, 250)) for i in range(100)]
# Define a colorizing function based on data values
def colorizer(d):
return 'rgb(%i, %i, %i)' % (d.x, d.y, 150)
# Create a chart and add dots with custom colors
chart = leather.Chart('Colorized dots')
chart.add_dots(dot_data, fill_color=colorizer)
# Save the chart to an SVG file
chart.to_svg('colorized_dots.svg')
print("Chart saved to colorized_dots.svg")