# utils

> **Module** in `langchain_core`

📖 [View in docs](https://reference.langchain.com/python/langchain-core/utils)

Utility functions for LangChain.

These functions do not depend on any other LangChain module.

## Properties

- `formatter`

## Methods

- [`import_attr()`](https://reference.langchain.com/python/langchain-core/utils/import_attr)
- [`abatch_iterate()`](https://reference.langchain.com/python/langchain-core/utils/abatch_iterate)
- [`get_from_dict_or_env()`](https://reference.langchain.com/python/langchain-core/utils/get_from_dict_or_env)
- [`get_from_env()`](https://reference.langchain.com/python/langchain-core/utils/get_from_env)
- [`get_bolded_text()`](https://reference.langchain.com/python/langchain-core/utils/get_bolded_text)
- [`get_color_mapping()`](https://reference.langchain.com/python/langchain-core/utils/get_color_mapping)
- [`get_colored_text()`](https://reference.langchain.com/python/langchain-core/utils/get_colored_text)
- [`print_text()`](https://reference.langchain.com/python/langchain-core/utils/print_text)
- [`batch_iterate()`](https://reference.langchain.com/python/langchain-core/utils/batch_iterate)
- [`pre_init()`](https://reference.langchain.com/python/langchain-core/utils/pre_init)
- [`comma_list()`](https://reference.langchain.com/python/langchain-core/utils/comma_list)
- [`sanitize_for_postgres()`](https://reference.langchain.com/python/langchain-core/utils/sanitize_for_postgres)
- [`stringify_dict()`](https://reference.langchain.com/python/langchain-core/utils/stringify_dict)
- [`stringify_value()`](https://reference.langchain.com/python/langchain-core/utils/stringify_value)
- [`build_extra_kwargs()`](https://reference.langchain.com/python/langchain-core/utils/build_extra_kwargs)
- [`check_package_version()`](https://reference.langchain.com/python/langchain-core/utils/check_package_version)
- [`convert_to_secret_str()`](https://reference.langchain.com/python/langchain-core/utils/convert_to_secret_str)
- [`from_env()`](https://reference.langchain.com/python/langchain-core/utils/from_env)
- [`get_pydantic_field_names()`](https://reference.langchain.com/python/langchain-core/utils/get_pydantic_field_names)
- [`guard_import()`](https://reference.langchain.com/python/langchain-core/utils/guard_import)
- [`mock_now()`](https://reference.langchain.com/python/langchain-core/utils/mock_now)
- [`raise_for_status_with_text()`](https://reference.langchain.com/python/langchain-core/utils/raise_for_status_with_text)
- [`secret_from_env()`](https://reference.langchain.com/python/langchain-core/utils/secret_from_env)
- [`xor_args()`](https://reference.langchain.com/python/langchain-core/utils/xor_args)

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/9f232caa7a8fe1ca042a401942d5d90d54ceb1a6/libs/core/langchain_core/utils/__init__.py)