Skip to content

Commit

Permalink
docs(codespaces): add example.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijas committed Dec 22, 2023
1 parent b3104b6 commit bf4e90e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
40 changes: 20 additions & 20 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// Adopting the default GitHub codespaces-jupyter template as starter
// https://github.com/github/codespaces-jupyter

// Created from a template: https://github.com/github/codespaces-jupyter
{
"name" : "Sec Parser",
"image": "mcr.microsoft.com/devcontainers/universal:2",
"hostRequirements": {
"cpus": 4
"name": "sec-parser",
"image": "mcr.microsoft.com/devcontainers/universal:2",
"hostRequirements": {
"cpus": 2
},
"waitFor": "onCreateCommand",
"updateContentCommand": "python3 -m pip install -r .devcontainer/requirements.txt",
"postCreateCommand": "",
"customizations": {
"codespaces": {
"openFiles": [
"./.devcontainer/example.py"
]
},
"waitFor": "onCreateCommand",
"updateContentCommand": "python3 -m pip install -r .devcontainer/requirements.txt",
"postCreateCommand": "",
"customizations": {
"codespaces": {
"openFiles": ["./docs/source/notebooks/user_guide.ipynb"]
},
"vscode": {
"extensions": [
"ms-toolsai.jupyter",
"ms-python.python"
]
}
"vscode": {
"extensions": [
"ms-toolsai.jupyter",
"ms-python.python"
]
}
}
}
8 changes: 7 additions & 1 deletion example.py → .devcontainer/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@
# Now, we can parse the filing HTML into a list of semantic elements:
elements: list = sp.Edgar10QParser().parse(html)

print(elements[0])
# Let's print the first 5 elements:
for element in elements[:5]:
element_type = element.__class__.__name__
element_text = element.text
print(f"Element Type: {element_type}")
print(f"Text Content: {element_text}")
print("-" * 40) # Separator for readability
2 changes: 1 addition & 1 deletion .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ipywidgets==7.7.1
sec-parser
sec_downloader
sec-downloader

0 comments on commit bf4e90e

Please sign in to comment.