framework-py 0.1.0.dev0__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.
Files changed (63) hide show
  1. framework/__init__.py +250 -0
  2. framework/__main__.py +89 -0
  3. framework/_assets/hooks/pre-commit +59 -0
  4. framework/_assets/init.sql +63 -0
  5. framework/_assets/schema/layer.v1.json +605 -0
  6. framework/_assets/schema/layers.v1.json +791 -0
  7. framework/_assets/schema/spec.v1.json +604 -0
  8. framework/_log.py +29 -0
  9. framework/_paths.py +45 -0
  10. framework/_secretservice.py +69 -0
  11. framework/_time.py +11 -0
  12. framework/_wincred.py +105 -0
  13. framework/_yaml.py +90 -0
  14. framework/ai.py +204 -0
  15. framework/bootstrap.py +206 -0
  16. framework/cache.py +335 -0
  17. framework/catalog.py +193 -0
  18. framework/cloud.py +899 -0
  19. framework/config_home.py +194 -0
  20. framework/connections.py +442 -0
  21. framework/console.py +41 -0
  22. framework/create.py +579 -0
  23. framework/data.py +519 -0
  24. framework/db.py +222 -0
  25. framework/dotenv.py +79 -0
  26. framework/errors.py +39 -0
  27. framework/global_config.py +238 -0
  28. framework/hooks.py +364 -0
  29. framework/integrity.py +22 -0
  30. framework/notebooks.py +384 -0
  31. framework/outputs.py +324 -0
  32. framework/packages.py +276 -0
  33. framework/project.py +52 -0
  34. framework/py.typed +0 -0
  35. framework/quarto.py +163 -0
  36. framework/scaffold.py +269 -0
  37. framework/scratch.py +108 -0
  38. framework/security.py +646 -0
  39. framework/settings.py +439 -0
  40. framework/spec/__init__.py +0 -0
  41. framework/spec/check.py +211 -0
  42. framework/spec/merge.py +195 -0
  43. framework/spec/resolve.py +254 -0
  44. framework/storage.py +516 -0
  45. framework/templates/defaults.yml +144 -0
  46. framework/templates/gitignore/course +120 -0
  47. framework/templates/gitignore/presentation +114 -0
  48. framework/templates/gitignore/project +108 -0
  49. framework/templates/gitignore/sensitive +139 -0
  50. framework/templates/skills/framework-data/SKILL.md +47 -0
  51. framework/templates/skills/framework-outputs/SKILL.md +68 -0
  52. framework/templates/skills/framework-packages/SKILL.md +33 -0
  53. framework/templates/skills/framework-sensitive-data/SKILL.md +38 -0
  54. framework/templates/skills/framework-workflow/SKILL.md +58 -0
  55. framework/templates/stubs/notebook-default.ipynb +34 -0
  56. framework/templates/stubs/notebook-default.qmd +43 -0
  57. framework/templates/stubs/notebook-minimal.qmd +15 -0
  58. framework/templates/stubs/notebook-revealjs.qmd +34 -0
  59. framework/templates/stubs/script-default.py +18 -0
  60. framework_py-0.1.0.dev0.dist-info/METADATA +111 -0
  61. framework_py-0.1.0.dev0.dist-info/RECORD +63 -0
  62. framework_py-0.1.0.dev0.dist-info/WHEEL +4 -0
  63. framework_py-0.1.0.dev0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,605 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://framework.pub/schema/layer/v1.json",
