{"id":26999,"library":"flexvalue","title":"FLEXvalue","description":"FLEXvalue is a Python library for calculating avoided costs, commonly used in energy efficiency and demand-side management. Version 2.0.8 is the latest, with maintenance-oriented updates. Release cadence is irregular, driven by method updates.","status":"active","version":"2.0.8","language":"python","source_language":"en","source_url":"http://github.com/recurve-methods/flexvalue","tags":["energy","avoided-costs","efficiency","economics"],"install":[{"cmd":"pip install flexvalue","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The class name uses a lowercase 'v' (Flexvalue not FlexValue)","wrong":"from flexvalue import FlexValue","symbol":"Flexvalue","correct":"from flexvalue import Flexvalue"}],"quickstart":{"code":"from flexvalue import Flexvalue\n\n# Initialize with configuration (adjust parameters as needed)\nfv = Flexvalue()\n\n# Calculate avoided costs for a given scenario\nresult = fv.calculate(\n    fuel_price=0.05,          # $/kWh\n    discount_rate=0.03,       # 3%\n    lifetime_years=10,\n    annual_savings_kwh=10000\n)\nprint(result)","lang":"python","description":"Basic usage: import Flexvalue, create an instance with default parameters, and call calculate() with required inputs."},"warnings":[{"fix":"Change import to 'from flexvalue import Flexvalue' and replace all 'FlexValue' references with 'Flexvalue'.","message":"In version 2.0.0, the main class was renamed from 'FlexValue' to 'Flexvalue' (lowercase 'v'). Old code using 'FlexValue' will raise an ImportError.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Always call calculate() with explicit keyword arguments, e.g., calculate(fuel_price=..., discount_rate=..., ...).","message":"The calculate() method parameters changed in 2.0.0. Old code using positional arguments may silently produce wrong results if order changed. Always use keyword arguments.","severity":"gotcha","affected_versions":"<2.0.0"},{"fix":"Replace 'from flexvalue import avoided_cost' with 'from flexvalue import Flexvalue' and use the object-oriented approach.","message":"The function 'avoided_cost' (lowercase, module-level) is deprecated since 1.5.0 and removed in 2.0.0. Use the class-based API instead.","severity":"deprecated","affected_versions":">=1.5.0, <2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from flexvalue import Flexvalue' (note the lowercase v).","cause":"The class name changed to 'Flexvalue' (lowercase v) in version 2.0.0.","error":"ImportError: cannot import name 'FlexValue' from 'flexvalue'"},{"fix":"Update the keyword argument to 'fuel_price' (see documentation for exact parameter names).","cause":"Parameter name changed from 'fuel_cost' to 'fuel_price' in version 2.0.0.","error":"TypeError: calculate() got an unexpected keyword argument 'fuel_cost'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}