pyLodStorage 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/PKG-INFO +1 -1
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/query.py +8 -2
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/querymain.py +12 -2
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/pylodstorage.egg-info/PKG-INFO +1 -1
- pylodstorage-0.1.2/pylodstorage.egg-info/entry_points.txt +5 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/setup.py +4 -4
- pylodstorage-0.1.0/pylodstorage.egg-info/entry_points.txt +0 -5
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/LICENSE +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/README.md +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/__init__.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/csv.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/entity.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/jsonable.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/jsonpicklemixin.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/lod.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/mwTable.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/plot.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/sample.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/schema.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/sparql.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/sql.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/storageconfig.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/tabulateCounter.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/uml.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/yamlablemixin.py +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/pylodstorage.egg-info/SOURCES.txt +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/pylodstorage.egg-info/dependency_links.txt +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/pylodstorage.egg-info/requires.txt +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/pylodstorage.egg-info/top_level.txt +0 -0
- {pylodstorage-0.1.0 → pylodstorage-0.1.2}/setup.cfg +0 -0
|
@@ -46,7 +46,7 @@ class QueryResultDocumentation():
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
@staticmethod
|
|
49
|
-
def uniCode2Latex(text:str)->str:
|
|
49
|
+
def uniCode2Latex(text:str,withConvert:bool=False)->str:
|
|
50
50
|
'''
|
|
51
51
|
converts unicode text to latex and
|
|
52
52
|
fixes UTF-8 chars for latex in a certain range:
|
|
@@ -56,13 +56,19 @@ class QueryResultDocumentation():
|
|
|
56
56
|
|
|
57
57
|
Args:
|
|
58
58
|
text(str): the string to fix
|
|
59
|
+
withConvert(bool): if unicode to latex libary conversion should be used
|
|
59
60
|
|
|
60
61
|
Return:
|
|
61
62
|
str: latex presentation of UTF-8 char
|
|
62
63
|
'''
|
|
63
64
|
for code in range(8320,8330):
|
|
64
65
|
text=text.replace(chr(code),f"$_{code-8320}$")
|
|
65
|
-
|
|
66
|
+
if withConvert:
|
|
67
|
+
latex=unicode_to_latex(text)
|
|
68
|
+
# workaround {\textbackslash} being returned
|
|
69
|
+
#latex=latex.replace("{\\textbackslash}",'\\')
|
|
70
|
+
text=latex
|
|
71
|
+
return text
|
|
66
72
|
|
|
67
73
|
@staticmethod
|
|
68
74
|
def wikiDataLink(record,key,value,tablefmt):
|
|
@@ -3,7 +3,7 @@ Created on 2022-02-13
|
|
|
3
3
|
|
|
4
4
|
@author: wf
|
|
5
5
|
'''
|
|
6
|
-
__version__ = "0.1.
|
|
6
|
+
__version__ = "0.1.2"
|
|
7
7
|
__date__ = '2020-09-10'
|
|
8
8
|
__updated__ = '2022-02-13'
|
|
9
9
|
DEBUG = 0
|
|
@@ -13,7 +13,7 @@ import sys
|
|
|
13
13
|
import os
|
|
14
14
|
from argparse import ArgumentParser
|
|
15
15
|
from argparse import RawDescriptionHelpFormatter
|
|
16
|
-
from lodstorage.query import QueryManager
|
|
16
|
+
from lodstorage.query import QueryManager, QueryResultDocumentation
|
|
17
17
|
from lodstorage.sparql import SPARQL
|
|
18
18
|
from lodstorage.csv import CSV
|
|
19
19
|
|
|
@@ -22,6 +22,9 @@ class Format(Enum):
|
|
|
22
22
|
json = 'json'
|
|
23
23
|
xml = 'xml'
|
|
24
24
|
tsv = 'tsv'
|
|
25
|
+
latex = 'latex'
|
|
26
|
+
mediawiki= 'mediawiki'
|
|
27
|
+
github = 'github'
|
|
25
28
|
|
|
26
29
|
def __str__(self):
|
|
27
30
|
return self.value
|
|
@@ -45,10 +48,17 @@ class QueryMain:
|
|
|
45
48
|
query=qm.queriesByName[args.queryName]
|
|
46
49
|
if args.language=="sparql":
|
|
47
50
|
endpoint=SPARQL(query.endpoint)
|
|
51
|
+
if "wikidata" in query.endpoint:
|
|
52
|
+
query.addFormatCallBack(QueryResultDocumentation.wikiDataLink)
|
|
48
53
|
qlod=endpoint.queryAsListOfDicts(query.query)
|
|
49
54
|
if args.format is Format.csv:
|
|
50
55
|
csv=CSV.toCSV(qlod)
|
|
51
56
|
print(csv)
|
|
57
|
+
elif args.format is Format.latex or args.format is Format.github or args.format is Format.mediawiki:
|
|
58
|
+
doc=query.documentQueryResult(qlod, tablefmt=str(args.format),floatfmt=".0f")
|
|
59
|
+
docstr=doc.asText()
|
|
60
|
+
print (docstr)
|
|
61
|
+
|
|
52
62
|
|
|
53
63
|
|
|
54
64
|
def mainSQL(argv=None):
|
|
@@ -11,7 +11,7 @@ with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
|
|
|
11
11
|
|
|
12
12
|
setup(
|
|
13
13
|
name='pylodstorage',
|
|
14
|
-
version='0.1.
|
|
14
|
+
version='0.1.2',
|
|
15
15
|
|
|
16
16
|
packages=['lodstorage',],
|
|
17
17
|
author='Wolfgang Fahl',
|
|
@@ -44,9 +44,9 @@ setup(
|
|
|
44
44
|
],
|
|
45
45
|
entry_points={
|
|
46
46
|
'console_scripts': [
|
|
47
|
-
'sparqlquery = lodstorage.
|
|
48
|
-
'sqlquery=lodstorage.
|
|
49
|
-
'lodquery=lodstorage.
|
|
47
|
+
'sparqlquery = lodstorage.querymain:mainSPARQL',
|
|
48
|
+
'sqlquery=lodstorage.querymain:mainSQL',
|
|
49
|
+
'lodquery=lodstorage.querymain:main'
|
|
50
50
|
],
|
|
51
51
|
},
|
|
52
52
|
long_description=long_description,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|