{"library":"somacore","title":"somacore","type":"library","description":"somacore provides the Python-language API specification and base utilities for the SOMA (Scalable Open Multi-omics Array) system. It defines abstract base classes and protocols for core SOMA objects like Experiment, Measurement, DataFrame, and Arrays. As of version 1.0.29, it focuses on defining the SOMA data model for interoperability. The library is actively maintained with frequent updates, often aligning with updates to the broader SOMA specification.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install somacore"],"cli":null},"imports":["from somacore import SOMAObject","from somacore import DataFrame","from somacore import Axis","from somacore import OpenMode","from somacore.query import query"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/single-cell-data/SOMA.git","docs":null,"changelog":null,"pypi":"https://pypi.org/project/somacore/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import somacore\nfrom somacore import AxisType, OpenMode, SOMAObject\n\n# somacore provides abstract base classes (Protocols)\n# for SOMA objects and related concepts.\nprint(f\"somacore version: {somacore.__version__}\")\n\n# You can import and inspect enumeration types\nprint(f\"Available Axis Types: {list(AxisType)}\")\nprint(f\"Read mode for opening objects: {OpenMode.READ}\")\n\n# SOMAObject is a core Protocol (an Abstract Base Class for type hinting)\nprint(f\"SOMAObject is a {type(SOMAObject).__name__}\")\n\n# You cannot instantiate these protocols directly;\n# they are meant for type checking and as interfaces for implementations.\n# For example, this would raise a TypeError:\n# try:\n#     obj = SOMAObject(\"some_uri\")\n# except TypeError as e:\n#     print(f\"\\nCannot instantiate SOMAObject directly: {e}\")\n\nprint(\"\\nsomacore defines the SOMA API. For concrete implementations,\")\nprint(\"refer to libraries like `tiledbsoma` which implement these protocols.\")","lang":"python","description":"This quickstart demonstrates importing core `somacore` types and enumerations. It highlights that `somacore` provides abstract definitions and protocols for the SOMA data model, which are not directly instantiable. Instead, concrete implementations (like `tiledbsoma`) are required to create and manipulate SOMA objects. The example shows how to access the library version and inspect available enumeration values.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}