1from setuptools import setup 2 3# extract version from pickleshare.py 4# can't import because pickleshare depends on path.py 5with open('pickleshare.py') as f: 6 for line in f: 7 if line.startswith('__version__'): 8 version = eval(line.split('=', 1)[1]) 9 break 10 11setup( 12 name="pickleshare", 13 version=version, 14 py_modules=['pickleshare'], 15 author="Ville Vainio", 16 author_email="vivainio@gmail.com", 17 description="Tiny 'shelve'-like database with concurrency support", 18 license="MIT", 19 extras_require = { 20 # Ugly, but we can't do < comparison here 21 ':python_version in "2.6 2.7 3.2 3.3"': ['pathlib2'], 22 }, 23 url="https://github.com/pickleshare/pickleshare", 24 keywords="database persistence pickle ipc shelve", 25 long_description="""\ 26PickleShare - a small 'shelve' like datastore with concurrency support 27 28Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike shelve, 29many processes can access the database simultaneously. Changing a value in 30database is immediately visible to other processes accessing the same database. 31 32Concurrency is possible because the values are stored in separate files. Hence 33the "database" is a directory where *all* files are governed by PickleShare. 34 35Example usage:: 36 37 from pickleshare import * 38 db = PickleShareDB('~/testpickleshare') 39 db.clear() 40 print("Should be empty:",db.items()) 41 db['hello'] = 15 42 db['aku ankka'] = [1,2,313] 43 db['paths/are/ok/key'] = [1,(5,46)] 44 print(db.keys()) 45 46This module is certainly not ZODB, but can be used for low-load 47(non-mission-critical) situations where tiny code size trumps the 48advanced features of a "real" object database. 49 50Installation guide: pip install pickleshare 51""", 52 classifiers=[ 53 'License :: OSI Approved :: MIT License', 54 'Programming Language :: Python :: 2', 55 'Programming Language :: Python :: 2.7', 56 'Programming Language :: Python :: 3', 57 ] 58) 59