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)

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

Args

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

Returns

A Report document object that can be published, saved, etc.

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: Optional[str] = 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: Visibility = Visibility.PRIVATE, open: bool = False, tags: List[str] = None, group: Optional[str] = None, **kwargs) ‑> NoneType

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

Args

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

Save the report document to a local HTML file

Args

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

Preview the document inside your currently running Jupyter notebook

Args

width
Width of the preview in Jupyter (default: 960)
height
Height of the preview in Jupyter (default: 700)
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 document type

Ancestors

  • enum.Enum

Class variables

var DASHBOARD
var REPORT
var ARTICLE