Uploading and sharing
Uploading your report so you can share it with others.
Info
This feature requires use of the free Datapane Cloud hosted platform or a private Datapane Teams instance
Upload a report
So far we've demonstrated how to build and view reports locally; however, one of the most powerful features of Datapane is the ability to upload your report straight from your code and share it directly with your team or the wider world.
Once you've logged in to your chosen Datapane server, call report.upload(name='Your report name')
in your script and your report will be uploaded to your Datapane instance for viewing online. This will return the URL of the report that you can share.
Info
Report.upload
was previously called Report.publish.
The old syntax will still work but has been deprecated.
Let's see an example report uploaded to Datapane.com, with the upload
syntax. Set the open
boolean parameter to True
to open the report afterwards automatically, and add a description
to change the preview text for your viewers.
import altair as alt
from vega_datasets import data
import datapane as dp
source = data.cars()
plot1 = (
alt.Chart(source)
.mark_circle(size=60)
.encode(
x="Horsepower",
y="Miles_per_Gallon",
color="Origin",
tooltip=["Name", "Origin", "Horsepower", "Miles_per_Gallon"],
)
.interactive()
)
report = dp.Report(dp.Plot(plot1), dp.DataTable(source))
report.upload(name="My first report", description="Testing out an Altair report")
Once uploaded, you can share the link with others so they can view your report and comment on it. Public reports created are viewable and shareable by default. In future sections, we will also explore how to embed your report into a range of other platforms so you can share it with a wider audience.