Registry / database / pyarango

pyarango

JSON →
library2.1.1pypypi✓ verified 86d ago

An easy-to-use Python driver for ArangoDB with built-in validation, compatible with Python 2 and 3. Current version: 2.1.1. Release cadence is low, with occasional updates.

pip install pyarango
INSTALL
IMPORT
SIG · PYARANGO
P
pyarango
databasepythonv2.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Connection
from pyArango.connection import Connection
from pyarango import Connection
Case-sensitive import path, capital A in pyArango
Database
from pyArango.database import Database
from pyArango import Database
Database is in database module
Collection
from pyArango.collection import Collection
from pyArango import Collection
Collection is in collection module
Document
from pyArango.document import Document
from pyArango import Document
Document is in document module

Connects to ArangoDB, creates database and collection, inserts a document.

from pyArango.connection import Connection # Connect to ArangoDB conn = Connection(arangoURL='http://localhost:8529', username='root', password='') # Create or get a database db = conn.createDatabase(name='test_db') # or: db = conn['test_db'] # Create a collection col = db.createCollection(name='users') # Create a document doc = col.createDocument() doc['name'] = 'John' doc['age'] = 30 doc.save() print('Document key:', doc['_key'])
Debug
Known issues
gotchaImport paths are case-sensitive: use `pyArango` (capital A) not `pyarango`.
fix
Use `from pyArango.connection import Connection` etc.
affects: all
gotchaThe library does not support async/await; all calls are synchronous.
fix
Use `arango` library if you need async support.
affects: all
gotchaThe `Connection` object does not automatically authenticate. You must pass `username` and `password` to the constructor, even for root with empty password.
fix
Always provide `username` and `password` arguments.
affects: all
deprecated`Database.createCollection()` behavior changed in version 2.0; previously it would return existing collection if exists, now raises an error.
fix
Use `Database.collections['collection_name']` to get existing collection, or wrap in try/except.
affects: >=2.0
Errors
Common errors & fixes
AttributeError: module 'pyArango' has no attribute 'connection'
Wrong import path; library uses camelCase pyArango.
fix
Use `from pyArango.connection import Connection` (capital A).
pyArango.connection.ConnectionError: Unable to connect to ArangoDB at http://localhost:8529
ArangoDB server not running or connection parameters incorrect.
fix
Ensure ArangoDB is running on localhost:8529, or set correct URL.
pyArango.errors.CreateError: Collection already exists
Trying to create a collection that already exists.
fix
Check if collection exists first: `if 'users' not in db.collections: col = db.createCollection('users')`
KeyError: 'users'
Trying to access a non-existent collection via `db['users']`.
fix
Use `db.collections['users']` or `db.collections.get('users')`.
Upgrade
Version history
2.1.1latest on PyPI · released Mar 25, 2024
Audit
Dependencies
requestsrequiredHTTP requests to ArangoDB server
sixrequiredPython 2/3 compatibility
Agent activity
14 hits · last 30 days
node
12
Resources
pyarango — pip install pyarango · libregistry