1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Model example\n",
"\n",
"This notebook illustrates basic functionality with the `model` package that apply complex transformations on certificates.\n",
"\n",
"```{note}\n",
"You probably don't need to use this. Instead, you should use `CCDataset` or `FIPSDataset` classes to handle the transformations for yourself.\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from sec_certs.dataset import CCDataset\n",
"from sec_certs.model import SARTransformer"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"dset: CCDataset = CCDataset.from_web()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## SARTransformer"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"transformer = SARTransformer().fit(dset.certs.values())\n",
"extracted_sars = {x.dgst: transformer.transform_single_cert(x) for x in dset}"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.13 ('venv': venv)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "a5b8c5b127d2cfe5bc3a1c933e197485eb9eba25154c3661362401503b4ef9d4"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|