{"id":24591,"library":"simplecosine","title":"simplecosine","description":"Simple cosine distance calculation for vectors. Version 1.2 provides a straightforward function to compute cosine similarity or distance between two vectors. No active development, stable API.","status":"active","version":"1.2","language":"python","source_language":"en","source_url":"https://github.com/datamade/simplecosine","tags":["cosine","distance","vector"],"install":[{"cmd":"pip install simplecosine","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"note":"cosine_distance is inside the cosine module, not package top-level","wrong":"from simplecosine import cosine_distance","symbol":"cosine_distance","correct":"from simplecosine.cosine import cosine_distance"}],"quickstart":{"code":"import os\nfrom simplecosine.cosine import cosine_distance\n\nv1 = [1, 0, 0]\nv2 = [0, 1, 0]\nresult = cosine_distance(v1, v2)\nprint(result)  # Output: 1.0","lang":"python","description":"Compute cosine distance between two vectors"},"warnings":[{"fix":"Use 1 - cosine_distance(a, b) to get cosine similarity","message":"cosine_distance returns cosine distance (1 - similarity), not similarity. Many users expect similarity and misinterpret the result.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure both vectors are Python lists of floats/ints of same length","message":"The function only works with 2D vectors; does not support sparse arrays or arrays of different lengths. It will raise error or give wrong results.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install simplecosine'","cause":"Package not installed","error":"ModuleNotFoundError: No module named 'simplecosine'"},{"fix":"Use 'from simplecosine.cosine import cosine_distance'","cause":"Wrong import path (top-level instead of submodule)","error":"ImportError: cannot import name 'cosine_distance' from 'simplecosine'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}