Sample outputs *************** .. _collection-label: Collection ========== :py:class:`~TheNounProjectAPI.models.CollectionModel` will return an instance with the following json structure: .. code-block:: json { "author": {"location": "", "name": "TukTuk Design", "permalink": "/tuktukdesign", "username": "tuktukdesign"}, "author_id": "319644", "date_created": "2014-06-15 13:59:41", "date_updated": "2014-06-15 14:00:38", "description": "", "icon_count": "18", "id": "220", "is_collaborative": "", "is_featured": "0", "is_published": "1", "is_store_item": "0", "name": "Arrows-1", "permalink": "/tuktukdesign/collection/arrows-1", "slug": "arrows-1", "sponsor": {}, "sponsor_campaign_link": "", "sponsor_id": "", "tags": ["arrow", "arrows", "up", "down", "left", "right", "up arrow", "down arrow", "left arrow", "right arrow", "up arrows", "down arrows", "left arrows", "right arrows"], "template": "24" } How this data may be accessed after a request is described in :py:class:`~TheNounProjectAPI.models.Model`. Beyond this data, instances that were generated not as an element of a list will also have the following attribute: * `response` holding a requests.Response object of the request. See :ref:`Collection output handling ` for a code example of accessing this model's data. .. _collections-label: Collections =========== :py:class:`~TheNounProjectAPI.models.CollectionsModel` will return a list of :py:class:`~TheNounProjectAPI.models.CollectionModel` objects, each with the following json structure: .. code-block:: json { "author": {"location": "Islamabad, Capital, PK", "name": "Flatart", "permalink": "/Flatart", "username": "Flatart"}, "author_id": "4478358", "date_created": "2019-08-02 10:55:16", "date_updated": "2019-08-02 10:55:16", "description": "", "id": "88003", "is_collaborative": "", "is_featured": "0", "is_published": "1", "is_store_item": "0", "name": "Maps & Travel", "permalink": "/Flatart/collection/maps-travel", "slug": "maps-travel", "sponsor": {}, "sponsor_campaign_link": "", "sponsor_id": "", "tags": [], "template": "24" } A method returning :py:class:`~TheNounProjectAPI.models.CollectionsModel` in reality returns a list with some additional attributes: * `collections` holding a list of :py:class:`~TheNounProjectAPI.models.DotDict` objects, each with a collection. * `response` holding a requests.Response object of the request. Furthermore, each element in the list may be accessed like :py:class:`~TheNounProjectAPI.models.Model`. See :ref:`Collections output handling ` for a code example of accessing this model's data. .. _icon-label: Icon ==== :py:class:`~TheNounProjectAPI.models.IconModel` will return an instance with the following json structure: .. code-block:: json { "attribution": "Coat Check by AIGA from Noun Project", "collections": [{"author": {"location": "US", "name": "AIGA", "permalink": "/aiga-icons", "username": "aiga-icons"}, "author_id": "3805019", "date_created": "2012-01-27 19:15:26", "date_updated": "2018-04-17 20:37:44", "description": "", "id": "3", "is_collaborative": "", "is_featured": "1", "is_published": "1", "is_store_item": "0", "name": "Symbol Signs", "permalink": "/aiga-icons/collection/symbol-signs", "slug": "symbol-signs", "sponsor": {}, "sponsor_campaign_link": "", "sponsor_id": "", "tags": [], "template": "24"}], "date_uploaded": "", "icon_url": "", "id": "6", "is_active": "1", "is_explicit": "0", "license_description": "public-domain", "nounji_free": "0", "permalink": "/term/coat-check/6", "preview_url": "https://static.thenounproject.com/png/6-200.png", "preview_url_42": "https://static.thenounproject.com/png/6-42.png", "preview_url_84": "https://static.thenounproject.com/png/6-84.png", "sponsor": {}, "sponsor_campaign_link": null, "sponsor_id": "", "tags": [{"id": 27, "slug": "coat-check"}, {"id": 28, "slug": "clothes-hanger"}], "term": "Coat Check", "term_id": 27, "term_slug": "coat-check", "updated_at": "2019-04-22 19:22:17", "uploader": {"location": "US", "name": "AIGA", "permalink": "/aiga-icons", "username": "aiga-icons"}, "uploader_id": "3805019", "year": 1974 } How this data may be accessed after a request is described in :py:class:`~TheNounProjectAPI.models.Model`. Beyond this data, instances that were generated not as an element of a list will also have the following attribute: * `response` holding a requests.Response object of the request. See :ref:`Icon output handling ` for a code example of accessing this model's data. .. warning:: Some requests return slightly different values. For example, some collection icons have a `attribution_preview_url`, while some do not. .. _icons-label: Icons ===== :py:class:`~TheNounProjectAPI.models.IconsModel` will return a list of :py:class:`~TheNounProjectAPI.models.IconModel` objects, each with the following json structure: .. code-block:: json { "attribution": "Double Tap by P.J. Onori from Noun Project", "date_uploaded": "2012-05-21", "icon_url": "", "id": "2913", "is_active": "1", "is_explicit": "0", "license_description": "public-domain", "nounji_free": "0", "permalink": "/term/double-tap/2913", "preview_url": "https://static.thenounproject.com/png/2913-200.png", "preview_url_42": "https://static.thenounproject.com/png/2913-42.png", "preview_url_84": "https://static.thenounproject.com/png/2913-84.png", "sponsor": {}, "sponsor_campaign_link": null, "sponsor_id": "", "tags": [{"id": 4088, "slug": "double-tap"}, {"id": 2028, "slug": "finger"}, {"id": 2839, "slug": "interface"}, {"id": 443, "slug": "ipad"}, {"id": 440, "slug": "iphone"}, {"id": 908, "slug": "mobile"}, {"id": 1293, "slug": "screen"}, {"id": 1393, "slug": "tablet"}, {"id": 2816, "slug": "touch"}], "term": "Double Tap", "term_id": 4088, "term_slug": "double-tap", "updated_at": "2019-04-22 19:22:17", "uploader": {"location": "San Francisco, US", "name": "P.J. Onori", "permalink": "/somerandomdude", "username": "somerandomdude"}, "uploader_id": "5652", "year": 2009 } A method returning :py:class:`~TheNounProjectAPI.models.IconsModel` in reality returns a list with some additional attributes: * `icons` holding a list of :py:class:`~TheNounProjectAPI.models.DotDict` objects, each with an icon. * `collection` holding a :py:class:`~TheNounProjectAPI.models.DotDict` object, with the collection the icons come from. (Only for :py:meth:`~TheNounProjectAPI.api.API.get_collection_icons`) * `generated_at` holding a string indicating when the request was generated. * `response` holding a requests.Response object of the request. Furthermore, each element in the list may be accessed like :py:class:`~TheNounProjectAPI.models.Model`. See :ref:`Icons output handling ` for a code example of accessing this model's data. .. warning:: Some requests return slightly different values. For example, some collection icons have a `attribution_preview_url`, while some do not. .. note:: If generated with :py:meth:`~TheNounProjectAPI.api.API.get_icons_by_term`, the json structure also contains a `collections` list. .. note:: If generated with :py:meth:`~TheNounProjectAPI.api.API.get_recent_icons`, the json structure lacks the `tags` list. .. _usage-label: Usage ===== :py:class:`~TheNounProjectAPI.models.UsageModel` will return an instance with the following json structure: .. code-block:: json { "limits": { "daily": null, "hourly": null, "monthly": 5000 }, "usage": { "daily": 30, "hourly": 16, "monthly": 32 } } How this data may be accessed after a request is described in :py:class:`~TheNounProjectAPI.models.Model`. Beyond this data, :py:class:`~TheNounProjectAPI.models.UsageModel` instances also have the following attributes: * `generated_at` holding a string indicating when the request was generated. * `response` holding a requests.Response object of the request. See :ref:`Usage output handling ` for a code example of accessing this model's data. .. _enterprise-label: Enterprise ========== :py:class:`~TheNounProjectAPI.models.EnterpriseModel` will return an instance with the following json structure: .. code-block:: json { "licenses_consumed": 3, "result": "success" } How this data may be accessed after a request is described in :py:class:`~TheNounProjectAPI.models.Model`. Beyond this data :py:class:`~TheNounProjectAPI.models.EnterpriseModel` instances also has the following attribute: * `response` holding a requests.Response object of the request.