{"id":28290,"library":"springpy","title":"SpringPy","description":"SpringPy is a Python library for visualizing distance matrices as force-directed spring layouts. Version 0.1.0, released with an unspecified cadence. It supports Python >=3.4 and provides an easy interface to generate spring-based visualizations from distance matrices.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/kiwirafe/springpy","tags":["distance-matrix","visualization","spring-layout","force-directed"],"install":[{"cmd":"pip install springpy","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Required for plotting the spring layout visualization.","package":"matplotlib","optional":true}],"imports":[{"note":"springpy is a module, not a submodule; import directly.","wrong":"from springpy import springpy","symbol":"springpy","correct":"import springpy"}],"quickstart":{"code":"import springpy\nimport numpy as np\n\n# Example distance matrix\ndist_matrix = np.array([[0, 1, 2],\n                        [1, 0, 3],\n                        [2, 3, 0]])\n\n# Visualize using default settings\nspringpy.draw(dist_matrix)","lang":"python","description":"Visualize a distance matrix using SpringPy's force-directed layout. Provide a square distance matrix as a 2D array-like (list of lists or numpy array). The draw function will display a matplotlib plot."},"warnings":[{"fix":"Ensure input matrix is symmetric (dist_matrix == dist_matrix.T) and contains only non-negative values.","message":"The distance matrix must be symmetric and non-negative. The library does not explicitly validate this; providing an asymmetric matrix may produce unexpected behavior.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider pinning the version and testing thoroughly before upgrading.","message":"The library version 0.1.0 is early-stage and APIs may change without notice. Not recommended for production use.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Install matplotlib separately: pip install matplotlib","message":"The library requires matplotlib for plotting, but it is not declared as a strict dependency. If matplotlib is missing, calling springpy.draw() will raise an ImportError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'pip install springpy' to install the package.","cause":"springpy is not installed or the Python environment does not include it.","error":"ImportError: No module named 'springpy'"},{"fix":"Use 'import springpy' then 'springpy.draw(...)'. If using an older version, upgrade with 'pip install --upgrade springpy'.","cause":"The import statement might be incorrect (e.g., from springpy import springpy) or an outdated version.","error":"AttributeError: module 'springpy' has no attribute 'draw'"},{"fix":"Ensure the input is a square numeric matrix (list of lists or numpy array).","cause":"Passing a non-square or non-numeric matrix that causes internal boolean operations.","error":"ValueError: The truth value of an array with more than one element is ambiguous"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}