{"id":27414,"library":"sphn","title":"SPHN (SPHN Data Model)","description":"A Python library for working with the SPHN (Swiss Personalized Health Network) data model. Version 0.2.1. Enables creation, validation, and serialization of SPHN-compliant RDF data. Currently in early development with frequent releases.","status":"active","version":"0.2.1","language":"python","source_language":"en","source_url":"https://github.com/SwissPersonalizedHealthNetwork/sphn-python","tags":["sphn","healthcare","rdf","semantic","data-model"],"install":[{"cmd":"pip install sphn","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"RDF graph handling","package":"rdflib","optional":false},{"reason":"SHACL validation","package":"pyshacl","optional":true}],"imports":[{"note":"Correct import for the main project class.","wrong":"","symbol":"SPHNProject","correct":"from sphn import SPHNProject"}],"quickstart":{"code":"from sphn import SPHNProject\nfrom datetime import datetime\nproject = SPHNProject()\npatient = project.create_patient(patient_id='P001', birth_date=datetime(1990, 4, 23))\nproject.add_patient(patient)\nrdf = project.to_rdf()\nprint(rdf.serialize(format='turtle'))","lang":"python","description":"Create a new SPHN project, add a patient, and serialize as RDF/Turtle."},"warnings":[{"fix":"Use 'sphn==0.2.1' in requirements.txt.","message":"The library is in early development (v0.2.1). API may change drastically between versions. Pin your dependency to a specific version.","severity":"gotcha","affected_versions":"all"},{"fix":"Always install via 'pip install sphn' and verify version >=0.2.0.","message":"The 'sphn' package name on PyPI is very short and could be confused with other projects. Ensure you are installing the correct package.","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 sphn' in your current environment.","cause":"The library is not installed or is installed in a different environment.","error":"ModuleNotFoundError: No module named 'sphn'"},{"fix":"Update the library: 'pip install --upgrade sphn'. Then use 'from sphn import SPHNProject'.","cause":"Attempting to import a non-existent class or outdated version.","error":"AttributeError: module 'sphn' has no attribute 'SPHNProject'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}