{"id":25277096,"url":"https://github.com/refty/thingy","last_synced_at":"2025-10-27T14:31:33.309Z","repository":{"id":41131018,"uuid":"81593124","full_name":"Refty/thingy","owner":"Refty","description":"Dictionaries as objects, that can have different dictionary views!","archived":false,"fork":false,"pushed_at":"2023-04-18T12:58:11.000Z","size":68,"stargazers_count":17,"open_issues_count":2,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-06T11:47:49.184Z","etag":null,"topics":["datastructures","pure-python","python","python-dictionary","python-library","python3"],"latest_commit_sha":null,"homepage":"https://python-thingy.readthedocs.io/","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/Refty.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-10T18:17:55.000Z","updated_at":"2023-12-31T19:08:27.000Z","dependencies_parsed_at":"2023-01-22T09:40:10.777Z","dependency_job_id":null,"html_url":"https://github.com/Refty/thingy","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refty%2Fthingy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refty%2Fthingy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refty%2Fthingy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refty%2Fthingy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Refty","download_url":"https://codeload.github.com/Refty/thingy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238510389,"owners_count":19484486,"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":["datastructures","pure-python","python","python-dictionary","python-library","python3"],"created_at":"2025-02-12T16:41:06.153Z","updated_at":"2025-10-27T14:31:32.953Z","avatar_url":"https://github.com/Refty.png","language":"Python","readme":"======\nThingy\n======\n\n.. image:: https://img.shields.io/pypi/v/thingy.svg\n   :target: https://pypi.python.org/pypi/Thingy\n.. image:: https://img.shields.io/github/license/Refty/thingy.svg\n   :target: https://github.com/Refty/thingy/blob/master/LICENSE\n.. image:: https://img.shields.io/travis/Refty/thingy.svg\n   :target: https://travis-ci.org/Refty/thingy\n.. image:: https://img.shields.io/coveralls/Refty/thingy.svg\n   :target: https://coveralls.io/github/Refty/thingy\n.. image:: https://readthedocs.org/projects/python-thingy/badge\n   :target: https://python-thingy.readthedocs.io\n\n|\n\nDictionaries as objects, that can have different dictionary views!\n\n\nInstall\n=======\n\n.. code-block:: sh\n\n   $ pip install thingy\n\n\nExamples\n========\n\nDictionaries as objects...\n--------------------------\n\n.. code-block:: python\n\n   \u003e\u003e\u003e class MyThingy(Thingy)\n   ...     @property\n   ...     def foobaz(self):\n   ...         return self.foo + self.baz\n\n   \u003e\u003e\u003e thingy = MyThingy({\"foo\": \"bar\", \"baz\": \"qux\"})\n   \u003e\u003e\u003e thingy.foo\n   \"bar\"\n   \u003e\u003e\u003e thingy.foobaz\n   \"barqux\"\n\n   \u003e\u003e\u003e thingy.foo = \"BARRRR\"\n   \u003e\u003e\u003e thingy.view()\n   {\"foo\": \"BARRRR\", \"baz\": \"qux\"}\n\n\n...that can have different dictionary views!\n--------------------------------------------\n\n.. code-block:: python\n\n   \u003e\u003e\u003e MyThingy.add_view(name=\"fooz\", include=[\"foo\", \"foobaz\"])\n   \u003e\u003e\u003e MyThingy.add_view(name=\"no_foo\", defaults=True, exclude=\"foo\")\n\n   \u003e\u003e\u003e thingy = MyThingy({\"foo\": \"bar\", \"baz\": \"qux\"})\n   \u003e\u003e\u003e thingy.view(\"fooz\")\n   {\"foo\": \"bar\", \"foobaz\": \"barqux\"}\n   \u003e\u003e\u003e thingy.view(\"no_foo\")\n   {\"baz\": \"qux\"}\n\n\nWhy Thingy?\n===========\n\nBecause it's much more enjoyable to write ``foo.bar`` than ``foo[\"bar\"]``.\n\nThingy is mainly meant to be used inside other libraries to provide abstractions\nover dictionaries, which can be useful for writing ORMs or similar utilities.\n\nThingy's views system is also particularly useful as-is when you intensively\nmanipulate dictionaries and often restrict those dictionaries to a few redundant\nitems.\n\n\nTests\n=====\n\nTo run Thingy tests:\n\n* install developers requirements with ``pip install -r requirements.txt``;\n* run ``pytest``.\n\n\nSponsors\n========\n\n.. image:: https://raw.githubusercontent.com/Refty/thingy/master/img/numberly.png\n    :alt: Numberly\n    :align: center\n    :target: https://numberly.com/\n\n|\n\n.. image:: https://raw.githubusercontent.com/Refty/thingy/master/img/refty.png\n    :alt: Refty\n    :align: center\n    :target: https://refty.co/\n\n\nLicense\n=======\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefty%2Fthingy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefty%2Fthingy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefty%2Fthingy/lists"}