--- id: pydbml version: "1.2.1" license: MIT license_treatment: permissive maintenance: active --- # pydbml — Python parser and builder for DBML License: permissive · Maintenance: active · Downloads: 94.7K/mo ## What it is and what it does PyDBML is a Python parser and builder for DBML, a human-readable markup language for defining database schemas. It reads DBML files or strings and constructs an in-memory representation of the schema as a Database object, allowing you to access tables, references, enums, and table groups programmatically. You can then generate SQL DDL statements from the parsed schema or regenerate DBML from modified objects. The package is compliant with DBML v3.9.5 syntax and depends only on pyparsing for parsing. It's useful when you need to work with DBML schemas in Python code—reading them for documentation, validation, or transformation, or building schemas programmatically and exporting them as SQL or DBML. Use it for: - Parse a DBML schema file and generate SQL DDL to create database tables. - Read DBML definitions and programmatically extract table and column metadata for documentation or tooling. - Build a database schema in code and export it as DBML or SQL for version control and collaboration. - Validate or transform DBML schemas by parsing, modifying, and regenerating them. - Integrate DBML schema definitions into Python-based database migration or ORM tools. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyDBML parses and generates DBML (Database Markup Language) schemas, converting between DBML syntax and SQL or back to DBML format. Yes. PyDBML is actively maintained, has no known vulnerabilities, installs with minimal friction, and is permissively licensed. Install it if you need to parse or generate DBML schemas in Python—it's the standard tool for that task. ## Install pip install pydbml uv add pydbml poetry add pydbml ## Installing pydbml Before you install: Low install friction with a single runtime dependency (pyparsing). Active maintenance with a recent release in October 2025 and commits through April 2026. License in practice: MIT license permits commercial and private use with minimal restrictions; suitable for most projects without licensing concerns. Quickstart: from pydbml import PyDBML from pathlib import Path parsed = PyDBML(Path('schema.dbml')) for table in parsed.tables: print(table.name) print(parsed.sql) Requires Python 3.8 or higher. Verify before relying: - Whether the parser handles all DBML v3.9.5 features or only a subset. - Performance characteristics when parsing large or complex schemas. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 94.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags DBML parser python, database schema markup language, parse DBML files, generate SQL from DBML, DBML to SQL converter, database schema definition, DBML syntax parser, schema-definition, markup-language, sql-generation [View on SkillFed](https://skillfed.io/packages/pydbml) · [View on PyPI](https://pypi.org/project/pydbml/)