aeca python
1.0.0
Un client Python pour le serveur de base de données AECA.
$ pip install aecaLa version actuelle est entièrement fonctionnelle et stable pour l'environnement de production. Cependant, l'API est toujours susceptible de changer et peut rompre la compatibilité en arrière dans la prochaine version.
import aeca
# Establish connection to a local database server.
channel = aeca . Channel ( "localhost" , 10080 )
# List collections.
db = aeca . DocumentDB ( channel )
collections = db . list_collections ()
for collection in collections :
print ( collection )
# Find a specific document in the Wikipedia collection.
collection = aeca . find_collection ( "Wikipedia" )
df = collection . find ({
"page_id" : 42
}, to_pandas = True )
print ( df ) import aeca
# Establish connection to a local database server.
channel = aeca . Channel ( "localhost" , 10080 )
# Login to the database.
ws = aeca . Workspaces ( channel , "user_id" , "password" )
# List workspaces.
workspaces = ws . list_workspaces ()
for workspace in workspaces :
print ( workspace )
# Open the workspace and list the collections.
workspace = ws . find_workspace ( "test" )
db = aeca . DocumentDB ( workspace )
collections = db . list_collections ()
for collection in collections :
print ( collection )
# Find a specific document in the Wikipedia collection.
collection = aeca . find_collection ( "Wikipedia" )
df = collection . find ({
"page_id" : 42
}, to_pandas = True )
print ( df )