{"id":34017335,"url":"https://github.com/useblocks/sphinx-modeling","last_synced_at":"2026-03-08T16:37:04.962Z","repository":{"id":60262757,"uuid":"537431393","full_name":"useblocks/sphinx-modeling","owner":"useblocks","description":"Models and constraints for sphinx-needs objects","archived":false,"fork":false,"pushed_at":"2024-09-05T14:58:39.000Z","size":19620,"stargazers_count":6,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-31T00:43:22.685Z","etag":null,"topics":["pydantic","sphinx-doc","sphinx-extension","sphinx-needs"],"latest_commit_sha":null,"homepage":"https://sphinx-modeling.useblocks.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/useblocks.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/support.rst","governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-16T11:37:40.000Z","updated_at":"2024-07-30T21:16:31.000Z","dependencies_parsed_at":"2024-07-24T23:05:13.641Z","dependency_job_id":"912585fb-ff5c-4fa3-8d2d-c7ee214adffb","html_url":"https://github.com/useblocks/sphinx-modeling","commit_stats":{"total_commits":103,"total_committers":3,"mean_commits":"34.333333333333336","dds":0.03883495145631066,"last_synced_commit":"407c6c9fb6c87f1cc561cf0895f55c4cef71a41f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/useblocks/sphinx-modeling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useblocks%2Fsphinx-modeling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useblocks%2Fsphinx-modeling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useblocks%2Fsphinx-modeling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useblocks%2Fsphinx-modeling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/useblocks","download_url":"https://codeload.github.com/useblocks/sphinx-modeling/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useblocks%2Fsphinx-modeling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27707110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pydantic","sphinx-doc","sphinx-extension","sphinx-needs"],"created_at":"2025-12-13T14:31:38.588Z","updated_at":"2025-12-13T14:31:43.367Z","avatar_url":"https://github.com/useblocks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Complete documentation**: https://sphinx-modeling.useblocks.com/\n\nIntroduction\n============\n\n``Sphinx-Modeling`` allows the definition of models and constraints for objects defined with\n`Sphinx-Needs \u003chttps://github.com/useblocks/sphinx-needs\u003e`_. They can be validated during the Sphinx build.\n\n`pydantic \u003chttps://github.com/pydantic/pydantic\u003e`_ is used under the hood to validate all models.\n\nArbitrary constraints can be enforced such as:\n\n- value constraints for need options\n- multiplicity of need link options\n- typed fields (string, regex, int, enums)\n- allow or disallow additional options\n- outgoing links must target specific need types or union of types\n- need type must be nested within another need type (via ``parent_need``)\n- need type must be part of a specific document or chapter/section\n- custom validators\n\n.. warning:: This Sphinx extension is in an early stage and subject to breaking changes.\n\nMotivation\n==========\n\nRequirements management with ``Sphinx-Needs`` and docs-as-code traditionally comes at the cost of complete freedom for developers. ``need_types``, ``needs_extra_options`` and ``needs_extra_links`` are global and all ``need_types`` can\nuse all ``needs_extra_options``/``needs_extra_links`` by default.\n\nThis is a problem for organizations that want to enforce well defined (UML) standards on objects.\nEspecially when migrating parts of the requirements management system to ``Sphinx-Needs`` it is crucial to be\nconsistent with existing solutions. Doing so enables technological interoperability.\n\nMore reasons to use sphinx-modeling are:\n\n* defining model constraints (typed links, multiplicity, allowed attributes, allowed values etc) as part of your model\n  definition (and not as `need_warnings`). This leaves `need_warnings` with the load of doing only data relevant checks\n  later. That is, reduce glue and duplication as much as possible.\n* automatic visualization of typed model (planned feature)\n* self contained need definitions which does not leave types, options, links and warnings scattered (planned feature)\n* user-documentation of meta-model (automatically create readable textual documentation on the types, its allowed\n  values etc. Can be combined with additional docstring documentation as part of model definition if needed)\n* possibility to use the typed model in external tools (VsCode Extension, Linter etc.)\n* possibility to auto-generate\n  `needs_ide_directive_snippets \u003chttps://sphinxcontrib-needs.readthedocs.io/en/latest/configuration.html#needs-ide-directive-snippets\u003e`_ (planned feature)\n\n\nPlanned features\n================\n\n* Generation of the following ``Sphinx-Needs`` configurations from a model configuration:\n\n  * ``needs_types``\n  * ``needs_extra_options``\n  * ``needs_extra_links``\n\n* Visualization of the model (e.g. with PlantUML)\n* Use the model as source for IDE extensions\n\nInstallation\n============\n\nUsing poetry\n------------\n::\n\n    poetry add sphinx-modeling\n\n\nUsing pip\n---------\n::\n\n    pip install sphinx-modeling\n\nUsing sources\n-------------\n::\n\n    git clone https://github.com/useblocks/sphinx-modeling\n    cd sphinx-modeling\n    pip install .\n\nActivation\n----------\n\nAdd **sphinx_modeling** to your extensions::\n\n    extensions = [\"sphinx_needs\", \"sphinx_modeling\", ]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseblocks%2Fsphinx-modeling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuseblocks%2Fsphinx-modeling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseblocks%2Fsphinx-modeling/lists"}