Comments (8)
Could you tell me what the issues are with Python3 support? Maybe I can port it.
from sophy.
+1 for Python3 support!
from sophy.
Make it happen 👍
from sophy.
Working on a rewrite which will work with py3 and also support the latest version 2.2. It's in a branch and I anticipate merging in the next day or so.
from sophy.
You are awesome. Looking forward to trying sophy in Python 3!
from sophy.
Fantastic =) 👍
from sophy.
Python3 support, as well as support for Sophia v2.2, has been merged into master and deployed on PyPI as sophy v0.2.0
.
The APIs used for creating an environment / setting up a database have changed, so please refer to either the README or the test cases.
Quick overview:
from sophy import *
env = Sophia('/path/to/database-dir')
# Single key/value indexes
events_schema = Schema(
key_parts=[U64Index('timestamp')],
value_parts=[StringIndex('data')])
events = env.add_database('events', events_schema)
# Multi-field keys and values.
phonebook_schema = Schema(
key_parts=[StringIndex('last_name'), StringIndex('first_name')],
value_parts=[U16Index('area_code'), U64Index('number'), StringIndex('address')])
phonebook = env.add_database('phonebook', phonebook_schema)
env.open() # Returns True
events[int(time.time()) - 7200] = 'finished up writing unit tests'
events[int(time.time()) - 3600] = 'rewriting the README'
events[int(time.time()) - 300] = 'closing out old github issues'
events[int(time.time())] = 'writing this as we speak...'
# What have I been doing in the last 10 minutes?
ten_min_ago = int(time.time()) - 600
for ts, data in events[ten_min_ago:]:
print data
# Store some multi-field/multi-value data.
phonebook['cat', 'huey'] = (123, 5551234, '1337 Main St, Topeka KS')
phonebook['dog', 'mickey'] = (123, 5559123, '443 Apache Ct, Topeka KS')
phonebook['cat', 'zaizee'] = (123, 5554321, '000 Null St, Topeka KS')
print phonebook['cat', 'huey']
# (123, 5551234, '1337 Main St, Topeka KS')
# etc, etc.
env.close() # True
from sophy.
Yippee!!!
from sophy.
Related Issues (15)
- writing, closing, and then reopening a Sophia db in one Python session results in segfault on exit HOT 4
- Can't create new environment HOT 6
- all the value i get from sophy is None while key was correct HOT 5
- Querying a part of index and value? HOT 1
- Segmentatoin fault when key is U32Index HOT 1
- Project License HOT 1
- How to re-open existing database? HOT 2
- Import Error undefined symbol: PyString_FromStringAndSize HOT 1
- Unable to create new database. KeyError: 'db-test' HOT 1
- Segfault HOT 1
- Closing database safely HOT 2
- Encoding problems? HOT 3
- How to limit the memory used by sophia HOT 1
- unbound memory problem HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sophy.