sqlalchemy-views
Adds CreateView and DropView constructs to SQLAlchemy
Decision gist · record as of 2026-08-14
Yes, if you need to manage database views within SQLAlchemy code. The package is small, stable, and has no known vulnerabilities. Install friction is minimal (one dependency). The main caveat is that it supports only a core subset of SQL dialects—if your database uses nonstandard CREATE/DROP VIEW syntax, you may need to fall back to raw SQL or check whether your dialect is covered.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with a single runtime dependency on sqlalchemy.
- The codebase is small and stable; maintenance has been minimal since early 2023 because it relies on stable SQLAlchemy APIs.
- Repository remains active with recent commits.
License · maintenance · safety
permissive license (permissive) — Licensed under MIT (permissive), so you can use, modify, and distribute this package freely with minimal restrictions.
last release 2023-02-18 (1273 days) · last repo commit 2026-04-13 · 58 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 150,750 downloads/mo, #10,955 on PyPI
Alternatives
Verify before relying
pip install sqlalchemy-views
from sqlalchemy import Table, MetaData
from sqlalchemy.sql import text
from sqlalchemy_views import CreateView, DropView
view = Table('my_view', MetaData())
definition = text("SELECT * FROM my_table")
create_view = CreateView(view, definition)
print(str(create_view.compile()).strip())- Whether the package supports all major SQL dialects or only a core subset of CREATE/DROP VIEW syntax
- Current compatibility with SQLAlchemy 2.0 beyond the stated 'early 2023' snapshot
What it is and what it does
sqlalchemy-views extends SQLAlchemy with two new SQL constructs—CreateView and DropView—that let you define and manipulate database views using SQLAlchemy's expression API instead of raw SQL strings. It wraps the view definition (typically a SELECT statement) and compiles it to the appropriate CREATE VIEW or DROP VIEW SQL for execution.
The package is designed for developers who want to manage views programmatically within SQLAlchemy applications, supporting common options like OR REPLACE, IF EXISTS, CASCADE, and dialect-specific view options. It relies entirely on sqlalchemy as its runtime dependency and has remained stable because it builds on SQLAlchemy's core, stable APIs rather than internal details.
Use it for
- Define database views in Python code alongside table definitions for schema migrations and setup scripts
- Conditionally create or replace views with OR REPLACE or IF EXISTS flags in application initialization
- Drop views safely with CASCADE when cleaning up or resetting a database schema
- Introspect existing views using SQLAlchemy's Table object and regenerate their definitions programmatically
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to manage database views within SQLAlchemy code.
The package is small, stable, and has no known vulnerabilities. Install friction is minimal (one dependency). The main caveat is that it supports only a core subset of SQL dialects—if your database uses nonstandard CREATE/DROP VIEW syntax, you may need to fall back to raw SQL or check whether your dialect is covered.
Install
sqlalchemy-views on PyPI
Before you install
Low friction install with a single runtime dependency on sqlalchemy. The codebase is small and stable; maintenance has been minimal since early 2023 because it relies on stable SQLAlchemy APIs. Repository remains active with recent commits.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install sqlalchemy-views
from sqlalchemy import Table, MetaData
from sqlalchemy.sql import text
from sqlalchemy_views import CreateView, DropView
view = Table('my_view', MetaData())
definition = text("SELECT * FROM my_table")
create_view = CreateView(view, definition)
print(str(create_view.compile()).strip())
Verify before relying
- Whether the package supports all major SQL dialects or only a core subset of CREATE/DROP VIEW syntax
- Current compatibility with SQLAlchemy 2.0 beyond the stated 'early 2023' snapshot
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagesqlalchemy |
| Maintenance | Actively maintained 1,273 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 150,750 / month, #10,955 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPyProgramming Language :: SQLTopic :: DatabaseTopic :: Database :: Database Engines/ServersTopic :: Software Development :: Libraries :: Python Modules |
Evidence: sqlalchemy_views-0.3.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “sqlalchemy view creation”
- sqlalchemy-viewsAdds CreateView and DropView SQL constructs to SQLAlchemy, enabling…
- sqladminGenerates a web-based admin interface for SQLAlchemy models,…
- sqlalchemy-firebirdProvides a SQLAlchemy 2.0+ dialect for connecting to and querying…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also django-pgviews-redux · SQLAlchemy · alembic_utils · schemainspect · teradatasqlalchemy · sqlbag · django-adminplus · iomete-sqlalchemy · sqlalchemy-vertica · databricks-sqlalchemy