trisdb-py
=========
The Python interface to TrisDb
### Installation
```
sudo pip install trisdb-py
```
### Usage
```python
>>> from trisdb import *
>>> # Connect and insert some data
>>> db = TrisDbConnection('localhost', 1205)
>>> db.create('Alice', 'loves', 'pizza')
>>> db.create('Kate', 'likes', 'football')
>>> # Print all records
>>> result = db.get('*')
>>> for i in result:
>>> print i['subject'] + '-' + i['predicate'] + '-' + i['object']
>>> # Who likes football?
>>> result = db.gets('*', 'likes', 'football')
>>> for i in result:
>>> print i
>>> # Batch insert using MULTI
>>> m = db.multi()
>>> for i in range(0,10):
>>> m.create('key'+str(i), 'value', 'value'+str(i))
>>> db.execute(m)
>>> # Clear all data from DB and close connection
>>> db.clear()
>>> db.close()
```
=========
The Python interface to TrisDb
### Installation
```
sudo pip install trisdb-py
```
### Usage
```python
>>> from trisdb import *
>>> # Connect and insert some data
>>> db = TrisDbConnection('localhost', 1205)
>>> db.create('Alice', 'loves', 'pizza')
>>> db.create('Kate', 'likes', 'football')
>>> # Print all records
>>> result = db.get('*')
>>> for i in result:
>>> print i['subject'] + '-' + i['predicate'] + '-' + i['object']
>>> # Who likes football?
>>> result = db.gets('*', 'likes', 'football')
>>> for i in result:
>>> print i
>>> # Batch insert using MULTI
>>> m = db.multi()
>>> for i in range(0,10):
>>> m.create('key'+str(i), 'value', 'value'+str(i))
>>> db.execute(m)
>>> # Clear all data from DB and close connection
>>> db.clear()
>>> db.close()
```
Release files for trisdb-py 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| trisdb-py-1.0.0.tar.gz | 3.0 kB | Details |
Release files / trisdb-py-1.0.0.tar.gz
| Download URL | trisdb-py-1.0.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04fe66db35581c52178484062a7d297d558bc95bbb8dc07aaf4c497ca6e8090c
|
|
BLAKE2b-256 checksum How to use checksums |
a7918c7f8141a0b5f3afac79504bc12b80add8c6c5a624400684fc421d58cc9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |