{"id":1644,"library":"pydash","title":"Pydash: Python Utility Library","description":"Pydash is a Python port of the JavaScript utility library Lo-Dash, providing a comprehensive set of functional programming helpers for collections, objects, strings, and more. It aims to simplify common programming tasks with a functional, declarative style. The current version is 8.0.6, and it follows an infrequent release cadence, often aligning with major Lo-Dash updates or significant Python ecosystem changes.","status":"active","version":"8.0.6","language":"python","source_language":"en","source_url":"https://github.com/dgilland/pydash","tags":["utility","functional programming","lodash","collections","data manipulation"],"install":[{"cmd":"pip install pydash","lang":"bash","label":"Install Pydash"}],"dependencies":[],"imports":[{"note":"Most common functions are directly available via 'import pydash' or 'from pydash import func_name'. The `pydash.api` module is for internal structure rather than direct import.","wrong":"from pydash.api import functions","symbol":"pydash","correct":"import pydash"},{"note":"Functions are typically imported directly from the top-level `pydash` module or accessed via `pydash.<func_name>`.","symbol":"get","correct":"from pydash import get"},{"note":"Many functions conflicting with Python built-ins (like `map`, `filter`, `sum`) were renamed with a trailing underscore (e.g., `map_`) in v8.0.0.","wrong":"from pydash import map","symbol":"map_","correct":"from pydash import map_"}],"quickstart":{"code":"import pydash\n\ndata = {\n    'user': 'fred',\n    'age': 40,\n    'active': False,\n    'posts': [\n        {'title': 'Post 1', 'tags': ['news', 'tech']},\n        {'title': 'Post 2', 'tags': ['coding', 'python']}\n    ]\n}\n\n# Get a deeply nested value\npost_tag = pydash.get(data, 'posts[0].tags[1]')\nprint(f\"Deeply nested tag: {post_tag}\")\n\n# Filter a list of dictionaries\npython_posts = pydash.filter_(data['posts'], lambda x: 'python' in x['tags'])\nprint(f\"Posts about Python: {python_posts}\")\n\n# Chain operations for a more functional style\nchained_result = pydash.chain(data['posts']) \\\n    .filter_(lambda x: 'python' in x['tags']) \\\n    .map_('title') \\\n    .value()\nprint(f\"Chained operation result: {chained_result}\")","lang":"python","description":"This quickstart demonstrates fetching nested data, filtering collections, and chaining multiple operations in a functional style, which is a core feature of pydash. It uses common functions like `get`, `filter_`, `map_`, and `chain`."},"warnings":[{"fix":"Update your code to use the underscore-suffixed versions (e.g., `pydash.map_`, `pydash.filter_`). Refer to the v8.0.0 release notes for a complete list of renamed functions.","message":"Breaking change in v8.0.0: Functions that conflict with Python's built-in names (e.g., `map`, `filter`, `sum`, `max`, `min`) were renamed with a trailing underscore (e.g., `map_`, `filter_`).","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Consider importing `pydash` directly without an alias, or use a less common alias if conflicts arise. E.g., `import pydash` and use `pydash.get(...)` instead of `_.get(...)`.","message":"Aliasing `pydash` as `_` (e.g., `import pydash as _`) can lead to conflicts with other Python libraries that commonly use `_` for different purposes, such as `gettext` for internationalization or `collections.Counter` internal alias.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always check the documentation for specific functions to understand whether they mutate their inputs or return new objects. When in doubt, assume a new object is returned unless explicitly stated as an in-place modification.","message":"While pydash embraces a functional style, not all operations are strictly immutable. Some functions, like `set_` on objects, can modify the object in place, while others return new collections. This can be a source of confusion for users expecting pure functional immutability.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'8.0.6':48 'aim':33 'align':57 'cadenc':55 'chang':68 'collect':27,73 'common':36 'comprehens':20 'current':45 'dash':17,62 'data':74 'declar':42 'ecosystem':67 'follow':51 'function':23,41,70 'helper':25 'infrequ':53 'javascript':12 'librari':4,14 'lo':16,61 'lo-dash':15,60 'lodash':72 'major':59 'manipul':75 'object':28 'often':56 'port':9 'program':24,37,71 'provid':18 'pydash':1,5 'python':2,8,66 'releas':54 'set':21 'signific':65 'simplifi':35 'string':29 'style':43 'task':38 'updat':63 'util':3,13,69 'version':46","created_at":"2026-04-09T03:56:58.378499+00:00","updated_at":"2026-04-16T18:24:30.606947+00:00","problems":[{"fix":"pip install pydash","cause":"The pydash library is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'pydash'"},{"fix":"Use the underscore-suffixed version of the function (e.g., `pydash.map_`) or use the `py_` instance, which handles these aliases correctly (e.g., `from pydash import py_; py_.map(...)`).","cause":"The user is attempting to call a pydash function that shadows a Python built-in (e.g., `map`, `filter`, `round`, `sum`) directly without its underscore-suffixed version, or incorrectly with the `py_` instance.","error":"AttributeError: module 'pydash' has no attribute 'map'"},{"fix":"Ensure that the target object and all intermediate path components are valid, mutable containers (like dictionaries or lists) where new keys or indices can be set, or handle potential `None` values explicitly before attempting to access or set nested paths.","cause":"This error occurs when using path-based functions like `pydash.objects.set_` or `pydash.get` where an intermediate key in the specified path resolves to `None` (or another non-subscriptable object), and the function attempts to access further nested keys or elements.","error":"TypeError: 'NoneType' object is not subscriptable"},{"fix":"Import the `py_` instance from pydash, typically aliasing it to `_` for convenience: `from pydash import py_ as _`.","cause":"The user is attempting to use the `_` instance for pydash's chained operations or direct function calls without explicitly importing it.","error":"NameError: name '_' is not defined"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"8.0.6","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/dgilland/pydash","docs":"https://pydash.readthedocs.org","changelog":"https://github.com/dgilland/pydash/blob/develop/CHANGELOG.rst","pypi":"https://pypi.org/project/pydash/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-27","next_check":"2026-07-28","install_tag":null}}