{"id":17115209,"url":"https://github.com/not-raspberry/returns","last_synced_at":"2025-03-23T23:44:23.902Z","repository":{"id":95187764,"uuid":"42205115","full_name":"not-raspberry/returns","owner":"not-raspberry","description":"A decorator to create namedtuples for return values","archived":false,"fork":false,"pushed_at":"2015-09-11T17:46:41.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T06:51:57.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/not-raspberry.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-09T21:12:20.000Z","updated_at":"2015-09-09T21:12:42.000Z","dependencies_parsed_at":"2023-03-03T22:00:30.036Z","dependency_job_id":null,"html_url":"https://github.com/not-raspberry/returns","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-raspberry%2Freturns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-raspberry%2Freturns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-raspberry%2Freturns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/not-raspberry%2Freturns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/not-raspberry","download_url":"https://codeload.github.com/not-raspberry/returns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186923,"owners_count":20574554,"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":[],"created_at":"2024-10-14T17:22:12.266Z","updated_at":"2025-03-23T23:44:23.880Z","avatar_url":"https://github.com/not-raspberry.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"returns\n=======\n.. image:: https://travis-ci.org/not-raspberry/returns.svg?branch=master\n    :target: https://travis-ci.org/not-raspberry/returns\n.. image:: https://coveralls.io/repos/not-raspberry/returns/badge.svg?branch=master\u0026service=github\n    :target: https://coveralls.io/github/not-raspberry/returns?branch=master\n\n\nWhat is it?\n-----------\nThe easiest way to return a value of a known type, with named fields accessible via attributes.\n\nFor whom?\n---------\nFor people too lazy to create namedtuples by themselves.\n\n\nExamples\n--------\n.. code:: python\n\n    import returns\n\n    # Name generated from function name:\n    @returns.namedtuple('monkeys', 'snakes')\n    def get_monkeys_and_snakes():\n        return 'A lot!', 'Even more!'\n\n    get_monkeys_and_snakes() # -\u003e GetMonkeysAndSnakes(monkeys='A lot!', snakes='Even more!')\n\n\n    # With a custom name:\n    @returns.namedtuple('hyenas', 'lions', name='HyaenaeEtLeones')\n    def get_hyenas_and_lions():\n        return 'A herd.', 42\n\n    get_hyenas_and_lions() # -\u003e HyaenaeEtLeones(hyenas='A herd.', lions=42)\n\n\nTrivia\n------\nAs every library that does almost nothing, this one is also weirdly named. ``returns`` is not even a\nnoun. It looks like a keyword. Add insult to injury, the name ``returns.namedtuple`` may be mistaken\nwith the ``namedtuple`` from ``collections``.\n\nBut c'mon! It reads like a sentence! ``@returns.namedtuple`` - it's like 'returns namedtuple',\nright? That's what cool-kid programming is all about!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnot-raspberry%2Freturns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnot-raspberry%2Freturns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnot-raspberry%2Freturns/lists"}