-
Notifications
You must be signed in to change notification settings - Fork 45
/
quickstart.py
80 lines (58 loc) · 1.66 KB
/
quickstart.py
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
"""
SPEC Quickstart
===============
Quickly setup stub for new SPEC.
"""
from datetime import datetime
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".tools"))
from tools import prompt
now = datetime.now()
author = prompt("Your Name")
email = prompt("Your Email Address")
number = prompt("SPEC number", validate=lambda x: int(x))
title = prompt("SPEC title")
filename = f"spec-{number:04d}/index.md"
text = f"""---
title: "SPEC {number} — {title}"
number: {number}
date: {now.strftime("%Y-%m-%d")}
author:
- "{author} <{email}>"
discussion: https://discuss.scientific-python.org/t/
is-draft: true
endorsed-by:
---
## Description
<!--
Briefly and clearly describe the recommendation.
-->
### Core Project Endorsement
<!--
Briefly discuss what it means for a core project to endorse this SPEC.
-->
### Ecosystem Adoption
<!--
Briefly discuss what it means for a project to adopt this SPEC.
-->
#### Badges
Projects can highlight their adoption of this SPEC by including a SPEC badge.
{{{{< spec_badge number="{number}" title="{title}" >}}}}
To indicate adoption of multiple SPECS with one badge, see [this](../purpose-and-process/#badges).
## Implementation
<!--
Discuss how this would be implemented.
Explain the general need and the advantages of this specific recommendation.
If relevant, include examples of how the new functionality would be used,
intended use-cases, and pseudo-code illustrating its use.
-->
## Notes
<!--
Include a bulleted list of annotated links, comments,
and other ancillary information as needed.
-->
"""
os.makedirs(os.path.dirname(filename), exist_ok=True)
with open(filename, "w") as file:
file.write(text)