mysql_to_sqlite3 package¶
Submodules¶
mysql_to_sqlite3.cli module¶
The command line interface of MySQLtoSQLite.
mysql_to_sqlite3.click_utils module¶
Click utilities.
- class mysql_to_sqlite3.click_utils.OptionEatAll(*args, **kwargs)[source]¶
Bases:
Option
Taken from https://stackoverflow.com/questions/48391777/nargs-equivalent-for-options-in-click#answer-48394004.
mysql_to_sqlite3.debug_info module¶
Module containing bug report helper(s).
Adapted from https://github.com/psf/requests/blob/master/requests/help.py
mysql_to_sqlite3.mysql_utils module¶
Miscellaneous MySQL utilities.
mysql_to_sqlite3.sqlite_utils module¶
SQLite adapters and converters for unsupported data types.
- class mysql_to_sqlite3.sqlite_utils.CollatingSequences[source]¶
Bases:
object
Taken from https://www.sqlite.org/datatype3.html#collating_sequences.
- BINARY: str = 'BINARY'¶
- NOCASE: str = 'NOCASE'¶
- RTRIM: str = 'RTRIM'¶
- mysql_to_sqlite3.sqlite_utils.adapt_decimal(value: Any) str [source]¶
Convert decimal.Decimal to string.
- mysql_to_sqlite3.sqlite_utils.adapt_timedelta(value: Any) str [source]¶
Convert datetime.timedelta to %H:%M:%S string.
- mysql_to_sqlite3.sqlite_utils.convert_date(value: str | bytes) date [source]¶
Handle SQLite date conversion.
- mysql_to_sqlite3.sqlite_utils.convert_decimal(value: Any) Decimal [source]¶
Convert string to decimal.Decimal.
mysql_to_sqlite3.transporter module¶
Use to transfer a MySQL database to SQLite.
- class mysql_to_sqlite3.transporter.MySQLtoSQLite(**kwargs: Unpack[MySQLtoSQLiteParams])[source]¶
Bases:
MySQLtoSQLiteAttributes
Use this class to transfer a MySQL database to SQLite.
- COLUMN_LENGTH_PATTERN: Pattern[str] = re.compile('\\(\\d+\\)$')¶
- COLUMN_PATTERN: Pattern[str] = re.compile('^[^(]+')¶
- __init__(**kwargs: Unpack[MySQLtoSQLiteParams]) None [source]¶
Constructor.
mysql_to_sqlite3.types module¶
Types for mysql-to-sqlite3.
- class mysql_to_sqlite3.types.MySQLtoSQLiteAttributes[source]¶
Bases:
object
MySQLtoSQLite attributes.
- class mysql_to_sqlite3.types.MySQLtoSQLiteParams[source]¶
Bases:
TypedDict
MySQLtoSQLite parameters.
- buffered: bool | None¶
- chunk: int | None¶
- collation: str | None¶
- exclude_mysql_tables: Sequence[str] | None¶
- json_as_text: bool | None¶
- limit_rows: int | None¶
- log_file: str | PathLike[Any] | None¶
- mysql_charset: str | None¶
- mysql_collation: str | None¶
- mysql_database: str¶
- mysql_host: str¶
- mysql_password: str | bool | None¶
- mysql_port: int¶
- mysql_ssl_disabled: bool | None¶
- mysql_tables: Sequence[str] | None¶
- mysql_user: str¶
- prefix_indices: bool | None¶
- quiet: bool | None¶
- sqlite_file: str | PathLike[Any]¶
- vacuum: bool | None¶
- without_data: bool | None¶
- without_foreign_keys: bool | None¶
- without_tables: bool | None¶
Module contents¶
Utility to transfer data from MySQL to SQLite 3.