{"id":13770276,"url":"https://github.com/caxap/jsonobjects","last_synced_at":"2025-12-30T16:51:08.992Z","repository":{"id":62572895,"uuid":"45785373","full_name":"caxap/jsonobjects","owner":"caxap","description":"jsonobjects allows you to declaratively specify how to extract and convert elements from a JSON document.","archived":false,"fork":false,"pushed_at":"2015-11-13T22:36:03.000Z","size":0,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-26T05:01:28.248Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caxap.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":"2015-11-08T15:09:03.000Z","updated_at":"2023-03-29T08:06:11.000Z","dependencies_parsed_at":"2022-11-03T18:31:51.266Z","dependency_job_id":null,"html_url":"https://github.com/caxap/jsonobjects","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caxap%2Fjsonobjects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caxap%2Fjsonobjects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caxap%2Fjsonobjects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caxap%2Fjsonobjects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caxap","download_url":"https://codeload.github.com/caxap/jsonobjects/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514352,"owners_count":21920327,"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-08-03T17:00:35.849Z","updated_at":"2025-12-30T16:51:08.979Z","avatar_url":"https://github.com/caxap.png","language":"Python","readme":"jsonobjects\n==============\n\n``jsonobjects`` allows you to declaratively specify how to extract and convert elements from a JSON document.\n\n\nInstallation\n------------\nWe recommend the use of `virtualenv \u003chttps://virtualenv.pypa.io/\u003e`_ and of\n`pip \u003chttps://pip.pypa.io/\u003e`_. You can then use ``pip install -U jsonobjects``.\nYou may also have `setuptools \u003chttp://peak.telecommunity.com/DevCenter/setuptools\u003e`_ and thus\nyou can use ``easy_install -U jsonobjects``. Otherwise, you can download the\nsource from `GitHub \u003chttp://github.com/caxap/jsonobjects\u003e`_ and run ``python\nsetup.py install``.\n\n\nDependencies\n------------\nAll dependencies are optional.\n\n- `JMESPath \u003chttps://jmespath.readthedocs.org/en/latest/\u003e`_ to allow advanced queries (see `JMESPath \u003chttps://jmespath.readthedocs.org/en/latest/\u003e`_ documentation for details).\n- `dateutil \u003chttps://dateutil.readthedocs.org/en/latest/\u003e`_ to allow iso-8601 date formats.\n\n\nUsage\n-----\n\nExample of schema to parse iTunes lookup response for software item:\n\n.. code:: python\n\n    import json\n    import requests\n    import jsonobjects as jo\n\n\n    class iTunesAppSchema(jo.Schema):\n        id = jo.IntegerField('trackId')\n        url = jo.Field('trackViewUrl')\n        name = jo.StringField('trackName')\n        currency = jo.StringField()\n        price = jo.FloatField(min_value=0.0)\n        rating = jo.FloatField('averageUserRating')\n        reviews = jo.IntegerField('userRatingCountForCurrentVersion')\n        version = jo.StringField()\n        publisher_id = jo.IntegerField('artistId')\n        publisher_url = jo.Field('artistViewUrl')\n        publisher_name = jo.StringField('artistName')\n        categories = jo.ListField('genres', child=jo.StringField())\n        icon = jo.Field(\n            ['artworkUrl512', 'artworkUrl60'], post_process=lambda v: {'url': v})\n        screenshots = jo.ListField(\n            'screenshotUrls', child=jo.Field(post_process=lambda v: {'url': v}))\n\n\n    parser = iTunesAppSchema('results[0]')\n\n\n    @parser.as_decorator\n    def get_app_details(app_id):\n        url = 'https://itunes.apple.com/lookup?id={}'\n        return requests.get(url.format(app_id)).json()\n\n    # https://itunes.apple.com/lookup?id=880047117\n    details = get_app_details(880047117)\n    print(details)\n\nThe code above produces next result:\n\n.. code:: python\n\n    {\n      \"categories\": [\"Games\", \"Puzzle\", \"Action\"],\n      \"currency\": \"USD\",\n      \"icon\": {\"url\": \"http://is3.mzstatic.com/image/thumb/Purple3/v4/27/f0/d9/27f0d923-e00b-5f2c-a1e9-235ed3f83d14/source/512x512bb.jpg\"},\n      \"id\": 880047117,\n      \"name\": \"Angry Birds 2\",\n      \"price\": 0.0,\n      \"publisher_id\": 298910979,\n      \"publisher_name\": \"Rovio Entertainment Ltd\",\n      \"publisher_url\": \"https://itunes.apple.com/us/developer/rovio-entertainment-ltd/id298910979?uo=4\",\n      \"rating\": 4.0,\n      \"reviews\": 4796,\n      \"screenshots\": [\n        {\"url\": \"http://a4.mzstatic.com/us/r30/Purple3/v4/5c/5e/54/5c5e542c-54a1-7812-12df-045aca3ebb86/screen1136x1136.jpeg\"},\n        {\"url\": \"http://a1.mzstatic.com/us/r30/Purple3/v4/95/50/db/9550dbba-9cbf-d588-fac4-5ebf04614023/screen1136x1136.jpeg\"},\n        {\"url\": \"http://a5.mzstatic.com/us/r30/Purple3/v4/22/ef/e7/22efe7c2-bd05-6f58-f176-92e7230853bd/screen1136x1136.jpeg\"},\n        {\"url\": \"http://a2.mzstatic.com/us/r30/Purple69/v4/72/44/ba/7244ba34-6c8c-5dc5-38e4-e134a97cd0d1/screen1136x1136.jpeg\"},\n        {\"url\": \"http://a5.mzstatic.com/us/r30/Purple6/v4/1b/e4/98/1be49811-f5be-cb3f-1a31-a20b5f5663ee/screen1136x1136.jpeg\"}\n      ],\n      \"url\": \"https://itunes.apple.com/us/app/angry-birds-2/id880047117?mt=8\u0026uo=4\",\n      \"version\": \"2.2.1\"\n    }\n\nSee tests.py for more examples.\n\n\nTests\n-----\nGetting the tests running looks like:\n\n.. code-block:: shell\n\n    # Install dependencies\n    $ pip install -r requirement.txt\n    # Run the test suites\n    $ python tests.py\n\nLicense\n-------\n\nThe MIT License (MIT)\n\nContributed by `Maxim Kamenkov \u003chttps://github.com/caxap/\u003e`_\n","funding_links":[],"categories":["Model, Schema"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaxap%2Fjsonobjects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaxap%2Fjsonobjects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaxap%2Fjsonobjects/lists"}