Snake Case
Synopsis
Converts strings to snake_case format.
Schema
- snakecase:
field: <ident>
target_field: <string>
fields: <array>
exclude: <array>
description: <text>
if: <script>
ignore_failure: <boolean>
ignore_missing: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
Configuration
The following fields are used to define the processor:
Field | Required | Default | Description |
---|---|---|---|
field | N | - | Single field to convert to snake_case |
target_field | N | Same as field | Target field to store snake_case result |
fields | N | - | Array of fields to convert to snake_case |
exclude | N | - | Array of fields to exclude from conversion |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue processing if conversion fails |
ignore_missing | N | false | Skip processing if referenced field doesn't exist |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
Details
Converts string values to snake_case format by replacing spaces, hyphens, dots, and other separators with underscores, then converting all characters to lowercase. This format is commonly used in programming languages like Python, Ruby, and database naming conventions.
The processor handles various input formats including camelCase, PascalCase, kebab-case, and space-separated words, normalizing them to the consistent snake_case style.
snake_case format uses underscores as separators and converts all text to lowercase, resulting in format like "user_name", "api_response_data", or "system_config_value". It's widely used in Python and database schemas.
The processor preserves the logical word boundaries from the input while standardizing the format for consistent usage in code and data storage.
Consecutive separators in the input may result in multiple consecutive underscores in the output. The processor does not automatically clean up redundant separators.
Examples
Basic Conversion
Converting camelCase to snake_case... |
|
converts to snake_case: |
|
Database Column Names
Creating database-friendly column names... |
|
generates database column name: |
|
Mixed Format Input
Normalizing mixed separators to snake_case... |
|
standardizes all separators: |
|
Multiple Fields
Converting multiple fields to snake_case... |
|
processes all specified fields: |
|
Configuration Keys
Creating configuration key names... |
|
generates configuration key: |
|