Cognica Python Client
A Python client for Cognica database server.
Installation
$ pip install cognica
Current Status
The current version is fully functional and stable for the production environment. However, the API is still subject to change and may break backward compatibility in the next release.
Current Version
import cognica
channel = cognica.Channel("localhost", 10080)
db = cognica.DocumentDB(channel)
collections = db.list_collections()
for collection in collections:
print(collection)
collection = cognica.find_collection("Wikipedia")
df = collection.find({
"page_id": 42
}, to_pandas=True)
print(df)
Next Version (Work in progress)
import cognica
channel = cognica.Channel("localhost", 10080)
ws = cognica.Workspaces(channel, "user_id", "password")
workspaces = ws.list_workspaces()
for workspace in workspaces:
print(workspace)
workspace = ws.find_workspace("test")
db = cognica.DocumentDB(workspace)
collections = db.list_collections()
for collection in collections:
print(collection)
collection = cognica.find_collection("Wikipedia")
df = collection.find({
"page_id": 42
}, to_pandas=True)
print(df)