{"id":27212,"library":"opytional","title":"opytional","description":"opytional makes working with values that might be None safer and easier. Current version 0.1.0, released about 2020-07-28. Low release cadence.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/mmore500/opytional","tags":["utility","none-safety","decorator"],"install":[{"cmd":"pip install opytional","lang":"bash","label":"pip install"}],"dependencies":[],"imports":[{"note":"Common pattern is to use opytionalize or the decorator; there is no 'optional_value' symbol. Check docs for exact API.","wrong":"","symbol":"optional_value","correct":"from opytional import opytionalize"},{"note":"'Optional' is from typing, not opytional. opytional provides opytionalize and related functions.","wrong":"from opytional import Optional","symbol":"Optional","correct":"from opytional import opytionalize"}],"quickstart":{"code":"from opytional import opytionalize\n\n@opytionalize\ndef maybe_divide(a, b):\n    return a / b\n\nresult = maybe_divide(10, None)  # returns None instead of raising TypeError\n","lang":"python","description":"Decorator that makes functions return None if any argument is None, avoiding manual None checks."},"warnings":[{"fix":"Manually check return values or chain opytionalize on nested calls.","message":"opytionalize only works if None is passed as an argument; it does not handle None returned from a called function inside the decorated function.","severity":"gotcha","affected_versions":"all"},{"fix":"Evaluate if the library meets your needs; for critical projects, prefer actively maintained alternatives.","message":"Library is minimal and not actively maintained; last release 2020, few downloads. Consider using more robust alternatives like pydantic or more-itertools?","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Apply the @opytionalize decorator to the function to automatically return None when any argument is None.","cause":"Calling a function without opytionalize that expects a value but receives None.","error":"TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'"},{"fix":"Use 'from opytional import opytionalize' instead.","cause":"Trying to import a non-existent function; opytional only provides opytionalize and a few helpers.","error":"AttributeError: module 'opytional' has no attribute 'maybe'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}