4
+ "title": "Framework project spec layer",
5
+ "description": "One unmerged layer of a project spec. Every field is optional, and a null map entry removes that key when spec_resolve() merges layers.",
6
+ "type": "object",
7
+ "properties": {
8
+ "spec_version": {
9
+ "const": 1
10
+ },
11
+ "name": {
12
+ "type": "string",
13
+ "minLength": 1
14
+ },
15
+ "type": {
16
+ "type": "string",
17
+ "enum": [
18
+ "project",
19
+ "project_sensitive",
20
+ "course",
21
+ "presentation",
22
+ "bare"
23
+ ]
24
+ },
25
+ "language": {
26
+ "type": "string",
27
+ "enum": [
28
+ "r",
29
+ "python",
30
+ "stata"
31
+ ],
32
+ "description": "Primary language. The R package builds r, the Python package builds python, and fw builds stata (scaffolding only). A layers file with no language means r."
33
+ },
34
+ "author": {
35
+ "type": "object",
36
+ "properties": {
37
+ "name": {
38
+ "type": "string"
39
+ },
40
+ "email": {
41
+ "type": "string"
42
+ },
43
+ "affiliation": {
44
+ "type": "string"
45
+ },
46
+ "orcid": {
47
+ "type": "string"
48
+ },
49
+ "url": {
50
+ "type": "string"
51
+ },
52
+ "affiliations": {
53
+ "type": "array",
54
+ "items": {
55
+ "type": "object",
56
+ "properties": {
57
+ "name": {
58
+ "type": "string",
59
+ "minLength": 1
60
+ },
61
+ "department": {
62
+ "type": "string"
63
+ },
64
+ "city": {
65
+ "type": "string"
66
+ },
67
+ "country": {
68
+ "type": "string"
69
+ }
70
+ },
71
+ "additionalProperties": false
72
+ }
73
+ }
74
+ },
75
+ "additionalProperties": false
76
+ },
77
+ "directories": {
78
+ "type": "object",
79
+ "additionalProperties": {
80
+ "anyOf": [
81
+ {
82
+ "type": "string",
83
+ "pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$))[^\\\\]+$"
84
+ },
85
+ {
86
+ "type": "null"
87
+ }
88
+ ]
89
+ },
90
+ "propertyNames": {
91
+ "pattern": "^[a-z][a-z0-9_]*$"
92
+ }
93
+ },
94
+ "extra_directories": {
95
+ "type": "object",
96
+ "additionalProperties": {
97
+ "anyOf": [
98
+ {
99
+ "$ref": "#/definitions/extra_directory"
100
+ },
101
+ {
102
+ "type": "null"
103
+ }
104
+ ]
105
+ },
106
+ "propertyNames": {
107
+ "pattern": "^[a-z][a-z0-9_]*$"
108
+ }
109
+ },
110
+ "render_dirs": {
111
+ "type": "object",
112
+ "additionalProperties": {
113
+ "anyOf": [
114
+ {
115
+ "type": "string",
116
+ "pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$))[^\\\\]+$"
117
+ },
118
+ {
119
+ "type": "null"
120
+ }
121
+ ]
122
+ },
123
+ "propertyNames": {
124
+ "pattern": "^[a-z][a-z0-9_]*$"
125
+ }
126
+ },
127
+ "packages": {
128
+ "type": "object",
129
+ "properties": {
130
+ "use_renv": {
131
+ "type": "boolean"
132
+ },
133
+ "default_packages": {
134
+ "type": "object",
135
+ "additionalProperties": {
136
+ "anyOf": [
137
+ {
138
+ "$ref": "#/definitions/package"
139
+ },
140
+ {
141
+ "type": "null"
142
+ }
143
+ ]
144
+ },
145
+ "description": "Package name -> spec. JSON object key order is not kept (Postgres JSONB sorts keys).",
146
+ "propertyNames": {
147
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
148
+ }
149
+ }
150
+ },
151
+ "additionalProperties": false
152
+ },
153
+ "git": {
154
+ "type": "object",
155
+ "properties": {
156
+ "use_git": {
157
+ "type": "boolean"
158
+ },
159
+ "hooks": {
160
+ "type": "object",
161
+ "additionalProperties": {
162
+ "anyOf": [
163
+ {
164
+ "type": "boolean"
165
+ },
166
+ {
167
+ "type": "null"
168
+ }
169
+ ]
170
+ },
171
+ "propertyNames": {
172
+ "pattern": "^[a-z][a-z0-9_]*$"
173
+ }
174
+ },
175
+ "gitignore_content": {
176
+ "type": "string"
177
+ }
178
+ },
179
+ "additionalProperties": false
180
+ },
181
+ "ai": {
182
+ "type": "object",
183
+ "properties": {
184
+ "enabled": {
185
+ "type": "boolean"
186
+ },
187
+ "assistants": {
188
+ "type": "object",
189
+ "propertyNames": {
190
+ "enum": [
191
+ "claude",
192
+ "codex",
193
+ "copilot"
194
+ ]
195
+ },
196
+ "additionalProperties": {
197
+ "anyOf": [
198
+ {
199
+ "type": "boolean"
200
+ },
201
+ {
202
+ "type": "null"
203
+ }
204
+ ]
205
+ },
206
+ "description": "Assistant -> true to include. In a layer, false or null removes it."
207
+ },
208
+ "agents_md": {
209
+ "type": "string",
210
+ "enum": [
211
+ "stub",
212
+ "none"
213
+ ]
214
+ }
215
+ },
216
+ "additionalProperties": false
217
+ },
218
+ "scaffold": {
219
+ "type": "object",
220
+ "properties": {
221
+ "seed_on_scaffold": {
222
+ "type": "boolean"
223
+ },
224
+ "seed": {
225
+ "type": "string"
226
+ },
227
+ "set_theme_on_scaffold": {
228
+ "type": "boolean"
229
+ },
230
+ "ggplot_theme": {
231
+ "type": "string"
232
+ },
233
+ "source_all_functions": {
234
+ "type": "boolean"
235
+ },
236
+ "notebook_format": {
237
+ "type": "string",
238
+ "enum": [
239
+ "quarto",
240
+ "rmarkdown",
241
+ "jupyter"
242
+ ]
243
+ },
244
+ "ide": {
245
+ "type": "string",
246
+ "enum": [
247
+ "vscode",
248
+ "positron",
249
+ "rstudio",
250
+ "both",
251
+ "none"
252
+ ]
253
+ }
254
+ },
255
+ "additionalProperties": false
256
+ },
257
+ "quarto": {
258
+ "type": "object",
259
+ "description": "Passed through to _quarto.yml generation"
260
+ },
261
+ "connections": {
262
+ "type": "object",
263
+ "properties": {
264
+ "default_database": {
265
+ "anyOf": [
266
+ {
267
+ "type": "string"
268
+ },
269
+ {
270
+ "type": "null"
271
+ }
272
+ ]
273
+ },
274
+ "default_storage_bucket": {
275
+ "anyOf": [
276
+ {
277
+ "type": "string"
278
+ },
279
+ {
280
+ "type": "null"
281
+ }
282
+ ]
283
+ },
284
+ "databases": {
285
+ "type": "object",
286
+ "additionalProperties": {
287
+ "anyOf": [
288
+ {
289
+ "$ref": "#/definitions/connection"
290
+ },
291
+ {
292
+ "type": "null"
293
+ }
294
+ ]
295
+ },
296
+ "propertyNames": {
297
+ "pattern": "^[a-z][a-z0-9_]*$"
298
+ }
299
+ },
300
+ "storage_buckets": {
301
+ "type": "object",
302
+ "additionalProperties": {
303
+ "anyOf": [
304
+ {
305
+ "$ref": "#/definitions/connection"
306
+ },
307
+ {
308
+ "type": "null"
309
+ }
310
+ ]
311
+ },
312
+ "propertyNames": {
313
+ "pattern": "^[a-z][a-z0-9_]*$"
314
+ }
315
+ }
316
+ },
317
+ "additionalProperties": false
318
+ },
319
+ "security": {
320
+ "type": "object",
321
+ "properties": {
322
+ "sensitive": {
323
+ "type": "boolean"
324
+ }
325
+ },
326
+ "additionalProperties": false
327
+ },
328
+ "env": {
329
+ "type": "object",
330
+ "additionalProperties": {
331
+ "anyOf": [
332
+ {
333
+ "type": "string"
334
+ },
335
+ {
336
+ "type": "null"
337
+ }
338
+ ]
339
+ },
340
+ "description": "Variables written to .env. Secret-looking names must be empty.",
341
+ "propertyNames": {
342
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
343
+ }
344
+ },
345
+ "data_hooks": {
346
+ "type": "object",
347
+ "additionalProperties": {
348
+ "anyOf": [
349
+ {
350
+ "type": "string",
351
+ "pattern": "^[^:]+\\.(R|py)::[A-Za-z_.][A-Za-z0-9._]*$"
352
+ },
353
+ {
354
+ "type": "null"
355
+ }
356
+ ]
357
+ },
358
+ "description": "Directory key -> 'path/to/file.R::function'",
359
+ "propertyNames": {
360
+ "pattern": "^[a-z][a-z0-9_]*$"
361
+ }
362
+ },
363
+ "files": {
364
+ "type": "object",
365
+ "additionalProperties": {
366
+ "anyOf": [
367
+ {
368
+ "$ref": "#/definitions/file"
369
+ },
370
+ {
371
+ "type": "null"
372
+ }
373
+ ]
374
+ },
375
+ "propertyNames": {
376
+ "pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$))[^\\\\]+$"
377
+ }
378
+ },
379
+ "skills": {
380
+ "type": "object",
381
+ "additionalProperties": {
382
+ "anyOf": [
383
+ {
384
+ "$ref": "#/definitions/skill"
385
+ },
386
+ {
387
+ "type": "null"
388
+ }
389
+ ]
390
+ },
391
+ "propertyNames": {
392
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
393
+ }
394
+ },
395
+ "source": {
396
+ "type": "object",
397
+ "properties": {
398
+ "origin": {
399
+ "type": "string",
400
+ "enum": [
401
+ "cloud",
402
+ "cli",
403
+ "r",
404
+ "python"
405
+ ]
406
+ },
407
+ "fragments": {
408
+ "type": "array",
409
+ "items": {
410
+ "type": "object",
411
+ "properties": {
412
+ "kind": {
413
+ "type": "string",
414
+ "enum": [
415
+ "base",
416
+ "facet",
417
+ "blueprint"
418
+ ]
419
+ },
420
+ "key": {
421
+ "type": "string"
422
+ },
423
+ "version": {
424
+ "type": "integer"
425
+ }
426
+ },
427
+ "additionalProperties": false
428
+ }
429
+ },
430
+ "blueprint": {
431
+ "type": "object",
432
+ "properties": {
433
+ "key": {
434
+ "type": "string"
435
+ },
436
+ "version": {
437
+ "type": "integer"
438
+ }
439
+ },
440
+ "additionalProperties": false
441
+ },
442
+ "study_plan": {
443
+ "type": "object",
444
+ "properties": {
445
+ "id": {
446
+ "type": "string"
447
+ },
448
+ "version": {
449
+ "type": "integer"
450
+ }
451
+ },
452
+ "additionalProperties": false
453
+ },
454
+ "framework_version": {
455
+ "type": "string",
456
+ "description": "Version of the R or Python package that created the project"
457
+ },
458
+ "fw_version": {
459
+ "type": "string",
460
+ "description": "Version of fw that created the project (Stata scaffolding)"
461
+ }
462
+ },
463
+ "additionalProperties": false
464
+ }
465
+ },
466
+ "additionalProperties": false,
467
+ "definitions": {
468
+ "package": {
469
+ "type": "object",
470
+ "properties": {
471
+ "source": {
472
+ "type": "string",
473
+ "enum": [
474
+ "cran",
475
+ "github",
476
+ "bioc",
477
+ "pypi"
478
+ ]
479
+ },
480
+ "version": {
481
+ "anyOf": [
482
+ {
483
+ "type": "string"
484
+ },
485
+ {
486
+ "type": "null"
487
+ }
488
+ ]
489
+ },
490
+ "repo": {
491
+ "anyOf": [
492
+ {
493
+ "type": "string"
494
+ },
495
+ {
496
+ "type": "null"
497
+ }
498
+ ]
499
+ },
500
+ "ref": {
501
+ "anyOf": [
502
+ {
503
+ "type": "string"
504
+ },
505
+ {
506
+ "type": "null"
507
+ }
508
+ ]
509
+ },
510
+ "auto_attach": {
511
+ "type": "boolean"
512
+ }
513
+ },
514
+ "additionalProperties": false,
515
+ "required": [
516
+ "source",
517
+ "auto_attach"
518
+ ]
519
+ },
520
+ "extra_directory": {
521
+ "type": "object",
522
+ "properties": {
523
+ "label": {
524
+ "type": "string"
525
+ },
526
+ "path": {
527
+ "type": "string",
528
+ "pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$))[^\\\\]+$"
529
+ }
530
+ },
531
+ "additionalProperties": false,
532
+ "required": [
533
+ "path"
534
+ ]
535
+ },
536
+ "file": {
537
+ "type": "object",
538
+ "properties": {
539
+ "content": {
540
+ "type": "string"
541
+ },
542
+ "template": {
543
+ "type": "boolean",
544
+ "description": "Replace {{project_name}}, {{author}}, {{author_email}}, {{affiliation}}, and {{date}}"
545
+ }
546
+ },
547
+ "additionalProperties": false,
548
+ "required": [
549
+ "content"
550
+ ]
551
+ },
552
+ "skill": {
553
+ "oneOf": [
554
+ {
555
+ "type": "object",
556
+ "properties": {
557
+ "package": {
558
+ "const": true
559
+ }
560
+ },
561
+ "additionalProperties": false,
562
+ "required": [
563
+ "package"
564
+ ]
565
+ },
566
+ {
567
+ "type": "object",
568
+ "properties": {
569
+ "content": {
570
+ "type": "string",
571
+ "minLength": 1,
572
+ "description": "Full SKILL.md text, including frontmatter"
573
+ },
574
+ "files": {
575
+ "type": "object",
576
+ "additionalProperties": {
577
+ "type": "string"
578
+ },
579
+ "propertyNames": {
580
+ "pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$))[^\\\\]+$"
581
+ }
582
+ }
583
+ },
584
+ "additionalProperties": false,
585
+ "required": [
586
+ "content"
587
+ ]
588
+ }
589
+ ]
590
+ },
591
+ "connection": {
592
+ "type": "object",
593
+ "properties": {
594
+ "driver": {
595
+ "type": "string",
596
+ "minLength": 1
597
+ }
598
+ },
599
+ "additionalProperties": true,
600
+ "required": [
601
+ "driver"
602
+ ]
603
+ }
604
+ }
605
+ }