{"id":23719,"library":"fastobo","title":"fastobo","description":"Faultless AST for Open Biomedical Ontologies (OBO) in Python. Version 0.14.1 provides robust parsing, manipulation, and serialization of OBO files, with optional OWL export. Released regularly, with pre-built wheels for many platforms.","status":"active","version":"0.14.1","language":"python","source_language":"en","source_url":"https://github.com/fastobo/fastobo-py/","tags":["obo","ontology","biomedical","parser","owl"],"install":[{"cmd":"pip install fastobo","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"No common wrong import; OboDoc is the main document class","wrong":"","symbol":"OboDoc","correct":"from fastobo import OboDoc"},{"note":"Simple import, no common mistakes","wrong":"","symbol":"load","correct":"from fastobo import load"}],"quickstart":{"code":"from fastobo import load\n\n# Load an OBO file (use a test file or URL)\ndoc = load('go.obo')\n\n# Iterate over all frames\nfor frame in doc:\n    # Frames have an 'id' and 'name' attribute\n    print(frame.id, frame.name)\n\n# Convert to OWL (requires fastobo-owl, install separately)\n# from fastobo import dump_owl\n# dump_owl(doc, 'go.owl')","lang":"python","description":"Load and iterate over an OBO ontology file."},"warnings":[{"fix":"frame.name or ''","message":"Some frame attributes (e.g., 'name') may be None if not defined in the OBO file. Always check for None before use.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade Python to >=3.7","message":"Support for Python 3.6 removed in v0.12.0; requires Python >=3.7.","severity":"deprecated","affected_versions":">=0.12.0"},{"fix":"pip install fastobo[owl] or pip install fastobo-owl","message":"The OWL export functionality (dump_owl) is only available if the fastobo-owl dependency is installed (not included by default).","severity":"gotcha","affected_versions":">=0.11.0"},{"fix":"doc = load('/path/to/file.obo') # Do not pass file handle","message":"When loading from a file, the file must be a Path-like object or a string; streams are not supported directly. Use load(open(...)) may fail because load expects a filename or path string, not a file handle.","severity":"gotcha","affected_versions":"all"},{"fix":"No action needed unless relying on concurrency; upgrade to latest","message":"In v0.12.0, the GIL is no longer released when loading from a file on Windows; this may affect performance but fixes compilation.","severity":"breaking","affected_versions":"0.12.0+"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use from fastobo import load","cause":"Trying to use fastobo.load without importing it explicitly, or using an older version where load was not top-level.","error":"AttributeError: module 'fastobo' has no attribute 'load'"},{"fix":"Call load with a file path string: doc = load('file.obo'); do not use open().","cause":"Passing a file handle instead of a file path string.","error":"TypeError: load() argument 1 must be str, not _io.TextIOWrapper"},{"fix":"pip install fastobo","cause":"fastobo is not installed.","error":"ModuleNotFoundError: No module named 'fastobo'"},{"fix":"Use for frame in doc: ...","cause":"OboDoc is iterable but does not have a 'frames' attribute; frames are accessed via iteration.","error":"AttributeError: 'OboDoc' object has no attribute 'frames'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}