Skip to content

Instantly share code, notes, and snippets.

@apetenchea
Last active July 15, 2026 10:40
Show Gist options
  • Select an option

  • Save apetenchea/d03cc1455d76141886870166ad58f6b9 to your computer and use it in GitHub Desktop.

Select an option

Save apetenchea/d03cc1455d76141886870166ad58f6b9 to your computer and use it in GitHub Desktop.
Extending the Python ecosystem

Extending the Python ecosystem

1. SQLAlchemy.

Unfortunately, ArangoDB isn't SQL, so this would probably have to expose AQL instead of SQL, or only support a subset. The question is whether SQLAlchemy's architecture is flexible enough for AQL instead of SQL.

2. Ibis

It provides a dataframe API that compiles to backend-specific query languages.

https://ibis-project.org/

t = con.table("users")

t.filter(t.age > 30).group_by("country").count()

3. Pandas connector

df = arangodb.to_pandas()

4. Polars connector

db.aql(...).to_polars()

5. Apache arrow

Arrow has become the common interchange format.

6. NetworkX

I could take over the project. Update the CI, at first.

https://github.com/arangodb/nx-arangodb

It has 3 issues and 2 draft PRs

I could also add better support in the driver:

G = db.graph("social").to_networkx()

7. Pydantic models

Very Pythonic.

class User(BaseModel):
    name: str
    age: int

db.collection("users").insert(User(...))

users = db.collection("users").find(User)

This is becoming the standard experience in modern Python libraries.

Note: for these extensions, use optional dependencies in pyproject.toml:

[project.optional-dependencies]
pandas = [
    "pandas>=2.0",
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment