Skip to content

Commit b0e490e

Browse files
dotNomadmarcosnavarro
andauthored
Add quarto version constraints to Quarto docs (#95)
* Use quarto version constraints on quarto docs * Backport quarto requires to extension list * remove yahoo finance calls from quarto-stock jumpstart app * Update manifest for quarto-stock-report-python --------- Co-authored-by: marcosnavarro <[email protected]>
1 parent 8150c9a commit b0e490e

File tree

7 files changed

+1308
-27
lines changed

7 files changed

+1308
-27
lines changed

extensions.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,24 @@
256256
"version": "1.0.0",
257257
"released": "2025-04-14T20:05:36Z",
258258
"url": "https://github.com/posit-dev/connect-extensions/releases/download/quarto-document%40v1.0.0/quarto-document.tar.gz",
259-
"minimumConnectVersion": "2025.04.0"
259+
"minimumConnectVersion": "2025.04.0",
260+
"requiredEnvironment": {
261+
"quarto": {
262+
"requires": "~=1.0"
263+
}
264+
}
260265
},
261266
"versions": [
262267
{
263268
"version": "1.0.0",
264269
"released": "2025-04-14T20:05:36Z",
265270
"url": "https://github.com/posit-dev/connect-extensions/releases/download/quarto-document%40v1.0.0/quarto-document.tar.gz",
266-
"minimumConnectVersion": "2025.04.0"
271+
"minimumConnectVersion": "2025.04.0",
272+
"requiredEnvironment": {
273+
"quarto": {
274+
"requires": "~=1.0"
275+
}
276+
}
267277
}
268278
]
269279
},
@@ -280,6 +290,9 @@
280290
"requiredEnvironment": {
281291
"python": {
282292
"requires": "~=3.9"
293+
},
294+
"quarto": {
295+
"requires": "~=1.4"
283296
}
284297
}
285298
},
@@ -292,6 +305,9 @@
292305
"requiredEnvironment": {
293306
"python": {
294307
"requires": "~=3.9"
308+
},
309+
"quarto": {
310+
"requires": "~=1.4"
295311
}
296312
}
297313
}

extensions/quarto-document/manifest.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
"description": "This Quarto example shows how a basic document can present diagrams and interactivity.",
3232
"homepage": "https://github.com/posit-dev/connect-extensions/tree/main/extensions/quarto-document",
3333
"minimumConnectVersion": "2025.04.0",
34-
"version": "1.0.0"
34+
"version": "1.0.1"
35+
},
36+
"environment": {
37+
"quarto": {
38+
"requires": "~=1.0"
39+
}
3540
}
3641
}

extensions/quarto-stock-report-python/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/.quarto/
2-
*.csv
2+
data.csv
33
index.html
44
index_files
55
index.ipynb

extensions/quarto-stock-report-python/gspc.csv

Lines changed: 1258 additions & 0 deletions
Large diffs are not rendered by default.

extensions/quarto-stock-report-python/index.qmd

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,27 @@ attachments:
1010
email-preview: true
1111
---
1212

13-
## Report for TSLA
13+
## Report for GSPC
1414

1515
```{python}
1616
#| echo: true
1717
1818
import pandas as pd
19-
import yfinance as yf
2019
import datetime
20+
```
2121

22-
tsla = yf.Ticker("TSLA")
23-
hist = tsla.history("5y")
22+
```{python}
23+
#| eval: false
24+
#| echo: false
25+
# set eval: true to fetch updated data
26+
import yfinance as yf
27+
spx = yf.Ticker("^GSPC")
28+
hist = spx.history("5y")
29+
hist.to_csv("gspc.csv")
30+
```
2431

32+
```{python}
33+
hist = pd.read_csv("gspc.csv", parse_dates=[0], index_col=0)
2534
hist['Change'] = hist['Close'] - hist['Open']
2635
2736
latest = hist.last_valid_index()
@@ -56,7 +65,7 @@ df
5665
```{python}
5766
#| echo: false
5867
#| label: fig-history
59-
#| fig-cap: "TSLA price history"
68+
#| fig-cap: "GSPC price history"
6069
6170
_ = hist['Close'].plot(grid=True)
6271
```
@@ -86,7 +95,7 @@ prices_90d.to_csv("data.csv")
8695
## Email
8796

8897
This report also produces an email that is sent to key stakeholders with summary
89-
information.
98+
information.
9099

91100
::: {.email}
92101

@@ -101,7 +110,7 @@ abschange = abs(change)
101110
updown = "up"
102111
if change < 0:
103112
updown = "down"
104-
print(f"TSLA is {updown} today by ${abschange:.2f}")
113+
print(f"GSPC is {updown} today by ${abschange:.2f}")
105114
```
106115
:::
107116

@@ -111,7 +120,7 @@ Hello Team,
111120
#| echo: false
112121
#| output: asis
113122
114-
print(f"Here are the latest stock prices for **TSLA** as of {datetime.date.today()}:")
123+
print(f"Here are the latest stock prices for **GSPC** as of {datetime.date.today()}:")
115124
```
116125

117126
```{python}

extensions/quarto-stock-report-python/manifest.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
"description": "An example of how you might automate regular updates using a data source",
1111
"homepage": "https://github.com/posit-dev/connect-extensions/tree/main/extensions/quarto-stock-report-python",
1212
"minimumConnectVersion": "2025.04.0",
13-
"version": "1.0.0"
13+
"version": "1.0.1"
1414
},
1515
"environment": {
1616
"python": {
1717
"requires": "~=3.9"
18+
},
19+
"quarto": {
20+
"requires": "~=1.4"
1821
}
1922
},
2023
"quarto": {
@@ -32,26 +35,17 @@
3235
}
3336
},
3437
"files": {
35-
"requirements.txt": {
36-
"checksum": "1b9e705f62a822cffaa4dc0e988101b4"
37-
},
38-
".gitignore": {
39-
"checksum": "ae206a13f5875901e752811238e8fdbd"
40-
},
41-
"README.md": {
42-
"checksum": "837f74720c4532629d02fd4bff3df83b"
43-
},
4438
"_quarto.yml": {
4539
"checksum": "35b4c4c58cce875b126683c525ad40f4"
4640
},
4741
"index.qmd": {
4842
"checksum": "6fb0db80d26eab1544afdcbc91df228b"
4943
},
50-
"index.quarto_ipynb": {
51-
"checksum": "04ad8e09510236db1b397038a4c06186"
44+
"gspc.csv": {
45+
"checksum": "f74c93cd12f334a4923d6fa4d81cdd1e"
5246
},
53-
"thumbnail.jpg": {
54-
"checksum": "8db36358d1e9dbab78f8ffef39846eee"
47+
"requirements.txt": {
48+
"checksum": "1b9e705f62a822cffaa4dc0e988101b4"
5549
}
5650
}
5751
}

extensions/quarto-stock-report-python/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ ipywidgets==8.1.2
88

99
matplotlib==3.8.3
1010
pandas==2.2.1
11-
yfinance==0.2.54

0 commit comments

Comments
 (0)