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

Example data:

import pandas as pd
temp = pd.read_csv('https://raw.githubusercontent.com/rafatro/plot2html/main/tests/Temperature_London_Rome.csv',parse_dates=[0])

Your python code:

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.")
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.8.tar.gz (5.0 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.8-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plot2html-0.0.8.tar.gz
  • Upload date:
  • Size: 5.0 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.8.tar.gz
Algorithm Hash digest
SHA256 cc65fd2832b2f985af75eb805f3045817754e6c23cb23f28ea3bcfffad0b0db4
MD5 30479f0cfec3f102c64ed605535f89b5
BLAKE2b-256 3951800a8c55b3491d8a87d07ee70ecea74a2f69b7521605f1b81a1cda4deff6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plot2html-0.0.8-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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a426e0af7021fa463066387f3aef784861554adfcd4637440e82fbd522339ae4
MD5 5f7878b6ebd8335718ddf1ea513e1e16
BLAKE2b-256 28dc1d2ff070582801b210d106dc79cc65ca98feb58e2932869d058739dec237

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