Конвертер стилей именования переменных
Tool guide
Snake_case is the Python convention from PEP 8 and the natural shape for PostgreSQL and MySQL columns, where unquoted identifiers fold to lower case anyway. When a front end sends keys like createdAt, the back end needs created_at instead. This converter rewrites a whole list at once by splitting on capital letters, and it runs in the page, so table and field names stay with you. See also: the same list as kebab-case for CSS, swap underscores for hyphens, force everything to lowercase.
PEP 8 says so: functions, variables and attributes use lower case words joined by underscores, while CamelCase is reserved for class names. Mixing styles is not an error, but linters such as flake8 and ruff will flag it and the code stops looking familiar to the next reader.
List the response keys one per line, convert them here and use the output as attribute names. In pydantic or a DRF serializer, declare the original spelling as an alias so the public contract keeps camelCase while your code keeps snake_case. Both sides keep their own convention.
An underscore is inserted before every capital, so userID becomes user_i_d rather than user_id. Fix those by hand, or normalise the acronym to userId before converting. Any purely mechanical case splitter has this limitation.
Not strictly, but it saves pain. Unquoted identifiers fold to lower case, so a column created as orderTotal ends up as ordertotal and loses its word boundaries. order_total looks the same in every query and never needs quoting.
A line with no capitals passes through untouched — there is nothing to split, and existing underscores are preserved. That means you can paste a mixed list without sorting out which names have already been converted.
The output here is lower case, so upper-case it in a second step with an uppercase text converter. Python constants and .env variables use that form: MAX_RETRY_COUNT rather than max_retry_count.
Before: createdAt updatedAt isEmailConfirmed
After: created_at updated_at is_email_confirmed
Before: orderTotalAmount customerPhone
After: order_total_amount customer_phone — no quoting needed in PostgreSQL
Your rating and feedback help decide what to improve next.