pyLodStorage 0.0.78__tar.gz → 0.0.79__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 (27) hide show
  1. {pylodstorage-0.0.78/pylodstorage.egg-info → pylodstorage-0.0.79}/PKG-INFO +1 -1
  2. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/entity.py +15 -9
  3. {pylodstorage-0.0.78 → pylodstorage-0.0.79/pylodstorage.egg-info}/PKG-INFO +1 -1
  4. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/setup.py +1 -1
  5. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/LICENSE +0 -0
  6. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/README.md +0 -0
  7. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/__init__.py +0 -0
  8. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/csv.py +0 -0
  9. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/jsonable.py +0 -0
  10. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/jsonpicklemixin.py +0 -0
  11. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/lod.py +0 -0
  12. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/mwTable.py +0 -0
  13. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/plot.py +0 -0
  14. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/query.py +0 -0
  15. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/sample.py +0 -0
  16. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/schema.py +0 -0
  17. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/sparql.py +0 -0
  18. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/sql.py +0 -0
  19. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/storageconfig.py +0 -0
  20. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/tabulateCounter.py +0 -0
  21. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/uml.py +0 -0
  22. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/lodstorage/yamlablemixin.py +0 -0
  23. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/pylodstorage.egg-info/SOURCES.txt +0 -0
  24. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/pylodstorage.egg-info/dependency_links.txt +0 -0
  25. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/pylodstorage.egg-info/requires.txt +0 -0
  26. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/pylodstorage.egg-info/top_level.txt +0 -0
  27. {pylodstorage-0.0.78 → pylodstorage-0.0.79}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pylodstorage
3
- Version: 0.0.78
3
+ Version: 0.0.79
4
4
  Summary: python List of Dict (Table) Storage library
5
5
  Home-page: https://github.com/WolfgangFahl/pyLodStorage
6
6
  Author: Wolfgang Fahl
@@ -167,14 +167,14 @@ GROUP by ?source
167
167
  raise Exception("unsupported mode %s" % self.mode)
168
168
  return result
169
169
 
170
- def fromCache(self,force:bool=False,getListOfDicts=None,withDrop=True,sampleRecordCount=-1):
170
+ def fromCache(self,force:bool=False,getListOfDicts=None,append=False,sampleRecordCount=-1):
171
171
  '''
172
172
  get my entries from the cache or from the callback provided
173
173
 
174
174
  Args:
175
175
  force(bool): force ignoring the cache
176
176
  getListOfDicts(callable): a function to call for getting the data
177
- withDrop(bool): True if the table should be (re) created
177
+ append(bool): True if records should be appended
178
178
  sampleRecordCount(int): the number of records to analyze for type information
179
179
 
180
180
  Returns:
@@ -191,7 +191,7 @@ GROUP by ?source
191
191
  listOfDicts=getListOfDicts()
192
192
  duration=time.time()-startTime
193
193
  self.showProgress(f"got {len(listOfDicts)} {self.entityPluralName} in {duration:5.1f} s")
194
- self.cacheFile=self.storeLoD(listOfDicts,withDrop=withDrop,sampleRecordCount=sampleRecordCount)
194
+ self.cacheFile=self.storeLoD(listOfDicts,append=append,sampleRecordCount=sampleRecordCount)
195
195
  self.setListFromLoD(listOfDicts)
196
196
  else:
197
197
  # fromStore also sets self.cacheFile
@@ -270,14 +270,14 @@ SELECT ?eventId ?acronym ?series ?title ?year ?country ?city ?startDate ?endDate
270
270
  lod.append(entity.__dict__)
271
271
  return lod
272
272
 
273
- def store(self,limit=10000000,batchSize=250,withDrop=True,fixNone=True,sampleRecordCount=-1)->str:
273
+ def store(self,limit=10000000,batchSize=250,append=False,fixNone=True,sampleRecordCount=-1)->str:
274
274
  '''
275
275
  store my list of dicts
276
276
 
277
277
  Args:
278
278
  limit(int): maximum number of records to store per batch
279
279
  batchSize(int): size of batch for storing
280
- withDrop(bool): True if the table should be (re) created
280
+ append(bool): True if records should be appended
281
281
  fixNone(bool): if True make sure the dicts are filled with None references for each record
282
282
  sampleRecordCount(int): the number of records to analyze for type information
283
283
 
@@ -285,9 +285,9 @@ SELECT ?eventId ?acronym ?series ?title ?year ?country ?city ?startDate ?endDate
285
285
  str: The cachefile being used
286
286
  '''
287
287
  lod=self.getLoD()
288
- return self.storeLoD(lod,limit=limit,batchSize=batchSize,withDrop=withDrop,fixNone=fixNone,sampleRecordCount=sampleRecordCount)
288
+ return self.storeLoD(lod,limit=limit,batchSize=batchSize,append=append,fixNone=fixNone,sampleRecordCount=sampleRecordCount)
289
289
 
290
- def storeLoD(self,listOfDicts,limit=10000000,batchSize=250,cacheFile=None,withDrop=True,fixNone=True,sampleRecordCount=1)->str:
290
+ def storeLoD(self,listOfDicts,limit=10000000,batchSize=250,cacheFile=None,append=False,fixNone=True,sampleRecordCount=1)->str:
291
291
  '''
292
292
  store my entities
293
293
 
@@ -296,7 +296,7 @@ SELECT ?eventId ?acronym ?series ?title ?year ?country ?city ?startDate ?endDate
296
296
  limit(int): maximum number of records to store
297
297
  batchSize(int): size of batch for storing
298
298
  cacheFile(string): the name of the storage e.g path to JSON or sqlite3 file
299
- withDrop(bool): True if the table should be (re) created
299
+ append(bool): True if records should be appended
300
300
  fixNone(bool): if True make sure the dicts are filled with None references for each record
301
301
  sampleRecordCount(int): the number of records to analyze for type information
302
302
 
@@ -331,7 +331,13 @@ SELECT ?eventId ?acronym ?series ?title ?year ?country ?city ?startDate ?endDate
331
331
  cacheFile=self.getCacheFile(config=self.config,mode=self.config.mode)
332
332
  sqldb=self.getSQLDB(cacheFile)
333
333
  self.showProgress ("storing %d %s for %s to %s:%s" % (len(listOfDicts),self.entityPluralName,self.name,config.mode,cacheFile))
334
- entityInfo=sqldb.createTable(listOfDicts, self.tableName, primaryKey=self.primaryKey,withDrop=withDrop,sampleRecordCount=sampleRecordCount)
334
+ if append:
335
+ withDrop=False
336
+ withCreate=False
337
+ else:
338
+ withDrop=True
339
+ withCreate=True
340
+ entityInfo=sqldb.createTable(listOfDicts, self.tableName, primaryKey=self.primaryKey,withCreate=withCreate,withDrop=withDrop,sampleRecordCount=sampleRecordCount)
335
341
  self.sqldb.store(listOfDicts, entityInfo,executeMany=self.executeMany,fixNone=fixNone)
336
342
  self.showProgress ("store for %s done after %5.1f secs" % (self.name,time.time()-startTime))
337
343
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pylodstorage
3
- Version: 0.0.78
3
+ Version: 0.0.79
4
4
  Summary: python List of Dict (Table) Storage library
5
5
  Home-page: https://github.com/WolfgangFahl/pyLodStorage
6
6
  Author: Wolfgang Fahl
@@ -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.0.78',
14
+ version='0.0.79',
15
15
 
16
16
  packages=['lodstorage',],
17
17
  author='Wolfgang Fahl',
File without changes
File without changes
File without changes