framework-py 0.1.0.dev21__py3-none-any.whl → 0.1.0.dev22__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -154,6 +154,10 @@
154
154
  "use_renv": {
155
155
  "type": "boolean"
156
156
  },
157
+ "project_ado": {
158
+ "type": "boolean",
159
+ "description": "Stata: install packages into ado/plus in the project folder."
160
+ },
157
161
  "default_packages": {
158
162
  "type": "object",
159
163
  "additionalProperties": {
@@ -254,6 +258,14 @@
254
258
  "ggplot_theme": {
255
259
  "type": "string"
256
260
  },
261
+ "matplotlib_style": {
262
+ "type": "string",
263
+ "description": "Python: the matplotlib style scaffold() applies when set_theme_on_scaffold is on, such as seaborn-v0_8-whitegrid."
264
+ },
265
+ "stata_scheme": {
266
+ "type": "string",
267
+ "description": "Stata: the graph scheme fw_scaffold sets when set_theme_on_scaffold is on, such as s2color."
268
+ },
257
269
  "source_all_functions": {
258
270
  "type": "boolean"
259
271
  },
@@ -564,7 +576,9 @@
564
576
  "cran",
565
577
  "github",
566
578
  "bioc",
567
- "pypi"
579
+ "pypi",
580
+ "ssc",
581
+ "net"
568
582
  ]
569
583
  },
570
584
  "version": {
@@ -597,6 +611,17 @@
597
611
  }
598
612
  ]
599
613
  },
614
+ "url": {
615
+ "anyOf": [
616
+ {
617
+ "type": "string"
618
+ },
619
+ {
620
+ "type": "null"
621
+ }
622
+ ],
623
+ "description": "Stata net packages: the folder or web address that holds the .pkg file."
624
+ },
600
625
  "auto_attach": {
601
626
  "type": "boolean"
602
627
  }
@@ -199,7 +199,9 @@
199
199
  "cran",
200
200
  "github",
201
201
  "bioc",
202
- "pypi"
202
+ "pypi",
203
+ "ssc",
204
+ "net"
203
205
  ]
204
206
  },
205
207
  "version": {
@@ -232,6 +234,17 @@
232
234
  }
233
235
  ]
234
236
  },
237
+ "url": {
238
+ "anyOf": [
239
+ {
240
+ "type": "string"
241
+ },
242
+ {
243
+ "type": "null"
244
+ }
245
+ ],
246
+ "description": "Stata net packages: the folder or web address that holds the .pkg file."
247
+ },
235
248
  "auto_attach": {
236
249
  "type": "boolean"
237
250
  }
@@ -602,6 +615,10 @@
602
615
  "use_renv": {
603
616
  "type": "boolean"
604
617
  },
618
+ "project_ado": {
619
+ "type": "boolean",
620
+ "description": "Stata: install packages into ado/plus in the project folder."
621
+ },
605
622
  "default_packages": {
606
623
  "type": "object",
607
624
  "additionalProperties": {
@@ -702,6 +719,14 @@
702
719
  "ggplot_theme": {
703
720
  "type": "string"
704
721
  },
722
+ "matplotlib_style": {
723
+ "type": "string",
724
+ "description": "Python: the matplotlib style scaffold() applies when set_theme_on_scaffold is on, such as seaborn-v0_8-whitegrid."
725
+ },
726
+ "stata_scheme": {
727
+ "type": "string",
728
+ "description": "Stata: the graph scheme fw_scaffold sets when set_theme_on_scaffold is on, such as s2color."
729
+ },
705
730
  "source_all_functions": {
706
731
  "type": "boolean"
707
732
  },
@@ -134,6 +134,10 @@
134
134
  "use_renv": {
135
135
  "type": "boolean"
136
136
  },
137
+ "project_ado": {
138
+ "type": "boolean",
139
+ "description": "Stata: install packages into ado/plus in the project folder."
140
+ },
137
141
  "default_packages": {
138
142
  "type": "object",
139
143
  "additionalProperties": {
@@ -226,6 +230,14 @@
226
230
  "ggplot_theme": {
227
231
  "type": "string"
228
232
  },
233
+ "matplotlib_style": {
234
+ "type": "string",
235
+ "description": "Python: the matplotlib style scaffold() applies when set_theme_on_scaffold is on, such as seaborn-v0_8-whitegrid."
236
+ },
237
+ "stata_scheme": {
238
+ "type": "string",
239
+ "description": "Stata: the graph scheme fw_scaffold sets when set_theme_on_scaffold is on, such as s2color."
240
+ },
229
241
  "source_all_functions": {
230
242
  "type": "boolean"
231
243
  },
@@ -545,7 +557,9 @@
545
557
  "cran",
546
558
  "github",
547
559
  "bioc",
548
- "pypi"
560
+ "pypi",
561
+ "ssc",
562
+ "net"
549
563
  ]
550
564
  },
551
565
  "version": {
@@ -578,6 +592,17 @@
578
592
  }
579
593
  ]
580
594
  },
