{"id":16637301,"url":"https://github.com/anatoly-scherbakov/documented","last_synced_at":"2025-03-21T15:31:53.937Z","repository":{"id":57423416,"uuid":"299331663","full_name":"anatoly-scherbakov/documented","owner":"anatoly-scherbakov","description":"Templated docstrings for Python classes","archived":false,"fork":false,"pushed_at":"2024-02-05T19:30:03.000Z","size":1010,"stargazers_count":13,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T04:02:44.488Z","etag":null,"topics":["dataclasses","docstring-documentation","docstrings","error-handling","exception-handling","exceptions","python","python-library"],"latest_commit_sha":null,"homepage":"https://anatoly-scherbakov.github.io/documented/","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/anatoly-scherbakov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.yaml","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-28T14:17:57.000Z","updated_at":"2024-03-14T21:40:58.000Z","dependencies_parsed_at":"2024-10-12T06:25:09.469Z","dependency_job_id":"758945c9-cc45-479d-8425-4eb1d548a307","html_url":"https://github.com/anatoly-scherbakov/documented","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"a549b69b9ddbcd0526ce95e66b0f597347585bf0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anatoly-scherbakov%2Fdocumented","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anatoly-scherbakov%2Fdocumented/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anatoly-scherbakov%2Fdocumented/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anatoly-scherbakov%2Fdocumented/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anatoly-scherbakov","download_url":"https://codeload.github.com/anatoly-scherbakov/documented/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221816427,"owners_count":16885335,"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","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":["dataclasses","docstring-documentation","docstrings","error-handling","exception-handling","exceptions","python","python-library"],"created_at":"2024-10-12T06:25:00.852Z","updated_at":"2024-10-28T10:21:49.049Z","avatar_url":"https://github.com/anatoly-scherbakov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# documented\n\n[![Python Version](https://img.shields.io/pypi/pyversions/documented.svg)](https://pypi.org/project/documented/)\n[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)\n![PyPI - License](https://img.shields.io/pypi/l/documented)\n\nTemplated docstrings for Python classes.\n\n## Features\n\n- Describe your business logic in docstrings of your classes and exceptions;\n- When printing an object or an exception, the library will substitute the placeholders in the docstring text with runtime values,\n- And you (or your user) will see a human-readable text.\n\n## Installation\n\n```bash\npip install documented\n```\n\n\n## Example\n\n```python\nfrom dataclasses import dataclass\nfrom documented import DocumentedError\n\n\n@dataclass\nclass InsufficientWizardryLevel(DocumentedError):\n    \"\"\"\n    🧙 Your level of wizardry is insufficient ☹\n\n        Spell: {self.spell}\n        Minimum level required: {self.required_level}\n        Actual level: {self.actual_level} {self.comment}\n\n    Unseen University will be happy to assist in your training! 🎓\n    \"\"\"\n\n    spell: str\n    required_level: int\n    actual_level: int\n\n    @property\n    def comment(self) -\u003e str:\n        if self.actual_level \u003c= 0:\n            return '(You are Rincewind, right? Hi!)'\n        else:\n            return ''\n\n\nraise InsufficientWizardryLevel(\n    spell='Animal transformation',\n    required_level=8,\n    actual_level=0,\n)\n```\n\nwhich prints:\n\n```\n---------------------------------------------------------------------\nInsufficientWizardryLevel           Traceback (most recent call last)\n\u003cipython-input-1-d8ccdb953cf6\u003e in \u003cmodule\u003e\n     27 \n     28 \n---\u003e 29 raise InsufficientWizardryLevel(\n     30     spell='Animal transformation',\n     31     required_level=8,\n\nInsufficientWizardryLevel: \n🧙 Your level of wizardry is insufficient ☹\n\n    Spell: Animal transformation\n    Minimum level required: 8\n    Actual level: 0 (You are Rincewind, right? Hi!)\n\nUnseen University will be happy to assist in your training! 🎓\n```\n\nFor more examples, see: https://anatoly-scherbakov.github.io/documented/\n\nThis project was generated with [`wemake-python-package`](https://github.com/wemake-services/wemake-python-package).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanatoly-scherbakov%2Fdocumented","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanatoly-scherbakov%2Fdocumented","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanatoly-scherbakov%2Fdocumented/lists"}