{"id":16893227,"url":"https://github.com/gruns/orderedmultidict","last_synced_at":"2025-04-05T19:12:29.663Z","repository":{"id":2154439,"uuid":"3099666","full_name":"gruns/orderedmultidict","owner":"gruns","description":"📚 Ordered Multivalue Dictionary. Powers furl.","archived":false,"fork":false,"pushed_at":"2022-03-15T23:08:26.000Z","size":185,"stargazers_count":68,"open_issues_count":5,"forks_count":14,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-29T18:07:07.282Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gruns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-04T04:37:01.000Z","updated_at":"2025-02-26T02:10:13.000Z","dependencies_parsed_at":"2022-09-14T10:35:42.238Z","dependency_job_id":null,"html_url":"https://github.com/gruns/orderedmultidict","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruns%2Forderedmultidict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruns%2Forderedmultidict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruns%2Forderedmultidict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruns%2Forderedmultidict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gruns","download_url":"https://codeload.github.com/gruns/orderedmultidict/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386265,"owners_count":20930619,"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-13T17:14:08.456Z","updated_at":"2025-04-05T19:12:29.624Z","avatar_url":"https://github.com/gruns.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cdiv\u003e\n    \u003cimg src=\"logo.svg\" width=\"300px\" height=\"300px\" alt=\"orderedmultidict\"\u003e\n  \u003c/div\u003e\n  orderedmultidict\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.python.org/pypi/orderedmultidict\"\u003e\u003cimg src=\"https://badge.fury.io/py/orderedmultidict.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/gruns/orderedmultidict\"\u003e\u003cimg src=\"https://api.travis-ci.org/gruns/orderedmultidict.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://unlicense.org/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/l/orderedmultidict.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.python.org/pypi/orderedmultidict\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/orderedmultidict.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n### omdict is an ordered multivalue dictionary that retains\u003cbr\u003emethod parity with Python's [dict](http://docs.python.org/library/stdtypes.html#dict) and helps power [furl](https://github.com/gruns/furl).\n\nA multivalue dictionary is a dictionary that can store multiple values per\\\nkey. An ordered multivalue dictionary is a multivalue dictionary that\\\nretains the order of insertions and deletions.\n\norderedmultidict is well tested, [Unlicensed](http://unlicense.org/) in the public domain,\\\nsupports Python 2, Python 3, PyPy2, and PyPy3.\n\nCode time: omdict can store multiple values per key.\n\n```python\n\u003e\u003e\u003e from orderedmultidict import omdict\n\u003e\u003e\u003e omd = omdict()\n\u003e\u003e\u003e omd[1] = 1\n\u003e\u003e\u003e omd[1]\n1\n\u003e\u003e\u003e omd.add(1, 11)\n\u003e\u003e\u003e omd.getlist(1)\n[1, 11]\n\u003e\u003e\u003e omd.addlist(1, [111, 1111])\n\u003e\u003e\u003e omd.getlist(1)\n[1, 11, 111, 1111]\n\u003e\u003e\u003e omd.allitems()\n[(1, 1), (1, 11), (1, 111), (1, 1111)]\n```\n\nomdict retains insertion and deletion order.\n\n```python\n\u003e\u003e\u003e omd = omdict()\n\u003e\u003e\u003e omd[2] = 2\n\u003e\u003e\u003e omd[1] = 1\n\u003e\u003e\u003e omd.items()\n[(2, 2), (1, 1)]\n\u003e\u003e\u003e omd[2] = 'sup'\n\u003e\u003e\u003e omd.items()\n[(2, 'sup'), (1, 1)]\n```\n\nMethod parity with dict is retained; omdict can be a drop-in replacement.\n\n```python\n\u003e\u003e\u003e d, omd = dict(), omdict()\n\u003e\u003e\u003e d.update([(1,1), (1,11), (2,2), (2,22)])\n\u003e\u003e\u003e omd.update([(1,1), (1,11), (2,2), (2,22)])\n\u003e\u003e\u003e d[1], omd[1]\n(11, 11)\n\u003e\u003e\u003e d[3] = 3\n\u003e\u003e\u003e omd[3] = 3\n\u003e\u003e\u003e d.get(3), omd.get(3)\n(3, 3)\n\u003e\u003e\u003e d.items() == omd.items()\nTrue\n```\n\n\n### API\n\nSee all of omdict's methods, with examples, in omdict's API document,\\\n[API.md](https://github.com/gruns/orderedmultidict/blob/master/API.md).\n\n\n### Installation\n\nInstalling orderedmultidict with pip is easy.\n\n```\n$ pip install orderedmultidict\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruns%2Forderedmultidict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgruns%2Forderedmultidict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruns%2Forderedmultidict/lists"}