Coverage for src/ipyvizzustory/env/py/story.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.5.4, created at 2024-07-10 10:22 +0000

1"""A module for working with presentation stories in `Python` environment.""" 

2 

3from typing import Optional 

4 

5from ipyvizzu import Data, Style 

6 

7from ipyvizzustory.storylib.story import Story as StoryLib 

8 

9 

10class Story(StoryLib): 

11 """A class for representing a presentation story in `Python` environment.""" 

12 

13 def __init__(self, data: Data, style: Optional[Style] = None): 

14 """ 

15 Presentation Story constructor. 

16 

17 Args: 

18 data: Data set for the whole presentation story. 

19 After initialization `data` can not be modified, 

20 but it can be filtered. 

21 style: Style settings for the presentation story. 

22 `style` can be changed at each presentation step. 

23 """ 

24 

25 super().__init__(data=data, style=style) 

26 

27 def play(self) -> str: 

28 """ 

29 A method for returning the assembled `HTML` code in `Python` environment. 

30 

31 Returns: 

32 The assembled `HTML` code as string. 

33 """ 

34 

35 return self.to_html()