Skip to main content

Datapane client library and CLI tool

Project description

Datapane

Datapane Teams | Documentation | API Docs | Changelog | Twitter | Blog

Pip Downloads Latest release Conda (channel only)

Turn a Python analysis into a beautiful document in 3 lines of code.

Datapane is a Python library which makes it simple to build reports from the common objects in your data analysis, such as pandas DataFrames, plots from Python visualisation libraries, and Markdown.

Reports can be exported as standalone HTML documents, with rich components which allow data to be explored and visualisations to be used interactively. You can also publish reports to our free platform for public use or share them securely with your team and clients.

Getting Started

Installing Datapane

The best way to install Datapane is through pip or conda.

pip

pip3 install -U datapane

conda

conda install -c conda-forge "datapane>=0.10.0"

Datapane also works well in hosted Jupyter environments such as Colab or Binder, where you can install as follows:

!pip3 install --quiet datapane

Explainer Video

https://user-images.githubusercontent.com/3541695/117458709-7e80ba80-af42-11eb-9fa7-a11bb05229fe.mp4

Hello world

Let's say you wanted to create a document with a table viewer and an interactive plot:

import pandas as pd
import altair as alt
import datapane as dp

df = pd.read_csv('https://covid.ourworldindata.org/data/vaccinations/vaccinations-by-manufacturer.csv', parse_dates=['date'])
df = df.groupby(['vaccine', 'date'])['total_vaccinations'].sum().reset_index()

plot = alt.Chart(df).mark_area(opacity=0.4, stroke='black').encode(
    x='date:T',
    y=alt.Y('total_vaccinations:Q'),
    color=alt.Color('vaccine:N', scale=alt.Scale(scheme='set1')),
    tooltip='vaccine:N'
).interactive().properties(width='container')

total_df = df[df["date"] == df["date"].max()].sort_values("total_vaccinations", ascending=False).reset_index(drop=True)
total_styled = total_df.style.bar(subset=["total_vaccinations"], color='#5fba7d', vmax=total_df["total_vaccinations"].sum())

dp.Report("## Vaccination Report",
    dp.Plot(plot, caption="Vaccinations by manufacturer over time"),
    dp.Table(total_styled, caption="Current vaccination totals by manufacturer")
).save(path='report.html', open=True)

This would package a standalone HTML report document such as the following:

Report Example

Text Reports

If you are writing a report with a lot of text e.g. an article or tutorial, try our Text Report web editor, where you can combine Markdown with assets uploaded from Python. Here's how you'd do it for the previous example:

dp.TextReport("## Vaccination Report",
    dp.Plot(plot, caption="Vaccinations by manufacturer over time"),
    dp.Table(total_styled, caption="Current vaccination totals by manufacturer")
).upload(name="Example vaccination report")

Note that you'll need an account on Datapane.com to use TextReports. This will bring up the web editor, where you can add additional commentary to these assets:

TextReport editor and preview

Featured Examples

Here a few samples of the top reports created by the Datapane community. To see more, see our featured section.

Next Steps

Sharing Reports

Public sharing

In addition to saving documents locally, you can use Hosted Datapane to publish your reports. Datapane is a free hosted platform used by tens of thousands of people each month to view and share Python reports.

  • Reports can be published for free and shared publicly or securely
  • You can embed them into places like Medium, Reddit, or your own website (see here)
  • Viewers can explore and download your data with additional DataTable analysis features

To get started, create a free API key (see here) and call the upload function on your report,

r = dp.Report(dp.DataTable(df), dp.Plot(chart))
r.upload(name="2020 Stock Portfolio", open=True)

Private sharing

If you need private report sharing, Datapane Teams allows secure sharing of reports and the ability to deploy your Jupyter Notebooks or Python scripts as interactive apps.

  • Share reports privately with your company or external clients
  • Deploy Jupyter Notebooks and scripts as apps, with inputs that can be run by your team interactively to dynamically create results
  • Schedule reports to automatically update

Datapane Teams is offered as both a managed SaaS service and an on-prem install. For more information, see the documentation. You can find pricing here.

Analytics

By default, the Datapane Python library collects error reports and usage telemetry. This is used by us to help make the product better and to fix bugs. If you would like to disable this, simply create a file called no_analytics in your datapane config directory, e.g.

Linux

$ mkdir -p ~/.config/datapane && touch ~/.config/datapane/no_analytics

macOS

$ mkdir -p ~/Library/Application\ Data/datapane && touch ~/Library/Application\ Data/no_analytics

Windows (PowerShell)

PS> mkdir ~/AppData/Roaming/datapane -ea 0
PS> ni ~/AppData/Roaming/datapane/no_analytics -ea 0

You may need to try ~/AppData/Local instead of ~/AppData/Roaming on certain Windows configurations depending on the type of your user-account.

Joining the community

Looking to get answers to questions or engage with us and the wider community? Check out our GitHub Discussions board.

Submit feature requests, issues, and bug reports on this GitHub repo.

Open-source, not open-contribution

Datapane is currently closed to external code contributions. However, we are tremendously grateful to the community for any feature requests, ideas, discussions, and bug reports.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

datapane-0.12.1.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

datapane-0.12.1-py3-none-any.whl (2.5 MB view details)

Uploaded Python 3

File details

Details for the file datapane-0.12.1.tar.gz.

File metadata

  • Download URL: datapane-0.12.1.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.9 CPython/3.9.7 Linux/5.8.0-1041-azure

File hashes

Hashes for datapane-0.12.1.tar.gz
Algorithm Hash digest
SHA256 f8d005de7cd481b4c86b284012b7d4d84c5718a01e0d97b6825e6fd62d732d4d
MD5 f298f92fe974eb3c8d215edeefa93149
BLAKE2b-256 b9096f24e8c517aed3b6cc211f34da71527ed084a8a10b1d931145b23b44b3fc

See more details on using hashes here.

File details

Details for the file datapane-0.12.1-py3-none-any.whl.

File metadata

  • Download URL: datapane-0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.9 CPython/3.9.7 Linux/5.8.0-1041-azure

File hashes

Hashes for datapane-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d645ba5ea9d8618491de8f76aa7870ab8f8edf4cb711949dc6974083a984d66
MD5 c9a49dc43fb844b6551a1d8ceeb6879e
BLAKE2b-256 57a12b5ca741763c5d7306b6a979c6566f793695d0ccb9223f1d892f6204838b

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