Module datapane.client.api.report.core

Datapane Reports Object

Describes the Report object and included APIs for saving and publishing them.

Classes

class Report (*arg_blocks: Union[ForwardRef('Page'), ForwardRef('Group'), ForwardRef('Select'), ForwardRef('DataBlock'), Any], blocks: List[Union[ForwardRef('Page'), ForwardRef('Group'), ForwardRef('Select'), ForwardRef('DataBlock'), Any]] = None, type: ReportType = ReportType.REPORT, **kwargs)

Reports collate plots, text, tables, and files into an interactive report that can be analysed and shared by users in their Browser

Args

*arg_blocks
Group to add to report
blocks
Allows providing the report blocks as a single list
type
Set the Report type, this will affect the formatting and layout of the report

Tip: Group can be passed using either arg parameters or the blocks kwarg, e.g.

dp.Report(plot, table) or dp.Report(blocks=[plot, table])

Ancestors

Class variables

var pages : List[Page]
var report_typeReportType
var list_fields : List[str]

When set, the report is full-width suitable for use in a dashboard

Static methods

def get(name: str, owner: Union[str, NoneType] = None) ‑> ~U

Inherited from: DPObjectRef.get

Lookup and retrieve an object from the Datapane Server by its name …

def by_id(id_or_url: str) ‑> ~U

Inherited from: DPObjectRef.by_id

Lookup and retrieve an object from the Datapane Server by its id …

def list() ‑> Iterable[Dict[str, Any]]

Inherited from: DPObjectRef.list

Returns: A list of the Datapane objects of this type that are owned by the user

Methods

def publish(self, name: str, description: str = '', source_url: str = '', visibility: Union[Visibility, NoneType] = None, open: bool = False, tags: List[str] = None, group: Union[str, NoneType] = None, **kwargs) ‑> NoneType

Publish the report, including its attached assets, to the logged-in Datapane Server.

Args

name
The report name - can include spaces, caps, symbols, etc., e.g. "Profit & Loss 2020"
description
A high-level description for the report, this is displayed in searches and thumbnails
source_url
A URL pointing to the source code for the report, e.g. a GitHub repo or a Colab notebook
visibility
one of "PUBLIC" (default on Public), or "PRIVATE" (limited on Public, unlimited on Teams)
open
Open the file in your browser after creating
tags
A list of tags (as strings) used to categorise your report
def save(self, path: str, open: bool = False, name: Union[str, NoneType] = None, author: Union[str, NoneType] = None) ‑> NoneType

Save the report to a local HTML file

Args

path
File path to store the report
open
Open the file in your browser after creating (default: False)
name
Name of the report (optional: uses path if not provided)
author
The report author / email / etc.
def preview(self, width: int = 960, height: int = 700)

Preview the report inside your currently running Jupyter notebook

Args

width
Width of the report preview in Jupyter (default: 600)
height
Height of the report preview in Jupyter (default: 500)
def refresh(self)

Inherited from: DPObjectRef.refresh

Refresh the object with the latest data from the Datapane Server

def delete(self)

Inherited from: DPObjectRef.delete

Delete the object on the server

class Visibility (value, names=None, *, module=None, qualname=None, type=None, start=1)

The report visibility type

Ancestors

  • enum.IntEnum
  • builtins.int
  • enum.Enum

Class variables

var PRIVATE
var PUBLIC
class ReportType (value, names=None, *, module=None, qualname=None, type=None, start=1)

The report type

Ancestors

  • enum.Enum

Class variables

var DASHBOARD
var REPORT
var ARTICLE