You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-4
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,12 @@ If you want the full details of **any** SOA table, you can use the lower level `
15
15
```py
16
16
from pymort import MortXML
17
17
# load the 2017 Loaded CSO Composite Gender-Blended 20% Male ALB table (tableId = 3282)
18
-
xml = MortXML(3282)
18
+
xml = MortXML.from_id(3282)
19
+
# you can load from a file path on your computer
20
+
xml_from_path = MortXML.from_path("t3282.xml")
21
+
# you can load from raw xml text
22
+
xml_str = Path("t3282.xml").read_text()
23
+
xml_from_str = MortXML(xml_str)
19
24
```
20
25
21
26
This `MortXML` class is a wrapper around the [underlying XML](https://mort.soa.org/About.aspx). The autocompletions you get on attributes improve the developer experience over using the underlying XML directly.
@@ -34,7 +39,7 @@ For a select and ultimate table we can retrieve rates as follows.
34
39
```py
35
40
from pymort import MortXML
36
41
# Table 3265 is 2015 VBT Smoker Distinct Male Non-Smoker ANB, see https://mort.soa.org/
37
-
xml = MortXML(3265)
42
+
xml = MortXML.from_id(3265)
38
43
# This is the select table as a MultiIndex (age/duration) DataFrame.
39
44
xml.Tables[0].Values
40
45
# This is the minimum value of the issue age axis on the select table
0 commit comments