{"id":13510668,"url":"https://github.com/mahmoud/glom","last_synced_at":"2025-05-16T15:02:10.209Z","repository":{"id":37445304,"uuid":"130011760","full_name":"mahmoud/glom","owner":"mahmoud","description":"☄️ Python's nested data operator (and CLI), for all your declarative restructuring needs. Got data? Glom it! ☄️","archived":false,"fork":false,"pushed_at":"2025-01-12T07:12:16.000Z","size":1327,"stargazers_count":2000,"open_issues_count":114,"forks_count":68,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-09T14:35:37.655Z","etag":null,"topics":["apis","cli","data","data-transformation","declarative","dictionaries","nested-structures","python","recursion","utilities"],"latest_commit_sha":null,"homepage":"https://glom.readthedocs.io","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/mahmoud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-18T06:03:24.000Z","updated_at":"2025-05-09T02:16:19.000Z","dependencies_parsed_at":"2023-02-10T21:30:40.697Z","dependency_job_id":"e5c8b4aa-191b-4df6-b123-8d526e7c0e61","html_url":"https://github.com/mahmoud/glom","commit_stats":{"total_commits":926,"total_committers":26,"mean_commits":35.61538461538461,"dds":0.3790496760259179,"last_synced_commit":"3cd57b6a6e04d522ddbab6869a040c408bff8b7a"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoud%2Fglom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoud%2Fglom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoud%2Fglom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahmoud%2Fglom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mahmoud","download_url":"https://codeload.github.com/mahmoud/glom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253311723,"owners_count":21888497,"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":["apis","cli","data","data-transformation","declarative","dictionaries","nested-structures","python","recursion","utilities"],"created_at":"2024-08-01T02:01:49.108Z","updated_at":"2025-05-16T15:02:10.168Z","avatar_url":"https://github.com/mahmoud.png","language":"Python","readme":"# glom\n\n*Restructuring data, the Python way*\n\n\u003ca href=\"https://pypi.org/project/glom/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/glom.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://calver.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/calver-YY.MM.MICRO-22bfda.svg\"\u003e\u003c/a\u003e\n\n\u003cimg width=\"30%\" align=\"right\" src=\"https://raw.githubusercontent.com/mahmoud/glom/master/docs/_static/comet.png\"\u003e\n\nReal applications have real data, and real data nests. Objects inside\nof objects inside of lists of objects.\n\nglom is a new and powerful way to handle real-world data, featuring:\n\n* Path-based access for nested data structures\n* Readable, meaningful error messages\n* Declarative data transformation, using lightweight, Pythonic specifications\n* Built-in data exploration and debugging features\n\nAll of that and more, available as a [fully-documented][rtd],\npure-Python package, tested on Python 3.7+, as well as\nPyPy3. Installation is as easy as:\n\n```\n  pip install glom\n```\n\nAnd when you install glom, you also get [the `glom` command-line\ninterface][cli_rtd], letting you experiment at the console, but never limiting\nyou to shell scripts:\n\n```\nUsage: glom [FLAGS] [spec [target]]\n\nCommand-line interface to the glom library, providing nested data access and data\nrestructuring with the power of Python.\n\nFlags:\n\n  --help / -h                     show this help message and exit\n  --target-file TARGET_FILE       path to target data source (optional)\n  --target-format TARGET_FORMAT\n                                  format of the source data (json, python, toml,\n                                  or yaml) (defaults to 'json')\n  --spec-file SPEC_FILE           path to glom spec definition (optional)\n  --spec-format SPEC_FORMAT       format of the glom spec definition (json, python,\n                                    python-full) (defaults to 'python')\n  --indent INDENT                 number of spaces to indent the result, 0 to disable\n                                    pretty-printing (defaults to 2)\n  --debug                         interactively debug any errors that come up\n  --inspect                       interactively explore the data\n\n```\n\nAnything you can do at the command line readily translates to Python\ncode, so you've always got a path forward when complexity starts to\nramp up.\n\n\n## Examples\n#### Without glom\n```python\n\u003e\u003e\u003e data = {'a': {'b': {'c': 'd'}}}\n\u003e\u003e\u003e data['a']['b']['c']\n'd'\n\u003e\u003e\u003e data2 = {'a': {'b': None}}\n\u003e\u003e\u003e data2['a']['b']['c']\nTraceback (most recent call last):\n...\nTypeError: 'NoneType' object is not subscriptable\n```\n\n#### With glom\n```python\n\u003e\u003e\u003e glom(data, 'a.b.c')\n'd'\n\u003e\u003e\u003e glom(data2, 'a.b.c')\nTraceback (most recent call last):\n...\nPathAccessError: could not access 'c', index 2 in path Path('a', 'b', 'c'), got error: ...\n```\n\n## Learn more\n\n\u003cimg width=\"30%\" align=\"right\" src=\"https://raw.githubusercontent.com/mahmoud/glom/master/docs/_static/comet_multi.png\"\u003e\n\nIf all this seems interesting, continue exploring glom below:\n\n* [glom Tutorial][tutorial]\n* [Full API documentation at Read the Docs][rtd]\n* [Original announcement blog post (2018-05-09)][glom_announce]\n* [Frequently Asked Questions][faq]\n* [PyCon 2018 Lightning Talk (2018-05-11)][pycon_talk]\n\nAll of the links above are overflowing with examples, but should you\nfind anything about the docs, or glom itself, lacking, [please submit\nan issue][gh_issues]!\n\n[rtd]: https://glom.readthedocs.io\n[cli_rtd]: http://glom.readthedocs.io/en/latest/cli.html\n[tutorial]: https://glom.readthedocs.io/en/latest/tutorial.html\n[faq]: https://glom.readthedocs.io/en/latest/faq.html\n[glom_announce]: https://sedimental.org/glom_restructured_data.html\n[gh_issues]: https://github.com/mahmoud/glom/issues/\n[pycon_talk]: https://www.youtube.com/watch?v=bTAFl8P2DkE\u0026t=18m07s\n\nIn the meantime, just remember: When you've got nested data, glom it! ☄️\n","funding_links":[],"categories":["Python","Data Processing","cli","Data Structures","📦 Additional Python Libraries","Awesome Functional Python"],"sub_categories":["Data Management","Miscellaneous","Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmoud%2Fglom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahmoud%2Fglom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmoud%2Fglom/lists"}