MCPcopy
hub / github.com/pydantic/pydantic / get_title_from_name

Method get_title_from_name

pydantic/json_schema.py:2161–2170  ·  view source on GitHub ↗

Retrieves a title from a name. Args: name: The name to retrieve a title from. Returns: The title.

(self, name: str)

Source from the content-addressed store, hash-verified

2159 # ### Utility methods
2160
2161 def get_title_from_name(self, name: str) -> str:
2162 """Retrieves a title from a name.
2163
2164 Args:
2165 name: The name to retrieve a title from.
2166
2167 Returns:
2168 The title.
2169 """
2170 return name.title().replace('_', ' ').strip()
2171
2172 def field_title_should_be_set(self, schema: CoreSchemaOrField) -> bool:
2173 """Returns true if a field with the given schema should have a title set based on the field name.

Callers 4

kw_arguments_schemaMethod · 0.95
p_arguments_schemaMethod · 0.95
arguments_v3_schemaMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected