|
@@ -1,19 +1,19 @@
|
|
-import sys
|
|
|
|
-import yaml
|
|
|
|
import os
|
|
import os
|
|
-from datetime import datetime
|
|
|
|
-
|
|
|
|
|
|
+import sys
|
|
|
|
|
|
-import os
|
|
|
|
import requests
|
|
import requests
|
|
import yaml
|
|
import yaml
|
|
|
|
|
|
|
|
|
|
def get_infos() -> str:
|
|
def get_infos() -> str:
|
|
- headers = {'Accept': 'application/json'}
|
|
|
|
|
|
+ headers = {
|
|
|
|
+ 'Accept': 'application/json',
|
|
|
|
+ }
|
|
params = {
|
|
params = {
|
|
'access_token': os.environ['ZENODO_TOKEN'],
|
|
'access_token': os.environ['ZENODO_TOKEN'],
|
|
- 'q': 'nicegui', 'sort': 'mostrecent', 'status': 'published'
|
|
|
|
|
|
+ 'q': 'nicegui',
|
|
|
|
+ 'sort': 'mostrecent',
|
|
|
|
+ 'status': 'published',
|
|
}
|
|
}
|
|
try:
|
|
try:
|
|
response = requests.get('https://zenodo.org/api/records', params=params, headers=headers)
|
|
response = requests.get('https://zenodo.org/api/records', params=params, headers=headers)
|
|
@@ -29,6 +29,6 @@ def get_infos() -> str:
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
with open('CITATION.cff', 'r') as file:
|
|
with open('CITATION.cff', 'r') as file:
|
|
citation = yaml.safe_load(file)
|
|
citation = yaml.safe_load(file)
|
|
- citation['doi'], citation['version'], citation['date-released'] = get_infos()
|
|
|
|
|
|
+ citation['doi'], citation['version'], citation['date-released'] = get_infos()
|
|
with open('CITATION.cff', 'w') as file:
|
|
with open('CITATION.cff', 'w') as file:
|
|
yaml.dump(citation, file, sort_keys=False, default_flow_style=False)
|
|
yaml.dump(citation, file, sort_keys=False, default_flow_style=False)
|