595
+ "url": {
596
+ "anyOf": [
597
+ {
598
+ "type": "string"
599
+ },
600
+ {
601
+ "type": "null"
602
+ }
603
+ ],
604
+ "description": "Stata net packages: the folder or web address that holds the .pkg file."
605
+ },
581
606
  "auto_attach": {
582
607
  "type": "boolean"
583
608
  }
@@ -0,0 +1,30 @@
1
+ {
2
+ "id": "stata-data-tools",
3
+ "name": "Stata data tools",
4
+ "description": "gtools for fast collapse, egen, and reshape on large data, and missings, distinct, and labutil to check and label data.",
5
+ "language": [
6
+ "stata"
7
+ ],
8
+ "layer": {
9
+ "packages": {
10
+ "default_packages": {
11
+ "gtools": {
12
+ "source": "ssc",
13
+ "auto_attach": false
14
+ },
15
+ "missings": {
16
+ "source": "ssc",
17
+ "auto_attach": false
18
+ },
19
+ "distinct": {
20
+ "source": "ssc",
21
+ "auto_attach": false
22
+ },
23
+ "labutil": {
24
+ "source": "ssc",
25
+ "auto_attach": false
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "id": "stata-fixed-effects",
3
+ "name": "Stata fixed effects",
4
+ "description": "reghdfe and ftools for regressions with many fixed effects, ppmlhdfe for Poisson models, and ivreghdfe with ivreg2 and ranktest for instrumental variables.",
5
+ "language": [
6
+ "stata"
7
+ ],
8
+ "layer": {
9
+ "packages": {
10
+ "default_packages": {
11
+ "reghdfe": {
12
+ "source": "ssc",
13
+ "auto_attach": false
14
+ },
15
+ "ftools": {
16
+ "source": "ssc",
17
+ "auto_attach": false
18
+ },
19
+ "ppmlhdfe": {
20
+ "source": "ssc",
21
+ "auto_attach": false
22
+ },
23
+ "ivreghdfe": {
24
+ "source": "ssc",
25
+ "auto_attach": false
26
+ },
27
+ "ivreg2": {
28
+ "source": "ssc",
29
+ "auto_attach": false
30
+ },
31
+ "ranktest": {
32
+ "source": "ssc",
33
+ "auto_attach": false
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "id": "stata-graphs",
3
+ "name": "Stata graphs",
4
+ "description": "coefplot for coefficient plots, binscatter for binned scatterplots, and grstyle, palettes, colrspace, and schemepack for graph styles and colors.",
5
+ "language": [
6
+ "stata"
7
+ ],
8
+ "layer": {
9
+ "packages": {
10
+ "default_packages": {
11
+ "coefplot": {
12
+ "source": "ssc",
13
+ "auto_attach": false
14
+ },
15
+ "binscatter": {
16
+ "source": "ssc",
17
+ "auto_attach": false
18
+ },
19
+ "grstyle": {
20
+ "source": "ssc",
21
+ "auto_attach": false
22
+ },
23
+ "palettes": {
24
+ "source": "ssc",
25
+ "auto_attach": false
26
+ },
27
+ "colrspace": {
28
+ "source": "ssc",
29
+ "auto_attach": false
30
+ },
31
+ "schemepack": {
32
+ "source": "ssc",
33
+ "auto_attach": false
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "id": "stata-tables",
3
+ "name": "Stata regression tables",
4
+ "description": "estout for esttab and estpost tables, and outreg2 for Word and Excel tables of estimates.",
5
+ "language": [
6
+ "stata"
7
+ ],
8
+ "layer": {
9
+ "packages": {
10
+ "default_packages": {
11
+ "estout": {
12
+ "source": "ssc",
13
+ "auto_attach": false
14
+ },
15
+ "outreg2": {
16
+ "source": "ssc",
17
+ "auto_attach": false
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
framework/create.py CHANGED
@@ -138,6 +138,12 @@ def _sections(spec: Mapping[str, Any]) -> dict[str, Any]:
138
138
  "seed_on_scaffold": scaffold.get("seed_on_scaffold", False),
139
139
  "seed": scaffold.get("seed", ""),
140
140
  "source_all_functions": scaffold.get("source_all_functions", True),
141
+ # The plot style scaffold() applies, as R's ggplot2 theme
142
+ **{
143
+ k: scaffold[k]
144
+ for k in ("set_theme_on_scaffold", "matplotlib_style")
145
+ if scaffold.get(k) is not None
146
+ },
141
147
  **({"workflow": scaffold["workflow"]} if scaffold.get("workflow") else {}),
142
148
  "notebook_format": scaffold.get("notebook_format")
143
149
  or ("quarto" if spec_tool_on(spec, "quarto") else "jupyter"),
@@ -593,7 +599,14 @@ def _defaults_layer(settings: Mapping[str, Any], type: str) -> dict[str, Any]:
593
599
  layer["author"] = author_normalize(settings["author"])
594
600
  scaffold = defaults.get("scaffold")
595
601
  if isinstance(scaffold, dict):
596
- keys = ("seed_on_scaffold", "seed", "source_all_functions", "ide")
602
+ keys = (
603
+ "seed_on_scaffold",
604
+ "seed",
605
+ "set_theme_on_scaffold",
606
+ "matplotlib_style",
607
+ "source_all_functions",
608
+ "ide",
609
+ )
597
610
  layer["scaffold"] = {k: scaffold[k] for k in keys if k in scaffold}
598
611
  if "seed" in layer["scaffold"]:
599
612
  layer["scaffold"]["seed"] = str(layer["scaffold"]["seed"])
framework/features.py CHANGED
@@ -147,7 +147,10 @@ def _pick(ids: Iterable[str], kind: str, label: str) -> list[dict[str, Any]]:
147
147
  definition = sets.get(set_id)
148
148
  if definition is None:
149
149
  available = ", ".join(i for i, d in sets.items() if _for_python(d))
150
- raise FrameworkError(f"Unknown {label}: {set_id}. Available: {available}")
150
+ raise FrameworkError(
151
+ f"Unknown {label}: {set_id}. Available offline: {available}. "
152
+ "Other sets require Framework Cloud; sign in and resolve the project online."
153
+ )
151
154
  if not _for_python(definition):
152
155
  raise FrameworkError(f"The {definition['name']} {label} isn't available for Python.")
153
156
  prefix = "packages-" if kind == "packages" else "skills-"
framework/scaffold.py CHANGED
@@ -120,6 +120,37 @@ def _set_seed(config: dict[str, Any]) -> int | None:
120
120
  return value
121
121
 
122
122
 
123
+ def _set_theme(config: dict[str, Any]) -> str | None:
124
+ """Apply the matplotlib style when ``set_theme_on_scaffold`` is on, as R sets
125
+ its ggplot2 theme: ``matplotlib_style`` from ``scaffold:``, then ``options:``,
126
+ then the top level. A missing style or matplotlib warns and changes nothing.
127
+ """
128
+ if _first(config, "set_theme_on_scaffold") is not True:
129
+ return None
130
+ style = str(_first(config, "matplotlib_style") or "").strip()
131
+ if not style:
132
+ return None
133
+ try:
134
+ import matplotlib.style
135
+ except ImportError:
136
+ warnings.warn(
137
+ "set_theme_on_scaffold is on, but matplotlib is not installed.",
138
+ FrameworkWarning,
139
+ stacklevel=3,
140
+ )
141
+ return None
142
+ if style != "default" and style not in matplotlib.style.available:
143
+ warnings.warn(
144
+ f"matplotlib style '{style}' not found, so scaffold() left the style alone.",
145
+ FrameworkWarning,
146
+ stacklevel=3,
147
+ )
148
+ return None
149
+ matplotlib.style.use(style)
150
+ inform(f"matplotlib style set to {style}.")
151
+ return style
152
+
153
+
123
154
  def _top_level_modules(folder: Path) -> list[tuple[str, str]]:
124
155
  """The modules a folder provides, as (module name, entry name) pairs."""
125
156
  found = []
@@ -196,6 +227,7 @@ def scaffold(settings_file: str | Path | None = None) -> Path:
196
227
  - creates the settings' private folders that are missing (a fresh checkout has
197
228
  none, since git ignores them),
198
229
  - sets the random seed when ``seed_on_scaffold`` is on (or ``FW_SEED`` is set),
230
+ - applies ``matplotlib_style`` when ``set_theme_on_scaffold`` is on,
199
231
  - puts the project's ``functions`` folder on the import path, and
200
232
  - runs ``scaffold.py`` from the project root, if there is one.
201
233
 
@@ -232,6 +264,7 @@ def scaffold(settings_file: str | Path | None = None) -> Path:
232
264
  # code that saves into them works
233
265
  _create_private_folders(root, config)
234
266
  _set_seed(config)
267
+ _set_theme(config)
235
268
  _add_function_folders(config, root)
236
269
 
237
270
  script = root / "scaffold.py"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: framework-py
3
- Version: 0.1.0.dev21
3
+ Version: 0.1.0.dev22
4
4
  Summary: Structured data science projects: a data catalog, integrity tracking, caching, outputs, and AI guardrails
5
5
  Project-URL: Homepage, https://framework.pub
6
6
  Project-URL: Source, https://github.com/frameworktools/framework-py
@@ -29,14 +29,14 @@ framework/cloud.py,sha256=U9oy1nrt_puGFPKvnC3CFqifzZEhHKhPxvY4iPtMAIc,64083
29
29
  framework/config_home.py,sha256=iSb0VuENgNOSnsZ_v53xFqjRiGgrB7OzZbHbyDOqKzs,8265
30
30
  framework/connections.py,sha256=VUtT1kU3Z1kMxcYGnEzaEwgCvjeU5E71PxJAt8Ppzyw,32741
31
31
  framework/console.py,sha256=zQ0LuFDcxe1W1kuc5E1bJ03h8d3cvwFoqDT8dAJQyN0,1267
32
- framework/create.py,sha256=XTLUsMu2PpVhBB9k3spSNJZSDzshY-3JOcLJJost7ho,52576
32
+ framework/create.py,sha256=sEWX_a250Ai47708gvi1wF69nLi4rD2aPWRUR6GWsM4,52954
33
33
  framework/data.py,sha256=5EwVKFwXABIhbEuf2MsvS8v_yJJ27upG0itSYA6N5mo,31557
34
34
  framework/data_registry.py,sha256=EOR6eD2xH9BoCKtAjWjnu6XRofqG0v3DnpOkmeaPPWI,22496
35
35
  framework/db.py,sha256=Wruez2V352xA3gjk5RcUi_0zncFsDwTs9Gwa2hXBY3Y,8099
36
36
  framework/display.py,sha256=0FuKUt67uf5h1WjD4bwzoruc2XAN4y_j3mz_f5FskhE,5334
37
37
  framework/dotenv.py,sha256=6YQVR8d0CnHXHAYxvP3E4Am4Ei9mzqN2g63w_ft7qa0,4642
38
38
  framework/errors.py,sha256=M0bQwnaBH_DE5n5QgHp_0S-SEwMeUxh9Kbx7n2wrVzw,1201
39
- framework/features.py,sha256=abwC9XCdC0Mm-WFBN-Qw7ztBiFm_mWLqftl7MTNWjc8,7595
39
+ framework/features.py,sha256=NlR-0Xa4_d_nEBX9MicVyWqE_5L1-sA-zF_pJeNWznw,7729
40
40
  framework/global_config.py,sha256=fYLaxN_6Wc2xrIASn77dWkvGR3uuX-111bvfFPB82A4,11036
41
41
  framework/hooks.py,sha256=7FbEWBeMaI0QG7lW1myc3KjVmHd92MqhNjuFoTv1OFQ,21204
42
42
  framework/integrity.py,sha256=2hXk95tlNGs6HVTFA0AqcPWQg2AiO6Hy0APMIXHpCTU,586
@@ -47,7 +47,7 @@ framework/project.py,sha256=1aMzfqLZVkxdImyG3ZQcI-ayfV7Rc3Lrqv1JCsY0GVI,5719
47
47
  framework/publish_bundle.py,sha256=0vOrLZXSbdV2Fl05smq-2-04Fsts0na3rB_Y0mCOcuY,28802
48
48
  framework/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  framework/quarto.py,sha256=FkzXmjd4gngH7CY3g6qs1UZOhU57_TFcn29tc-E6Aqo,17653
50
- framework/scaffold.py,sha256=tmNoe2SyGZxY20hTszymUzBo71Ht_cg9F_J8hbjicsY,14750
50
+ framework/scaffold.py,sha256=ku_rFPcOcV77ZxCJSG1tdxAqJhriuTuA6j2jOmjBaIs,15958
51
51
  framework/scratch.py,sha256=idxthUR5BIMX7FIGS7KzIuhOrO3-HKLbBsV8It3EEE4,3890
52
52
  framework/security.py,sha256=-x66bSIIE_xOzkTf5Ojt7xIECKuAIpKVJZ5TtIGrwys,51147
53
53
  framework/settings.py,sha256=Sb2YyE53aYLWPj423P-pQVCvRpLsiHydgZh2K0luTQQ,23893
@@ -67,9 +67,9 @@ framework/_assets/features/targets.json,sha256=zvAJ909ZFydXLUK5xY30yjbn-uKxB7NZ9
67
67
  framework/_assets/features/uv.json,sha256=TbIuWljGbZdPermU6C3OGbRzXL51iNoolqQ27FgMpRs,316
68
68
  framework/_assets/hooks/pre-commit,sha256=R_RZworymj2V5TT0VG8xEEooRvkEm7rRThFI3hCrahk,2548
69
69
  framework/_assets/schema/docs-reference.v1.json,sha256=-_nXHPleVjwtls9AheU-CiTlq1q5isIEohqj39Ief2o,5931
70
- framework/_assets/schema/layer.v1.json,sha256=qi_3Ybl0IGEq8jcx99AO3zJY5EaCqHBel6TtQolme68,19553
71
- framework/_assets/schema/layers.v1.json,sha256=DDsfetRyQLtTtoxXjh94th6daIu2h-IdOm5FkuYwbd4,26218
72
- framework/_assets/schema/spec.v1.json,sha256=lfbr0pdFRc-6emp33C2nmvaB-9ZEfoVI9gCxnzpuYkM,19109
70
+ framework/_assets/schema/layer.v1.json,sha256=fvAmDCLPlwdjx1UP8Ewj7PZSekGQ0mW_A1xQGDUUgGE,20416
71
+ framework/_assets/schema/layers.v1.json,sha256=XYDJiYN0xk2AByrb2FoVP1Ibmbv8AneZ0IzUOuy0juw,27129
72
+ framework/_assets/schema/spec.v1.json,sha256=pwgaUT2gdStX2HyEoKgyWDsmJ-OR7vUBid7giYvx-xg,19972
73
73
  framework/_assets/sets/packages/bayes-r.json,sha256=AoP3IiEg3KKJhZxU6cYEAqweNk9KuzGim9oSERzayzU,1258
74
74
  framework/_assets/sets/packages/causal-inference-r.json,sha256=hcqkYaxO3e3OJvKU0AIc1OdSxZNPazHu65Yw_Mted_k,787
75
75
  framework/_assets/sets/packages/easystats-r.json,sha256=YhbgOTBZzcl0FwVzZ0_RerMqO-yGS-I54jtz0CblwpY,1288
@@ -87,6 +87,10 @@ framework/_assets/sets/packages/regression-r.json,sha256=hZIGEYhNCBiIQgZ35UGeKlt
87
87
  framework/_assets/sets/packages/shiny-python.json,sha256=gg8LY5lfhNNaV_nu5U3G_Xadg2VUVDxugnvVRWyL6Ps,644
88
88
  framework/_assets/sets/packages/shiny-r.json,sha256=qZExdMmG1qLi2_elgChdg14Y4TUgp3x_F8PEex26gbs,707
89
89
  framework/_assets/sets/packages/spatial-r.json,sha256=B1G6fk-uHVemHaPVRDXvmad8OXgJk5FoxnjjfCOWMaI,502
90
+ framework/_assets/sets/packages/stata-data-tools.json,sha256=Hcs5wb4CIpeeBUUY0UC15Edi_K1b0URrnfg7BOynkW8,672
91
+ framework/_assets/sets/packages/stata-fixed-effects.json,sha256=JVgtLS7CqRajNvtcbi91WHnDhyAFTefCExfV-DkPQHU,895
92
+ framework/_assets/sets/packages/stata-graphs.json,sha256=TsVbMz5RDR9dR67v_XSIazDwi-HfW_nqIlPmw_lzEB0,879
93
+ framework/_assets/sets/packages/stata-tables.json,sha256=Iwtks7P7cgXkeU9vUM9xu0-32pOJslkWYLgla4EREfY,463
90
94
  framework/_assets/sets/packages/survey-r.json,sha256=n474UHUWKXuKz_XcsksyzVgpga_l9LuMmrJDj64b95k,416
91
95
  framework/_assets/sets/packages/survival-r.json,sha256=_dl_8Q0lObIrRrerabe-cYbaH-pKMqbxIClgDUnbpr8,632
92
96
  framework/_assets/sets/packages/tables-r.json,sha256=vaHPQom_7aAl2bvp1K0Zqdzmassl0gKPhlCgm_WiKkw,643
@@ -135,7 +139,7 @@ framework/templates/stubs/notebook-default.qmd,sha256=8Js1S2BcHYeQWmJS-kt31gBvIj
135
139
  framework/templates/stubs/notebook-minimal.qmd,sha256=2U2k8judffhrh_6m6r6OAbQBCYEtViAjeKRBqBYCJTM,178
136
140
  framework/templates/stubs/notebook-revealjs.qmd,sha256=_ztT_gHoudpB5DIjlbvtB5zQ8163DeV8xbWcT-HgJrI,409
137
141
  framework/templates/stubs/script-default.py,sha256=vbWqgW0_rHot17mQC3tYb92g_9L-cbTOeL3y99BRrSk,216
138
- framework_py-0.1.0.dev21.dist-info/METADATA,sha256=fAzzBzJZyVMylTXE3dfOHzfh0jnclJFTnKnWMoMxDHw,4647
139
- framework_py-0.1.0.dev21.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
140
- framework_py-0.1.0.dev21.dist-info/licenses/LICENSE,sha256=giOOgSwALkZimC7uhLZQK8Untez641bLW1-2-Cjvmq0,1072
141
- framework_py-0.1.0.dev21.dist-info/RECORD,,
142
+ framework_py-0.1.0.dev22.dist-info/METADATA,sha256=vR67YetfenMQ0yvq9bNDuoQY-FOgV-ar6g-zRBbF76M,4647
143
+ framework_py-0.1.0.dev22.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
144
+ framework_py-0.1.0.dev22.dist-info/licenses/LICENSE,sha256=giOOgSwALkZimC7uhLZQK8Untez641bLW1-2-Cjvmq0,1072
145
+ framework_py-0.1.0.dev22.dist-info/RECORD,,