{"id":24198,"library":"para","title":"Para","description":"Para (v0.0.8) is a utility set that leverages Python's 'multiprocessing' module to distribute CPU-intensive tasks across multiple cores. It provides a simple API for parallel execution with built-in progress bar support and exception handling. Release cadence is irregular.","status":"active","version":"0.0.8","language":"python","source_language":"en","source_url":"https://github.com/halfak/para","tags":["multiprocessing","parallel","cpu-intensive"],"install":[{"cmd":"pip install para","lang":"bash","label":"Latest from PyPI"}],"dependencies":[],"imports":[{"note":"The primary function is map, used to apply a function to an iterable in parallel.","wrong":"","symbol":"map","correct":"from para import map"},{"note":"Returns results as they complete, useful for non-dependent tasks.","wrong":"","symbol":"map_unordered","correct":"from para import map_unordered"},{"note":"Like map but unpacks argument tuples.","wrong":"","symbol":"map_starmap","correct":"from para import map_starmap"}],"quickstart":{"code":"from para import map\n\ndef square(x):\n    return x * x\n\nresults = map(square, range(10), nprocesses=4)\nprint(list(results))\n# [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]","lang":"python","description":"Parallel mapping of a CPU-intensive function across 4 processes."},"warnings":[{"fix":"Consider alternatives like concurrent.futures, multiprocessing.Pool, or joblib.","message":"The library is very early stage (v0.0.8); API may change. Not recommended for production.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Wrap call with list() or iterate explicitly.","message":"map returns a generator, not a list. You must consume it (e.g., list(results)) to execute the tasks.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Define the function at module level or use pathos.multiprocessing instead.","message":"If the function is not picklable (e.g., lambda, nested function, class method), multiprocessing will raise an error. Use functools.partial or top-level functions.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use a named top-level function instead of lambda.","cause":"Lambda functions cannot be pickled by multiprocessing.","error":"AttributeError: Can't pickle local object 'my_function.<locals>.<lambda>'"},{"fix":"Use correct keyword: map(func, data, nprocesses=4).","cause":"The parameter is 'nprocesses' (note the uppercase 'P'), not 'nprocesses'.","error":"TypeError: map() got an unexpected keyword argument 'nprocesses'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}