{"id":5042,"library":"QuantLib-Python","title":"QuantLib-Python","description":"QuantLib-Python provides official Python bindings for the open-source Quantitative Finance Library (QuantLib C++). It offers a comprehensive suite of models and tools for pricing, risk management, and analysis of financial instruments. As of version 1.41, the library is actively maintained with regular updates, making advanced financial analytics accessible in Python.","status":"active","version":"1.41","language":"python","source_language":"en","source_url":"https://github.com/lballabio/QuantLib-Python","tags":["finance","quantitative","derivatives","option-pricing","risk-management","fixed-income"],"install":[{"cmd":"pip install QuantLib-Python","lang":"bash","label":"Install using pip"}],"dependencies":[],"imports":[{"note":"It is common practice to import QuantLib with the alias 'ql' for brevity.","symbol":"QuantLib","correct":"import QuantLib as ql"}],"quickstart":{"code":"import QuantLib as ql\n\n# Set a global evaluation date (crucial for many QuantLib calculations)\ntodaysDate = ql.Date(15, ql.May, 2023)\nql.Settings.instance().evaluationDate = todaysDate\n\n# Create another QuantLib Date object\nanother_date = ql.Date(15, ql.May, 2024)\n\n# Print dates and check a simple calendar function (e.g., TARGET)\nprint(f\"Evaluation date: {todaysDate}\")\nprint(f\"Another date: {another_date}\")\nprint(f\"Is evaluation date a business day (TARGET calendar)? {ql.TARGET().isBusinessDay(todaysDate)}\")","lang":"python","description":"This quickstart demonstrates how to import QuantLib, set a global evaluation date, create QuantLib Date objects, and use a calendar function. Setting the evaluation date is a fundamental first step for most QuantLib applications."},"warnings":[{"fix":"Always use `QuantLib.Date` and `QuantLib.Calendar` for internal calculations, converting to/from `datetime` explicitly only when interacting with external Python libraries or data sources. Consult QuantLib documentation for specific date arithmetic and calendar rules.","message":"QuantLib uses its own robust date, calendar, and day counter system (e.g., `ql.Date`, `ql.Calendar`). Mixing directly with Python's `datetime` objects without proper conversion or misunderstanding QuantLib's specific business day conventions can lead to incorrect or unexpected results.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure proper observer registration for dependent objects. In scenarios where values seem stale, explicit calls to `update()` on observable objects might be necessary to trigger recalculations or verify that the observation chain is correctly configured.","message":"QuantLib heavily relies on an 'observable' pattern for dependency management (e.g., an instrument observing a yield curve). If underlying data or objects change, dependent objects might not automatically update their calculated values unless explicitly refreshed or properly observing these changes.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Profile critical sections of your code to identify performance bottlenecks. For highly performance-sensitive tasks, consider offloading computations to a C++ extension or pre-calculating results where feasible, or explore alternative pure-Python libraries for less complex tasks.","message":"While robust, the Python bindings introduce a performance overhead compared to direct C++ QuantLib usage. For very high-frequency calculations, large-scale Monte Carlo simulations, or iterative optimizations, this overhead can become significant.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-22T20:23:33.994Z","next_check":"2026-07-11T00:00:00.000Z","problems":[{"fix":"Ensure that QuantLib-Python is installed in your environment by running 'pip install QuantLib'.","cause":"The QuantLib-Python package is not installed or the Python environment cannot locate it.","error":"ModuleNotFoundError: No module named 'QuantLib'"},{"fix":"Verify that QuantLib-Python is correctly installed and that your Python environment is set up to locate the '_QuantLib' module.","cause":"The '_QuantLib' module, a core component of QuantLib-Python, is missing or not properly installed.","error":"ModuleNotFoundError: No module named '_QuantLib'"},{"fix":"Ensure that all necessary dependencies, such as the Microsoft Visual C++ Redistributable, are installed and that the system's PATH includes the directory containing the required DLLs.","cause":"A required DLL for QuantLib-Python is missing or not accessible.","error":"ImportError: DLL load failed: The specified module could not be found."},{"fix":"Add the directory containing the 'gurobi90.dll' to the system's PATH or copy the DLL to the 'gurobipy' package directory.","cause":"The 'gurobipy' module is missing a required DLL or the DLL is not in the system's PATH.","error":"ImportError: DLL load failed while importing gurobipy: The specified module could not be found."},{"fix":"Ensure that all necessary dependencies are installed and that the system's PATH includes the directory containing the required DLLs.","cause":"The 'shell' module is missing a required DLL or the DLL is not in the system's PATH.","error":"ImportError: DLL load failed while importing shell: The specified module could not be found."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.18","cli_name":"","cli_version":null,"type":"library","homepage":"http://quantlib.org","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/QuantLib-Python/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml"],"install_checks":{"last_tested":"2026-05-22","tag":null,"tag_description":null,"installed_version":"1.18","pypi_latest":"1.18","is_stale":false,"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"QuantLib-Python","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.27,"mem_mb":11.3,"disk_size":"104.7M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"QuantLib-Python","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.5,"import_time_s":0.14,"mem_mb":11.3,"disk_size":"98M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"QuantLib-Python","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":2.81,"mem_mb":12.5,"disk_size":"107.4M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"QuantLib-Python","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.5,"import_time_s":2.32,"mem_mb":12.5,"disk_size":"101M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"QuantLib-Python","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.18,"mem_mb":12.3,"disk_size":"99.1M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"QuantLib-Python","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.3,"import_time_s":1.27,"mem_mb":12.3,"disk_size":"93M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"QuantLib-Python","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.05,"mem_mb":12.9,"disk_size":"98.9M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"QuantLib-Python","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.5,"import_time_s":1.15,"mem_mb":12.9,"disk_size":"92M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"QuantLib-Python","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.15,"mem_mb":12,"disk_size":"104.4M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"QuantLib-Python","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.8,"import_time_s":0.14,"mem_mb":11.9,"disk_size":"98M"}]},"_links":{"self":"https://checklist.day/api/registry/QuantLib-Python","v1":"https://checklist.day/v1/registry/QuantLib-Python","v1_install":"https://checklist.day/v1/registry/QuantLib-Python/install","v1_imports":"https://checklist.day/v1/registry/QuantLib-Python/imports","v1_compatibility":"https://checklist.day/v1/registry/QuantLib-Python/compatibility","v1_quickstart":"https://checklist.day/v1/registry/QuantLib-Python/quickstart","docs":"https://checklist.day/docs"}}