{"id":45174,"library":"ixmp4","title":"ixmp4","description":"A data warehouse for scenario analysis, designed to store, manage, and query scenario data in a structured way. Current version 0.16.3, requires Python 3.10-3.14, released under the IIASA organization. Regular releases, actively maintained.","status":"active","version":"0.16.3","language":"python","source_language":"en","source_url":"https://github.com/iiasa/ixmp4","tags":["scenario analysis","data warehouse","energy modeling","iamc"],"install":[{"cmd":"pip install ixmp4","lang":"bash","label":"Standard install"},{"cmd":"pip install ixmp4[all]","lang":"bash","label":"Install with all extras (e.g., pandas, scenario analysis)"}],"dependencies":[{"reason":"Optional dependency for DataFrame operations; included in [all] extra.","package":"pandas","optional":true},{"reason":"Database backend; required but automatically installed.","package":"sqlalchemy","optional":false},{"reason":"Optional for ClickHouse backend; included in [all] extra.","package":"clickhouse-driver","optional":true},{"reason":"Optional for DuckDB backend; included in [all] extra.","package":"duckdb","optional":true}],"imports":[{"note":"The old ixmp library (v3) used 'from ixmp import Platform'. ixmp4 is a separate package.","wrong":"from ixmp import Platform","symbol":"Platform","correct":"from ixmp4 import Platform"},{"note":"Scenario is imported from the same top-level module.","wrong":"None","symbol":"Scenario","correct":"from ixmp4 import Scenario"},{"note":"Run is also available at top-level.","wrong":"None","symbol":"Run","correct":"from ixmp4 import Run"}],"quickstart":{"code":"from ixmp4 import Platform\nimport os\n\n# Create or connect to a local DuckDB-backed platform\n# Specify a path; if not provided, uses in-memory\nplatform = Platform(\n    backend=\"duckdb\",\n    path=\"example.db\",\n    db_url=None\n)\n\n# Create a scenario\nscenario = platform.scenarios.create(\n    name=\"example_scenario\",\n    model=\"my_model\",\n    scenario_class=\"reference\"\n)\n\n# Filter scenarios\nscenarios = platform.scenarios.list(name=\"example*\")\nprint(scenarios)\n\n# Run something (if applicable)\n# run = platform.runs.create(scenario=scenario, name=\"run1\")\n# print(run)\n\nprint(\"ixmp4 quickstart complete.\")","lang":"python","description":"Connects to a local DuckDB-backed platform, creates a scenario, lists it."},"warnings":[{"fix":"Update imports and adapt to new class-based API (Platform, Scenario, Run) instead of deprecated patterns.","message":"In ixmp4, the API is completely redesigned from ixmp v3. The old 'from ixmp import Platform' will fail. Use 'from ixmp4 import Platform'.","severity":"breaking","affected_versions":"All versions"},{"fix":"Provide only 'path' for DuckDB (local file), or only 'db_url' for other databases (e.g., PostgreSQL).","message":"If you specify both 'path' and 'db_url', the behavior is undefined. Use one or the other. For non-DuckDB backends, use db_url.","severity":"gotcha","affected_versions":"All versions <=0.16.3"},{"fix":"Use 'scenario_class' for now, but check release notes for changes.","message":"The 'scenario_class' parameter may be renamed to 'class' in future versions. Watch for deprecation warnings.","severity":"deprecated","affected_versions":"0.16.x"}],"env_vars":null,"search_vec":"'-3.14':26 '0.16.3':22 '3.10':25 'activ':34 'analysi':7,37 'current':20 'data':3,15,38 'design':8 'energi':40 'iamc':42 'iiasa':30 'ixmp4':1 'maintain':35 'manag':11 'model':41 'organ':31 'python':24 'queri':13 'regular':32 'releas':27,33 'requir':23 'scenario':6,14,36 'store':10 'structur':18 'version':21 'warehous':4,39 'way':19","created_at":"2026-06-07T12:53:42.916445+00:00","updated_at":"2026-06-07T12:53:42.916445+00:00","problems":[{"fix":"Run 'pip install ixmp4' in the active virtual environment.","cause":"Package not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'ixmp4'"},{"fix":"Change to 'from ixmp4 import Platform'. Ensure ixmp4 is installed.","cause":"Using old import pattern from ixmp v3 instead of ixmp4.","error":"ImportError: cannot import name 'Platform' from 'ixmp'"},{"fix":"Use db_url for PostgreSQL? Currently not supported natively; use DuckDB or ClickHouse instead.","cause":"Only specified backends are supported. 'postgresql' is not in the list.","error":"ixmp4.errors.IXMPError: Backend 'postgresql' not supported. Supported backends: duckdb, clickhouse, sqlite"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/iiasa/ixmp4","github":"https://github.com/iiasa/ixmp4","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["analytics","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}