skillfed

starrocks

Python SQLAlchemy Dialect for StarRocks with optional Alembic integration

starrocks v1.3.4 581.8K downloads/30d#5,906 on PyPI11,992
Permissive license Apache-2.0 Active released

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 starrocks

uv

uv add starrocks

poetry

poetry add starrocks

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Database :: Front-Ends

Tags

sqlalchemy dialect starrockspython starrocks clientstarrocks database connectionalembic schema migration starrocksasync sqlalchemy starrocksorm starrocks pythonstarrocks asyncmy driver
sqlalchemy-dialectanalytics-databaseschema-migration

More Front-Ends packages