--- id: simple-ddl-parser version: "1.13.0" license: MIT license_treatment: permissive maintenance: active --- # simple-ddl-parser — Simple DDL Parser to parse SQL & dialects like HQL, TSQL (MSSQL), Oracle, AWS Redshift, Snowflake, MySQL, PostgreSQL, etc ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc.; sequences, alters, custom types & other entities from ddl. License: permissive · Maintenance: active · Downloads: 264.7K/mo ## What it is and what it does Simple DDL Parser is a Python library built on ply (Python's lex and yacc implementation) that converts SQL Data Definition Language statements into structured dictionaries or JSON. It supports multiple SQL dialects including HQL, MSSQL, Oracle, MySQL, PostgreSQL, BigQuery, Redshift, Snowflake, SparkSQL, IBM DB2, and others. The parser extracts detailed schema information—table names, column definitions with types and sizes, primary keys, constraints, defaults, and references—while preserving dialect-specific properties like partitioning and storage formats when requested. The library is case-insensitive and designed to handle real-world DDL variations. It offers both a Python API for programmatic use and a command-line tool (sdp) for batch processing. Output can be customized via output_mode to include dialect-specific fields or reshaped into formats like BigQuery JSON schema. The maintainer actively adds support for new statements and dialects based on user requests and maintains functional test coverage. Use it for: - Extract table and column metadata from existing SQL databases to generate documentation or ERD diagrams. - Convert DDL from one SQL dialect to another by parsing and reshaping output with custom schemas. - Validate and normalize DDL statements programmatically in data pipeline or schema migration tools. - Parse Hive or BigQuery DDL to extract partition, storage, and location metadata for data lake management. - Generate Python ORM models or database client code from DDL definitions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses SQL DDL statements and their dialect variants into structured Python dictionaries or JSON, extracting table schemas, columns, constraints, and dialect-specific properties. Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and is widely used. It solves a real problem—parsing diverse SQL dialects into structured data—with a permissive MIT license. Install it if you need to programmatically extract or transform SQL schema definitions. ## Install pip install simple-ddl-parser uv add simple-ddl-parser poetry add simple-ddl-parser ## Installing simple-ddl-parser Before you install: Low friction installation with a single runtime dependency (ply). Actively maintained with recent commits and a stable release cadence; maintainer explicitly guarantees backward compatibility in patch and minor versions. License in practice: MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal obligations. Quickstart: from simple_ddl_parser import DDLParser ddl = "CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(2000))" result = DDLParser(ddl).run() print(result) Requires Python 3.9 or later; ply must be installed as a runtime dependency. Verify before relying: - Extent of support for edge cases and less common SQL dialects beyond the documented list. - Performance characteristics when parsing very large or complex DDL files. - Accuracy of output structure consistency across all supported dialects and output modes. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 264.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags SQL DDL parser, parse SQL schema, extract table structure from DDL, SQL dialect parser, convert DDL to JSON, database schema parsing, HQL parser, sql-parsing, schema-extraction, ddl [View on SkillFed](https://skillfed.io/packages/simple-ddl-parser) · [View on PyPI](https://pypi.org/project/simple-ddl-parser/)