{"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":"en","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,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}