Added Besser SDC as an example
Browse files- besser_example.json +1 -0
- markdownGenerator.py +3 -4
- sdc_view.py +14 -5
besser_example.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"master_title": "Besser", "master_desc": "The BESSER low-code platform is built on top of B-UML our Python-based personal interpretation of a 'Universal Modeling Language' (yes, heavily inspired and a simplified version of the better known UML, the Unified Modeling Language) ", "socialContext_description": "Besser is inteded to be used by a broad community of app developers without the need of having coding skills.", "socialContext_targetCommunity_name": "Teacher and student of computer science", "socialContext_targetCommunity_description": "Teacher and student of computer science", "socialContext_targetCommunity_age": [17, 120], "socialContext_targetCommunity_location": "University and education places", "socialContext_targetCommunity_workplace": "Hybrid", "socialContext_targetCommunity_ethnicities": "French, German, Arab", "socialContext_targetCommunity_genders": "", "socialContext_targetCommunity_disabilities": "", "socialContext_targetCommunity_religious": "", "socialContext_adaptation_name": "Computer Science Teachers", "socialContext_adaptation_description": "The software have been adapted for its specific use in educational environments", "participants_0_name": "Development Team", "participants_0_description": "The team in charge of developing the software", "participants_0_size": 15, "participants_0_age": [25, 36], "participants_0_location": "Luxembourg Institute of Technoogy", "participants_0_workplace": "Presential", "participants_0_ethnicities": "Colombian,Brasilian, Argentinian, French ,Spanish, Pakistani, Serbian, Iranian, Morroco, Italian", "participants_0_genders": "80% male, 20% famela", "participants_0_disabilities": "Non", "participants_0_religious": "Christianism, Islam", "governance_projectType": ["public funded"], "governance_govProcesses_0": "Besser is funded by the Luxembourg\u2019s National Research Fund (FNR) is the country\u2019s main agency for funding research across all scientific fields.", "governance_govProcesses_1": "The project is led by the recipient of the funds, its principal investigator.", "governance_bodies_0_name": "Luxembourg\u2019s National Research Fund (FNR)", "governance_bodies_0_description": "Luxembourg\u2019s National Research Fund (FNR) is the country\u2019s main agency for funding research across all scientific fields.", "governance_bodies_0_participant_name": "", "governance_bodies_0_participant_location": "", "governance_bodies_0_participant_workdplace": "Presential", "governance_bodies_0_participant_ethincity": "", "governance_bodies_0_participant_gender": "", "governance_bodies_0_participant_disabilities": "", "governance_bodies_0_participant_sexualOrientation": "", "governance_bodies_0_participant_religion": "", "governance_bodies_0_organization_name": "Luxembourg\u2019s National Research Fund (FNR)", "governance_bodies_0_organization_age": [10, 20], "governance_bodies_0_organization_location": "Luxembourg", "governance_bodies_0_organization_workplace": "Presential", "governance_bodies_0_organization_ethnicities": "", "governance_bodies_0_organization_genders": "", "governance_bodies_0_organization_disabilities": "", "governance_bodies_0_organization_religious": "", "governance_bodies_0_type": ["funders"], "governance_bodies_1_name": "Principal Investigator", "governance_bodies_1_description": "The PI who lead the project ", "governance_bodies_1_participant_name": "Jordi Cabot", "governance_bodies_1_participant_location": "Luxembourg Institute of Science and Technology", "governance_bodies_1_participant_workdplace": "Presential", "governance_bodies_1_participant_ethincity": "White", "governance_bodies_1_participant_gender": "Male", "governance_bodies_1_participant_disabilities": "None", "governance_bodies_1_participant_sexualOrientation": "Non-disclosed", "governance_bodies_1_participant_religion": "Non-disclosed", "governance_bodies_1_organization_name": "", "governance_bodies_1_organization_age": [10, 20], "governance_bodies_1_organization_location": "", "governance_bodies_1_organization_workplace": "Presential", "governance_bodies_1_organization_ethnicities": "", "governance_bodies_1_organization_genders": "", "governance_bodies_1_organization_disabilities": "", "governance_bodies_1_organization_religious": "", "governance_bodies_1_type": ["directors"], "governance_bodies_1_participant_countries": [], "governance_bodies_1_participant_edlevel": [], "governance_bodies_1_participant_sociostati": [], "governance_bodies_1_participant_skills": ["expert"], "governance_bodies_1_participant_languages": [], "socialContext_countries": ["Luxembourg", "France", "Germany", "Spain"], "socialContext_targetCommunity_countries": ["Luxembourg", "France"], "socialContext_targetCommunity_skills": ["beginner", "competent"], "participants_0_type": ["Development Team"], "participants_0_countries": ["Colombia", "Brazil", "Argentina", "France", "Spain", "Pakistan", "Serbia", "Iran,IslamicRepublicof"], "participants_0_edlevel": ["masterEquivalent", "doctorateEquivalent"], "participants_0_skills": ["proficient", "expert"], "participants_1_name": "Usability test team", "participants_1_description": "Tester are student of the computer science degree at the Luxembourg University. Using the backend generator from scratch with the documentation of BESSER (with a given PlantUML, library model)\n Using ChatGPT4o only giving the PlantUML model and no hand coding", "participants_1_size": 22, "participants_1_age": [20, 22], "participants_1_location": "University of Luxembourg", "participants_1_workplace": "Presential", "participants_1_ethnicities": "French", "participants_1_genders": "", "participants_1_disabilities": "", "participants_1_religious": "", "participants_1_type": ["Tester Team"], "participants_1_countries": [], "participants_1_edlevel": [], "participants_1_skills": [], "socialContext_targetCommunity_languages": ["French", "Luxembourgish-Letzeburgesch", "English"], "participants_0_languages": ["Spanish-Castilian", "English", "French"], "participants_1_languages": [], "governance_bodies_2_name": "", "governance_bodies_2_description": "", "governance_bodies_2_participant_name": "", "governance_bodies_2_participant_location": "", "governance_bodies_2_participant_workdplace": "Presential", "governance_bodies_2_participant_ethincity": "", "governance_bodies_2_participant_gender": "", "governance_bodies_2_participant_disabilities": "", "governance_bodies_2_participant_sexualOrientation": "", "governance_bodies_2_participant_religion": "", "governance_bodies_2_organization_name": "", "governance_bodies_2_organization_age": [10, 20], "governance_bodies_2_organization_location": "", "governance_bodies_2_organization_workplace": "Presential", "governance_bodies_2_organization_ethnicities": "", "governance_bodies_2_organization_genders": "", "governance_bodies_2_organization_disabilities": "", "governance_bodies_2_organization_religious": "", "governance_bodies_0_organization_countries": ["Luxembourg"]}
|
markdownGenerator.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
def generate_markdown(state):
|
2 |
-
print(state)
|
3 |
html_str= f"""
|
4 |
# The Software diversity card of {state["master"]["title"]}
|
5 |
{state["master"]["desc"]}
|
@@ -25,8 +24,8 @@ def generate_markdown(state):
|
|
25 |
<td><strong>{participant['name']}</strong></td>
|
26 |
<td>{participant['description'].replace('\n', '')}</td>
|
27 |
"""
|
28 |
-
if 'type' in
|
29 |
-
html_str = html_str + f"""<td>{
|
30 |
else:
|
31 |
html_str = html_str + f"""<td> </td>"""
|
32 |
|
@@ -72,7 +71,7 @@ def generate_markdown(state):
|
|
72 |
<td>{body['organization']['location']}</td>
|
73 |
</tr>"""
|
74 |
|
75 |
-
|
76 |
html_str = html_str + f"""
|
77 |
<td>45</td>
|
78 |
<td>{body['participant']['ethincity']}</td>
|
|
|
1 |
def generate_markdown(state):
|
|
|
2 |
html_str= f"""
|
3 |
# The Software diversity card of {state["master"]["title"]}
|
4 |
{state["master"]["desc"]}
|
|
|
24 |
<td><strong>{participant['name']}</strong></td>
|
25 |
<td>{participant['description'].replace('\n', '')}</td>
|
26 |
"""
|
27 |
+
if 'type' in participant:
|
28 |
+
html_str = html_str + f"""<td>{participant['type'][0]}</td>"""
|
29 |
else:
|
30 |
html_str = html_str + f"""<td> </td>"""
|
31 |
|
|
|
71 |
<td>{body['organization']['location']}</td>
|
72 |
</tr>"""
|
73 |
|
74 |
+
if body['participant']['name']:
|
75 |
html_str = html_str + f"""
|
76 |
<td>45</td>
|
77 |
<td>{body['participant']['ethincity']}</td>
|
sdc_view.py
CHANGED
@@ -18,7 +18,8 @@ def render_sdc():
|
|
18 |
ISO639 = ['Afar' , 'Abkhazian', 'Avestan' , 'Afrikaans' , 'Akan' , 'Amharic' , 'Aragonese','Arabic','Assamese','Avaric','Aymara','Azerbaijani','Bashkir','Belarusian','Bulgarian','Bislama','Bambara','Bengali','Tibetan','Breton','Bosnian','Catalan-Valencian','Chechen','Chamorro','Corsican','Cree','Czech','ChurchSlavonic-OldSlavonic-OldChurchSlavonic','Chuvash','Welsh','Danish','German','Divehi-Dhivehi-Maldivian','Dzongkha','Ewe','GreekModern','English','Esperanto','Spanish-Castilian','Estonian','Basque','Persian','Fulah','Finnish','Fijian','Faroese','French','WesternFrisian','Irish','Gaelic-ScottishGaelic','Galician','Guarani','Gujarati','Manx','Hausa','Hebrew','Hindi','HiriMotu','Croatian','Haitian-HaitianCreole','Hungarian','Armenian','Herero','Interlingua','Indonesian','Interlingue-Occidental','Igbo','SichuanYi-Nuosu','Inupiaq','Ido','Icelandic','Italian','Inuktitut','Japanese','Javanese','Georgian','Kongo','Kikuyu-Gikuyu','Kuanyama-Kwanyama','Kazakh','Kalaallisut-Greenlandic','CentralKhmer','Kannada','Korean','Kanuri','Kashmiri','Kurdish','Komi','Cornish','Kyrgyz-Kirghiz','Latin','Luxembourgish-Letzeburgesch','Ganda','Limburgan-Limburger-Limburgish','Lingala','Lao','Lithuanian','Luba-Katanga','Latvian','Malagasy','Marshallese','Maori','Macedonian','Malayalam','Mongolian','Marathi','Malay','Maltese','Burmese','Nauru','NorwegianBokmål','NorthNdebele','Nepali','Ndonga','Dutch-Flemish','NorwegianNynorsk','Norwegian','SouthNdebele','Navajo-Navaho','Chichewa-Chewa-Nyanja','Occitan','Ojibwa','Oromo','Oriya','Ossetian-Ossetic','Punjabi-Panjabi','Pali','Polish','Pashto-Pushto','Portuguese','Quechua','Romansh','Rundi','Romanian-Moldavian-Moldovan','Russian','Kinyarwanda','Sanskrit','Sardinian','Sindhi','NorthernSami','Sango','Sinhala-Sinhalese','Slovak','Slovenian','Samoan','Shona','Somali','Albanian','Serbian','Swati','SouthernSotho','Sundanese','Swedish','Swahili','Tamil','Telugu','Tajik','Thai','Tigrinya','Turkmen','Tagalog','Tswana','Tonga','Turkish','Tsonga','Tatar','Twi','Tahitian','Uighur-Uyghur','Ukrainian','Urdu','Uzbek','Venda','Vietnamese','Volapük','Walloon','Wolof','Xhosa','Yiddish','Yoruba','Zhuang-Chuang','Chinese','Zulu']
|
19 |
|
20 |
## The file where the state is
|
21 |
-
STATE_FILE = "
|
|
|
22 |
|
23 |
def load_state():
|
24 |
"""Load state from file and update session_state."""
|
@@ -26,6 +27,7 @@ def render_sdc():
|
|
26 |
try:
|
27 |
with open(STATE_FILE, "r") as f:
|
28 |
data = json.load(f)
|
|
|
29 |
st.session_state.update(data)
|
30 |
st.session_state['form_data'] = data
|
31 |
except Exception as e:
|
@@ -35,7 +37,7 @@ def render_sdc():
|
|
35 |
"""Save the current session_state to file."""
|
36 |
try:
|
37 |
# Convert session_state to a regular dict before dumping
|
38 |
-
with open(
|
39 |
json.dump(dict(st.session_state['form_data']), f)
|
40 |
except Exception as e:
|
41 |
st.error(f"Error saving state: {e}")
|
@@ -311,12 +313,19 @@ def render_sdc():
|
|
311 |
""",
|
312 |
unsafe_allow_html=True
|
313 |
)
|
|
|
314 |
st.markdown("""\
|
315 |
Welcome to the Software Diversity Card Generator—a form-based application designed to empower you to highlight and promote diversity in software projects. Our innovative tool helps you generate comprehensive diversity cards in both JSON and Markdown formats, offering a transparent overview of the varied teams involved in development and governance, the user groups engaged in testing, and the tailored software adaptations for different social groups. By providing a structured model, an extended JSON syntax, and a toolkit backed by real-world examples, our platform aims to foster inclusive practices that can be embraced by open-source communities, academic journals, and forward-thinking businesses alike.
|
316 |
""")
|
317 |
-
|
318 |
-
|
319 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
##
|
321 |
## Master info
|
322 |
##
|
|
|
18 |
ISO639 = ['Afar' , 'Abkhazian', 'Avestan' , 'Afrikaans' , 'Akan' , 'Amharic' , 'Aragonese','Arabic','Assamese','Avaric','Aymara','Azerbaijani','Bashkir','Belarusian','Bulgarian','Bislama','Bambara','Bengali','Tibetan','Breton','Bosnian','Catalan-Valencian','Chechen','Chamorro','Corsican','Cree','Czech','ChurchSlavonic-OldSlavonic-OldChurchSlavonic','Chuvash','Welsh','Danish','German','Divehi-Dhivehi-Maldivian','Dzongkha','Ewe','GreekModern','English','Esperanto','Spanish-Castilian','Estonian','Basque','Persian','Fulah','Finnish','Fijian','Faroese','French','WesternFrisian','Irish','Gaelic-ScottishGaelic','Galician','Guarani','Gujarati','Manx','Hausa','Hebrew','Hindi','HiriMotu','Croatian','Haitian-HaitianCreole','Hungarian','Armenian','Herero','Interlingua','Indonesian','Interlingue-Occidental','Igbo','SichuanYi-Nuosu','Inupiaq','Ido','Icelandic','Italian','Inuktitut','Japanese','Javanese','Georgian','Kongo','Kikuyu-Gikuyu','Kuanyama-Kwanyama','Kazakh','Kalaallisut-Greenlandic','CentralKhmer','Kannada','Korean','Kanuri','Kashmiri','Kurdish','Komi','Cornish','Kyrgyz-Kirghiz','Latin','Luxembourgish-Letzeburgesch','Ganda','Limburgan-Limburger-Limburgish','Lingala','Lao','Lithuanian','Luba-Katanga','Latvian','Malagasy','Marshallese','Maori','Macedonian','Malayalam','Mongolian','Marathi','Malay','Maltese','Burmese','Nauru','NorwegianBokmål','NorthNdebele','Nepali','Ndonga','Dutch-Flemish','NorwegianNynorsk','Norwegian','SouthNdebele','Navajo-Navaho','Chichewa-Chewa-Nyanja','Occitan','Ojibwa','Oromo','Oriya','Ossetian-Ossetic','Punjabi-Panjabi','Pali','Polish','Pashto-Pushto','Portuguese','Quechua','Romansh','Rundi','Romanian-Moldavian-Moldovan','Russian','Kinyarwanda','Sanskrit','Sardinian','Sindhi','NorthernSami','Sango','Sinhala-Sinhalese','Slovak','Slovenian','Samoan','Shona','Somali','Albanian','Serbian','Swati','SouthernSotho','Sundanese','Swedish','Swahili','Tamil','Telugu','Tajik','Thai','Tigrinya','Turkmen','Tagalog','Tswana','Tonga','Turkish','Tsonga','Tatar','Twi','Tahitian','Uighur-Uyghur','Ukrainian','Urdu','Uzbek','Venda','Vietnamese','Volapük','Walloon','Wolof','Xhosa','Yiddish','Yoruba','Zhuang-Chuang','Chinese','Zulu']
|
19 |
|
20 |
## The file where the state is
|
21 |
+
STATE_FILE = "besser_example.json"
|
22 |
+
SAVE_FILE = "session_state.json"
|
23 |
|
24 |
def load_state():
|
25 |
"""Load state from file and update session_state."""
|
|
|
27 |
try:
|
28 |
with open(STATE_FILE, "r") as f:
|
29 |
data = json.load(f)
|
30 |
+
print(data)
|
31 |
st.session_state.update(data)
|
32 |
st.session_state['form_data'] = data
|
33 |
except Exception as e:
|
|
|
37 |
"""Save the current session_state to file."""
|
38 |
try:
|
39 |
# Convert session_state to a regular dict before dumping
|
40 |
+
with open(SAVE_FILE, "w") as f:
|
41 |
json.dump(dict(st.session_state['form_data']), f)
|
42 |
except Exception as e:
|
43 |
st.error(f"Error saving state: {e}")
|
|
|
313 |
""",
|
314 |
unsafe_allow_html=True
|
315 |
)
|
316 |
+
|
317 |
st.markdown("""\
|
318 |
Welcome to the Software Diversity Card Generator—a form-based application designed to empower you to highlight and promote diversity in software projects. Our innovative tool helps you generate comprehensive diversity cards in both JSON and Markdown formats, offering a transparent overview of the varied teams involved in development and governance, the user groups engaged in testing, and the tailored software adaptations for different social groups. By providing a structured model, an extended JSON syntax, and a toolkit backed by real-world examples, our platform aims to foster inclusive practices that can be embraced by open-source communities, academic journals, and forward-thinking businesses alike.
|
319 |
""")
|
320 |
+
colp, colt, = st.columns([3,7])
|
321 |
+
|
322 |
+
with colp:
|
323 |
+
st.markdown("""\
|
324 |
+
Want to see **what it is possible? See an example!**
|
325 |
+
""")
|
326 |
+
with colt:
|
327 |
+
if st.button("Load Besser's diversity card", type="secondary"):
|
328 |
+
load_state()
|
329 |
##
|
330 |
## Master info
|
331 |
##
|