Skip to content

Commit

Permalink
1603_1.py (#35): profile data-package-catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Apr 28, 2022
1 parent 33aef00 commit 16de6a1
Showing 1 changed file with 52 additions and 5 deletions.
57 changes: 52 additions & 5 deletions officinam/999999999/0/1603_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3706,13 +3706,59 @@ def imprimere(self):
else:
return [yaml.dump(self.ex_codice(), allow_unicode=True)]

def imprimere_in_datapackage(self):
return self.imprimere_in_markdown()
def imprimere_in_datapackage(self) -> list:
"""imprimere_in_datapackage
def imprimere_in_markdown(self):
Trivia:
- datapackage, ---, https://specs.frictionlessdata.io/
- sarcina, f, s, Nom., https://en.wiktionary.org/wiki/sarcina
Returns:
list:
"""
paginae = []
if self.ex_librario:
sarcina = {
'name': '1603',
'profile': 'data-package-catalog',
'resources': []
}
status = self.status_librario_ex_codex()
items_sorted = status['librarium'].items()
items_sorted = sorted(items_sorted, key=sort_numerodinatio_clavem)

for codex, item in items_sorted:
_path = numerordinatio_neo_separatum(codex, '/')
_nomen = numerordinatio_neo_separatum(codex, '_')

sarcina['resources'].append({
# 'profile': 'data-package-catalog', # To create sublevels
'format': 'json',
'name': _nomen,
'path': _path + '/datapackage.json',
'profile': 'tabular-data-package'
})
else:
ex_codice = self.ex_codice()
sarcina = {
'name': '1603',
'profile': 'tabular-data-package',
'_TODO': ex_codice
}

# raise NotImplementedError(
# '--status-in-markdown requires --ex-librario')

paginae.append(json.dumps(
sarcina, indent=4, ensure_ascii=False, sort_keys=False))

return paginae

def imprimere_in_markdown(self) -> list:
if not self.ex_librario:
raise NotImplementedError(
'--status-in-markdown requires --ex-librario="locale"')
'--status-in-markdown requires --ex-librario')
paginae = []
status = self.status_librario_ex_codex()
paginae.append('# 1603 Librārium')
Expand Down Expand Up @@ -5572,7 +5618,8 @@ def make_args(self, hxl_output=True):

status_quo.add_argument(
'--status-in-datapackage',
help='Return status in frictionless datapackage.json',
help='Return status in frictionless datapackage.json. '
'With --ex-librario returns profile data-package-catalog.',
# metavar='',
dest='status_in_datapackage',
# const=True,
Expand Down

0 comments on commit 16de6a1

Please sign in to comment.