Skip to main content

Creates a static .html file with charts using Google Charts API

Project description

plot2html

Helping people publish beautiful automated reports that contribute to transparency, high quality monitoring and faster decision making

With this library, you can create static .html files with text and charts using Google Charts API.

On the command line:

pip install plot2html

On your python file:

import pandas as pd
from plot2html import CreateReport
rep = CreateReport("Example of plot2html Report")
rep.text("<h2>Smart title you can create</h2>This is an example what what you can do with plot2html.")
temp = pd.read_csv('https://raw.githubusercontent.com/rafatro/plot2html/main/tests/Temperature_London_Rome.csv',parse_dates=[0])
options = {'title': 'Average temperature at London and Rome',
           'hAxis': {'title': 'Date'},
           'vAxis': {'title': 'Average Daily Temperature (Celsius)'},
           'colors': ['#a52714', '#097138']
          }
rep.plot(data=temp.pivot(index='date', columns='location', values='tavg').reset_index()
         ,x='date'
         ,y=['London','Rome']
         ,type='line'
         ,width='half'
         ,height=400
         ,options=options)
rep.text('''This text is an explanation about the chart to the left.<br>
The first chart above shows data from <a href='https://meteostat.net/'>Meteostat</a>, that provides open source data about meteorology.<br>
You can see Rome temperatures follow the same trend as London's, because both cities are in the northern hemisphere, but Rome is a bit hotter, especialy on the summer.
''',width="half")
rep.exporthtml("C:/Users/rafae/Desktop/plot2html/tests/index.html")

You will get this output: example screenshot

This is just the begining.

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

plot2html-0.0.5.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plot2html-0.0.5-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file plot2html-0.0.5.tar.gz.

File metadata

  • Download URL: plot2html-0.0.5.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for plot2html-0.0.5.tar.gz
Algorithm Hash digest
SHA256 17cfe4a590f46f142123eac08bfbaf88c3b42fa49056c733719ffefa5a7d3ffc
MD5 5a492133383947fa59a48c77281f3ed6
BLAKE2b-256 caf2dd2e7fffa0d8c8c6ac9cf78b10410ef28d3453df3744e1c7624d2a8fecc8

See more details on using hashes here.

File details

Details for the file plot2html-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: plot2html-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for plot2html-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 17d152d8cf15b2f253e79e004bd5e8f330da655fea0894883b3e44eb809c4dfd
MD5 4e55d4eabe88ec0baf85c8c4be2b2d1f
BLAKE2b-256 3b20c0c80e5c3eebd0f7eff3d8d026a55c8299702cb3e85064749f274f00119e

See more details on using hashes here.

Supported by

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