starrocks
Python SQLAlchemy Dialect for StarRocks with optional Alembic integration
What it is and what it does
This package is a SQLAlchemy dialect that bridges Python applications to StarRocks, a next-generation real-time analytics database. It allows developers to use SQLAlchemy's ORM and expression language to query and manage StarRocks tables, as well as define tables with StarRocks-specific attributes like primary keys, distribution strategies, and replication settings. The package also integrates with Alembic to automate schema migrations, including support for views and materialized views.
The dialect supports both synchronous connections (via pymysql) and asynchronous connections (via asyncmy2), making it suitable for both traditional and async Python applications. It includes helpers for defining views and materialized views, and can generate migration code from existing database schemas. The package is actively maintained and targets modern Python versions from 3.10 to 3.14.
Use it for:
- Build a Python web application that queries StarRocks for real-time analytics dashboards using SQLAlchemy ORM.
- Automate schema migrations in a StarRocks data warehouse using Alembic without writing raw SQL.
- Define and manage complex StarRocks tables with distribution and replication settings via SQLAlchemy declarative models.
- Integrate async Python applications (e.g., FastAPI services) with StarRocks using the asyncmy driver.
- Generate Python ORM models from an existing StarRocks database schema using sqlacodegen.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a SQLAlchemy dialect and Alembic integration for connecting Python applications to StarRocks, a real-time analytics database platform.
Yes. The package is actively maintained, has no known vulnerabilities, supports current Python versions, and provides a well-integrated path into StarRocks for Python developers already using SQLAlchemy. Install it if you need to connect a Python application to StarRocks; the low friction and permissive license make it a straightforward choice.
Install
starrocks on PyPI
pip
pip install starrocksuv
uv add starrockspoetry
poetry add starrocksInstalling starrocks
Before you install
Low friction install with a pure-Python wheel. Maintained actively with a recent release and high repository engagement. Requires Python 3.10 or later and depends on stable, widely-used libraries (sqlalchemy, pymysql, lark, alembic, asyncmy2).
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install starrocks
from sqlalchemy import create_engine, text
engine = create_engine('starrocks://root@localhost:9030/mydatabase')
with engine.connect() as connection:
rows = connection.execute(text("SELECT * FROM mytable LIMIT 2")).fetchall()
print(rows)
Requires Python >= 3.10, <= 3.14; StarRocks server must be running and accessible at the specified host and port.
Verify before relying
- Whether asyncmy2 is a typo for asyncmy or a distinct package; the dependency list shows 'asyncmy2' but documentation references 'asyncmy'.
- Performance characteristics and connection pooling behavior under high concurrency.
- Completeness of StarRocks-specific DDL support (e.g., all table properties, index types, partition strategies).
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — sqlalchemy, pymysql, lark, alembic, asyncmy2 |
| Maintenance | actively maintained — 13 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 581,817/month — #5,906 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: starrocks-1.3.4-py3-none-any.whl
Keywords: starrocks, sqlalchemy, dialect
Tags
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
psycopg2-binarypsycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
weaviate-clientA Python client library for connecting to and…
permissive · top 1,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
Flask-AlembicFlask-Alembic integrates Alembic database…
permissive · top 15,000 on PyPI
alembic_utilsExtends Alembic to autogenerate database…
permissive · top 5,000 on PyPI
sqlalchemy-cockroachdbA SQLAlchemy dialect that enables ORM and SQL…
permissive · top 5,000 on PyPI
iomete-sqlalchemyProvides a SQLAlchemy dialect for connecting to…
permissive · top 15,000 on PyPI
sqlalchemy-databricksProvides a SQLAlchemy dialect that connects to…
permissive · top 15,000 on PyPI
sqlalchemy_exasolSQLAlchemy dialect that enables Python…
permissive · top 15,000 on PyPI
sqlalchemy-jdbcapiSQLAlchemy dialect for JDBC and ODBC database…
permissive · top 15,000 on PyPI
databricks-sqlalchemyProvides a SQLAlchemy 2.0 dialect that bridges…
permissive · top 1,000 on PyPI
pydoris-customA Python client for Apache Doris that provides…
permissive · top 15,000 on PyPI