MySQL to reStructuredText Converter
Transform MySQL database dumps into reStructuredText table format for Sphinx documentation and Python projects
MySQL Input
reStructuredText Output
About MySQL to reStructuredText Converter
Convert MySQL database dumps (CREATE TABLE and INSERT statements) to reStructuredText table format for use in Python documentation, Sphinx projects, ReadTheDocs, and technical writing. reStructuredText (RST) is a lightweight markup language commonly used in the Python ecosystem.
Key Features
- Grid Tables: Robust format with borders, supports multi-line cells
- Simple Tables: Clean, minimal syntax for straightforward tables
- Header Support: Optional header rows with = separator
- Auto-sizing: Automatically calculates optimal column widths
- Sphinx Compatible: Works perfectly with Sphinx documentation generator
- Smart Parsing: Extracts column names and data from MySQL dumps
- File Download: Save as .rst file
How to Use
- Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
- Choose Table Style: Select grid table (robust) or simple table (clean)
- Configure Header: Toggle header row with = separator
- Copy or Download: Use the Copy or Download button to save your RST table
Table Styles
- Grid Table: Uses +, -, |, and = characters to create bordered tables with full support for multi-line cells
- Simple Table: Uses = characters for separators, cleaner syntax but limited to single-line cells
Example Conversion
MySQL Input:
CREATE TABLE employees ( id INT, name VARCHAR(100), age INT, city VARCHAR(50) ); INSERT INTO employees VALUES (1, 'John Doe', 28, 'New York'); INSERT INTO employees VALUES (2, 'Jane Smith', 34, 'London');
reStructuredText Output (Grid Table):
+----+------------+-----+----------+ | id | name | age | city | +====+============+=====+==========+ | 1 | John Doe | 28 | New York | +----+------------+-----+----------+ | 2 | Jane Smith | 34 | London | +----+------------+-----+----------+
reStructuredText Output (Simple Table):
== ============ === ========== id name age city == ============ === ========== 1 John Doe 28 New York 2 Jane Smith 34 London == ============ === ==========
Common Use Cases
- Python Documentation: Document database schemas in Python projects
- Sphinx Projects: Include database tables in Sphinx-generated documentation
- ReadTheDocs: Display MySQL data in ReadTheDocs documentation
- Technical Writing: Create technical documentation with database examples
- API Documentation: Document database structures in API docs
- PEPs: Include tables in Python Enhancement Proposals
Sphinx Integration
The generated reStructuredText tables work seamlessly with Sphinx:
- Automatic Rendering: Sphinx automatically renders RST tables as HTML
- Theme Support: Tables adapt to your Sphinx theme
- Cross-references: Can be referenced from other documentation pages
- PDF Export: Tables are included in PDF documentation builds
Grid vs Simple Tables
Grid Tables:
- More robust and flexible
- Support multi-line cells
- Clear visual structure with borders
- Better for complex data
Simple Tables:
- Cleaner, more minimal syntax
- Easier to edit manually
- Better for simple, single-line data
- More readable in plain text
Supported MySQL Syntax
- CREATE TABLE: Extracts column names for table headers
- INSERT INTO: Parses data values from INSERT statements
- Data Types: Handles all MySQL data types (VARCHAR, INT, DECIMAL, etc.)
- Quoted Strings: Handles single and double quotes with proper escaping
reStructuredText Resources
- Sphinx: Python documentation generator (sphinx-doc.org)
- ReadTheDocs: Documentation hosting platform (readthedocs.org)
- Docutils: reStructuredText processing system
- Python PEPs: Python Enhancement Proposals use RST
Privacy & Security
All conversions happen locally in your browser. Your MySQL data is never uploaded to any server, ensuring complete privacy and security.
