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.
Files changed (30) hide show
  1. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/PKG-INFO +1 -1
  2. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/query.py +8 -2
  3. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/querymain.py +12 -2
  4. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/pylodstorage.egg-info/PKG-INFO +1 -1
  5. pylodstorage-0.1.2/pylodstorage.egg-info/entry_points.txt +5 -0
  6. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/setup.py +4 -4
  7. pylodstorage-0.1.0/pylodstorage.egg-info/entry_points.txt +0 -5
  8. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/LICENSE +0 -0
  9. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/README.md +0 -0
  10. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/__init__.py +0 -0
  11. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/csv.py +0 -0
  12. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/entity.py +0 -0
  13. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/jsonable.py +0 -0
  14. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/jsonpicklemixin.py +0 -0
  15. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/lod.py +0 -0
  16. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/mwTable.py +0 -0
  17. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/plot.py +0 -0
  18. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/sample.py +0 -0
  19. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/schema.py +0 -0
  20. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/sparql.py +0 -0
  21. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/sql.py +0 -0
  22. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/storageconfig.py +0 -0
  23. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/tabulateCounter.py +0 -0
  24. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/uml.py +0 -0
  25. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/lodstorage/yamlablemixin.py +0 -0
  26. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/pylodstorage.egg-info/SOURCES.txt +0 -0
  27. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/pylodstorage.egg-info/dependency_links.txt +0 -0
  28. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/pylodstorage.egg-info/requires.txt +0 -0
  29. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/pylodstorage.egg-info/top_level.txt +0 -0
  30. {pylodstorage-0.1.0 → pylodstorage-0.1.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pylodstorage
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: python List of Dict (Table) Storage library
5
5
  Home-page: https://github.com/WolfgangFahl/pyLodStorage
6
6
  Author: Wolfgang Fahl
@@ -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
- return unicode_to_latex(text)
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.0"
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pylodstorage
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: python List of Dict (Table) Storage library
5
5
  Home-page: https://github.com/WolfgangFahl/pyLodStorage
6
6
  Author: Wolfgang Fahl
@@ -0,0 +1,5 @@
1
+ [console_scripts]
2
+ lodquery = lodstorage.querymain:main
3
+ sparqlquery = lodstorage.querymain:mainSPARQL
4
+ sqlquery = lodstorage.querymain:mainSQL
5
+
@@ -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.0',
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.query:mainSPARQL',
48
- 'sqlquery=lodstorage.query:mainSQL',
49
- 'lodquery=lodstorage.query:main'
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,
@@ -1,5 +0,0 @@
1
- [console_scripts]
2
- lodquery = lodstorage.query:main
3
- sparqlquery = lodstorage.query:mainSPARQL
4
- sqlquery = lodstorage.query:mainSQL
5
-
File without changes
File without changes
File without changes