Skip to main content

A Python package for making historical timelines

Project description

historical-timelines

Python package for creating timelines of historical events.

Build Status codecov license: MIT GitHub issues PyPI

Overview

historical-timelines is a python package for creating nice looking timelines, specifically with historical data in mind. historical-timelines uses bokeh to create images.

Install

Install with pip install historical_timelines

Quick start

First, you'll need to import the HistoricalTimeline object.

from historical_timelines import HistoricalTimeline

Then, you need to populate it. Here's how to populate and display a random timeline:

from historical_timelines import HistoricalTimeline

timeline = HistoricalTimeline("Random Timeline")
timeline.populate_random_timeline()
timeline.render_timeline("timeline.html")

This will produce something that looks like this:

Sample timeline

If you have a csv that you want to convert to a timeline, you can do that too. Suppose you have a csv with the path timeline.csv, and five columns entitled Name, Description, Label, Start, and End. It would be imported like this.

from historical_timelines import HistoricalTimeline

timeline = HistoricalTimeline("Timeline from my csv")
timeline_json = HistoricalTimeline.json_from_csv(
    "timeline.csv",
    "Name",
    "Description",
    "Label",
    "Start",
    "End",
)

timeline.populate_timeline_from_dict(timeline_json)
timeline.render_timeline("timeline.html")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

historical_timelines-0.2.1.tar.gz (46.6 kB view details)

Uploaded Source

File details

Details for the file historical_timelines-0.2.1.tar.gz.

File metadata

  • Download URL: historical_timelines-0.2.1.tar.gz
  • Upload date:
  • Size: 46.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for historical_timelines-0.2.1.tar.gz
Algorithm Hash digest
SHA256 292ffaefa527eb74df4f8baecbf61318d62f731810a8d72954812dd918c043ea
MD5 be884ec750b4f940b376feac4ae47ce1
BLAKE2b-256 1393e1d129042a340b9b992cc8f76441a087dfa68e7ccef6420b8fd15236e3b9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page