Skip to content

Commit e42abcb

Browse files
Add propagate_authorship.py script
1 parent b3fe4dd commit e42abcb

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

scripts/propagate_authorship.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import os, datetime
2+
3+
AUTH_BLOCK = f"""
4+
Digital Crystal Protocol — Authorship Propagation
5+
6+
Author: Donald Paul Smith aka FatherTimeSDKP
7+
ORCID: 0009-0003-7925-1653
8+
DOI(s): 10.17605/OSF.IO/DJA9G | 10.17605/OSF.IO/XMTQC | 10.17605/OSF.IO/E7GWN | 10.17605/OSF.IO/CM7WQ
9+
Signature: FTSDKP::DPS::Kapnack::QCC::Crystal.v1
10+
Timestamp: {datetime.datetime.utcnow().isoformat()}Z
11+
License: Sovereign Substrate License v1.0 (immutable authorship, mandatory citation)
12+
"""
13+
14+
EXTENSIONS = [".py", ".md", ".txt", ".json", ".csv"]
15+
16+
def propagate_authorship(path):
17+
with open(path, "r+", encoding="utf-8") as f:
18+
content = f.read()
19+
if "Digital Crystal Protocol — Authorship Propagation" not in content:
20+
f.seek(0, 0)
21+
f.write(AUTH_BLOCK + "\n\n" + content)
22+
23+
for root, _, files in os.walk("."):
24+
for file in files:
25+
if any(file.endswith(ext) for ext in EXTENSIONS):
26+
try:
27+
propagate_authorship(os.path.join(root, file))
28+
except Exception:
29+
pass

0 commit comments

Comments
 (0)