{ "info": { "author": "Nejc Korasa", "author_email": "nejc.korasa@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "\n\nInstagram Analyzer\n=================\n\n[![PyPI](https://img.shields.io/pypi/v/instagram-analyzer.svg)](https://pypi.org/project/instagram-analyzer/) ![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)\n [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Analyze%20Instagram%20location%20tags%20to%20se%20what%20cities%2C%20countries%20you%20visited&url=https://github.com/nejckorasa/instagram-analyzer&via=github&hashtags=python,instagram,location,geocoding,github,geotagging,developers)\n\ninstagram-analyzer is an application written in Python that analyzes geotags using reverse geocoding in user's Instagram photos and videos. \n\nIt provides the data of specific locations, countries and cities you've visited so far, as well as how many times and which Instagram posts match the location.\n\nUse responsibly.\n\nWhat it does\n-------\n\n### :round_pushpin: Store all instagram media data :camera:\n\nApplication loads all user's instagram media and saves it in JSON format to `insta_media_data.json`. This data includes all media metadata, including likes, location, tagged users, comments, image url-s ...\n\n### :round_pushpin: Store all instagram location data :bar_chart:\n\nAnalyzes geotags and saves locations in JSON format to `insta_locations_data.json`. This data includes occurrence for each location as well as image and instagram media url-s ...\n\n### :round_pushpin: Store all instagram countries and cities location data :open_file_folder:\n\nCountries and cities are additionally analyzed using reverse geocoding with [LocationIQ API](https://locationiq.com). Data is saved in `insta_countires_data.json` and `insta_cities_data.json` files.\n\n### :round_pushpin: Prints occurrences for location, country and city :airplane:\n\n````\nYou have visited 99 different locations\nYou have visited 7 different countries\nYou have visited 32 different cities\n````\n\n### :round_pushpin: Print table view of most visited location, countries and cities :earth_africa:\n\nFor example, when executed for [nejckorasa](https://www.instagram.com/nejckorasa) print for countries looks like this:\n\n````\nCountries: \n\n+------+-----------------+-------------+\n| rank | country | occurrences |\n+------+-----------------+-------------+\n| 1 | Slovenia | 51 |\n+------+-----------------+-------------+\n| 2 | The Netherlands | 12 |\n+------+-----------------+-------------+\n| 3 | Spain | 8 |\n+------+-----------------+-------------+\n| 4 | Poland | 8 |\n+------+-----------------+-------------+\n| 5 | Russia | 7 |\n+------+-----------------+-------------+\n| 6 | Croatia | 7 |\n+------+-----------------+-------------+\n| 7 | Hungary | 6 |\n+------+-----------------+-------------+\n\n````\n\nSimilar tables are printed for specific locations and cities.\n\n\nInstall\n-------\n\nTo install instagram-analyzer:\n```bash\n$ pip install instagram-analyzer\n```\n\nTo update instagram-analyzer:\n```bash\n$ pip install instagram-analyzer --upgrade\n```\n\nUsage\n-------\n\nOnce installed, import it, configure it and run it:\n\n```Python\nfrom instagram_analyzer import InstaAnalyzer\n\nInstaAnalyzer(\n insta_token='',\n location_iq_token='').run()\n```\n\n\nBefore you run it, see [Configuration & Options](https://github.com/nejckorasa/instagram-analyzer/blob/master/README.md#configuration--options)\n\n\nConfiguration & Options\n-------\n\n### Acquire Tokens\n\n##### Acquire Instagram Access Token\n\nGo to [Pixelunion](http://instagram.pixelunion.net/), generate token, don't forget the token!\n\n##### Acquire Location IQ Access Token\n\nGo to [Location IQ](https://locationiq.com/), sign up, get the token, don't forget the token!\n\n### Configure and run\n\nCreate `InstaAnalyzer` instance with token values.\n\n```Python\nanalyzer = InstaAnalyzer(\n insta_token='',\n location_iq_token='')\nanalyzer.read_media_from_file = False\nanalyzer.run()\n```\n\n> Once instagram media data is stored in JSON, you can read it from there, instead of loading it again via Instagram API (API is limited to 200 request per hour). Set `analyzer.read_media_from_file = True`\n\n\n### Options\n\n- `location_iq_token` is optional. If not set only basic location analysis will be run and saved to file.\n- Once `InstaAnalyzer` has been run all data is available to access:\n\n```Python\n# Configure InstaAnalyzer\nanalyzer = InstaAnalyzer(\n insta_token='',\n location_iq_token='')\n \n# Run InstaAnalyzer \nanalyzer.run()\n\n# Access cities, countries and location data\ncities = analyzer.cities\ncountires = analyzer.countires\nlocations = analyzer.locations\n\n# Access instagram media data\ninstagram_media = analyzer.insta_media_data\n\n# Print locations later\nanalyzer.print_locations()\n```\n \n\n\nStored data examples\n-------\n\nWhen executed for [nejckorasa](https://www.instagram.com/nejckorasa) data for one country item (Spain) looks like this:\n\n```Json\n\"Spain\": {\n \"count\": 8,\n \"media_items\": [\n [\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/e7705068da5e289f5e44c0c396c08f74/5BD54C95/t51.2885-15/sh0.08/e35/p640x640/36149213_609452269436842_8766778259800064000_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/Bkh3-KfgxL9/\"\n }\n ],\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/2b239894a363f6bbe93d604ab2cdfa8a/5BE953CD/t51.2885-15/sh0.08/e35/p640x640/33941046_171665143683479_8766885676932136960_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/Bj7Uj56gxBs/\"\n },\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/9d7003f674af9ca05accf9961df893a6/5BE28FDA/t51.2885-15/sh0.08/e35/p640x640/33120615_197967877520708_8731075699906969600_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/Bjmp-6bAYus/\"\n },\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/1e7ca79fc44823ff3ef8b24e6dd55e61/5BD1E8C3/t51.2885-15/sh0.08/e35/p640x640/33608474_597094857325212_724188974242856960_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/BjR_9lpAqpc/\"\n },\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/1b046c05b1cbe9708f57f5e591b68d1c/5BD8E039/t51.2885-15/sh0.08/e35/p640x640/32947036_172314443452529_4611639929133334528_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/BjNEIwiA6Py/\"\n },\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/5ac0e05fb60700cba4c41d6d1216eb5b/5BC8A9DB/t51.2885-15/e15/10802615_318814311644936_1896556761_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/vdWuHBkwuY/\"\n },\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/40620d8f5e7e01a546e2b958d18bd42a/5BE9E99F/t51.2885-15/e15/10784835_319487204924131_388050040_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/vYybQyEwiA/\"\n },\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/b733c0bdf312ee5c21bb3fd6148e6221/5BE263EA/t51.2885-15/e15/10802986_691193854310946_2042620114_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/vc9ZFakwrq/\"\n },\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/875bff08c310444273eae90a67e525dd/5BC8F29F/t51.2885-15/e15/928044_671144066338855_1666493611_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/vaWbQLEwqX/\"\n }\n ]\n }\n```\nOf course, `` will be an actual post ID.\n\nData for cities is almost the same. For specific location one location item looks like this:\n\n````Json\n\"236678869\": {\n \"latitude\": 45.7925,\n \"longitude\": 15.1647,\n \"name\": \"Novo Mesto\",\n \"id\": 236678869,\n \"count\": 4,\n \"media_items\": [\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/6941d16b164ec488dd3a303004344f78/5BE40DE8/t51.2885-15/sh0.08/e35/p640x640/31270267_1592482480868234_8257495365851283456_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/Bij24yzAdHB/\"\n },\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/3189c0f2e5931f47b4506046ff26afff/5BDB6109/t51.2885-15/e15/10724200_1496985983889525_746072573_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/uDDPHekwtW/\"\n },\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/fbf31b5c410c9036ce43862012249d02/5BEC3F36/t51.2885-15/e15/10488704_250740985124191_1862853011_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/q94LWMkwlk/\"\n },\n {\n \"id\": \"\",\n \"image\": \"https://scontent.cdninstagram.com/vp/27c6681709c7b71fc86d8477c11d2b88/5BCAD041/t51.2885-15/e15/10013254_641464529259998_1091484863_n.jpg?efg=eyJ1cmxnZW4iOiJ1cmxnZW5fZnJvbV9pZyJ9\",\n \"link\": \"https://www.instagram.com/p/mKDvsikwsC/\"\n }\n ],\n \"city\": \"Novo mesto\",\n \"additional_data\": {\n \"place_id\": \"113385772\",\n \"licence\": \"\\u00a9 LocationIQ.org CC BY 4.0, Data \\u00a9 OpenStreetMap contributors, ODbL 1.0\",\n \"osm_type\": \"way\",\n \"osm_id\": \"167321715\",\n \"lat\": \"45.7897769\",\n \"lon\": \"15.1680662\",\n \"display_name\": \"Krka, Novo mesto, Jugovzhodna Slovenija, 8000, Slovenia\",\n \"address\": {\n \"suburb\": \"Krka\",\n \"town\": \"Novo mesto\",\n \"state_district\": \"Jugovzhodna Slovenija\",\n \"postcode\": \"8000\",\n \"country\": \"Slovenia\",\n \"country_code\": \"si\"\n },\n \"boundingbox\": [\n \"45.7858017\",\n \"45.7927137\",\n \"15.1640388\",\n \"15.1725268\"\n ]\n }\n }\n````\n\nNotice `additional_data` field, this data is populated using [Location IQ API](https://locationiq.com)\n\n\nFAQ\n-------\n\n#### Why does it take so long to load additional location data?\n\nFor reverse geocoding, Location IQ API is used. Free version of that API si rate limited to 1 request per second. That is why additional data loading takes `` seconds.\n\n\nContributing\n-------\n\nPull requests are welcome, [Show your \u2764 with a \u2605](https://github.com/nejckorasa/instagram-analyzer/stargazers)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/nejckorasa/instagram-analyzer/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nejckorasa/instagram-analyzer", "keywords": "instagram,location,download,media,photos,videos,geocoding", "license": "Public domain", "maintainer": "", "maintainer_email": "", "name": "instagram-analyzer", "package_url": "https://pypi.org/project/instagram-analyzer/", "platform": "", "project_url": "https://pypi.org/project/instagram-analyzer/", "project_urls": { "Download": "https://github.com/nejckorasa/instagram-analyzer/archive/master.zip", "Homepage": "https://github.com/nejckorasa/instagram-analyzer" }, "release_url": "https://pypi.org/project/instagram-analyzer/1.0.5/", "requires_dist": null, "requires_python": "", "summary": "Analyzes user's Instagram location geotags to find most frequent locations, countries, cities", "version": "1.0.5" }, "last_serial": 4090071, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c53bbb7934ef7d76f1993de5afad7c8a", "sha256": "e3f3cb52531941e8da97f3c211a9f03ca5f645d2698e10aa27cd002f0de8b7f3" }, "downloads": -1, "filename": "instagram-analyzer-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c53bbb7934ef7d76f1993de5afad7c8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7942, "upload_time": "2018-07-17T10:52:18", "url": "https://files.pythonhosted.org/packages/47/73/ce36ba270ad38cda91f62b5d83c69a7a65504cc600a6b96f8d43b6cc8cc6/instagram-analyzer-0.1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "64374a496d462da5b21d846c2ede75cf", "sha256": "f14b5d0c9775089624aa6bc42583cc588d927d436af936827845cdad1aacee3f" }, "downloads": -1, "filename": "instagram-analyzer-1.0.1.tar.gz", "has_sig": false, "md5_digest": "64374a496d462da5b21d846c2ede75cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7980, "upload_time": "2018-07-17T11:09:05", "url": "https://files.pythonhosted.org/packages/f4/96/fa87205c9d5d28dc4376155d54e6b39347fa2316af0091382d6b19da7645/instagram-analyzer-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "f68643045e38427bbc6630ed5305ba1a", "sha256": "330817722cd098f07b54505ae6d5148cca5df16fb3148cbd2a933a5ec8e5df32" }, "downloads": -1, "filename": "instagram-analyzer-1.0.2.tar.gz", "has_sig": false, "md5_digest": "f68643045e38427bbc6630ed5305ba1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8346, "upload_time": "2018-07-22T10:35:44", "url": "https://files.pythonhosted.org/packages/59/bc/22b9b08161781e45554f616129155ff7fdc85d26f75ae47707ffa6dd79ae/instagram-analyzer-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "d2acceba7151060b3d6ea0989f4809f3", "sha256": "b4703aec23fb082ace113d21f283d0f54be463f84a845c37ad29d4a0d9fec6ff" }, "downloads": -1, "filename": "instagram-analyzer-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d2acceba7151060b3d6ea0989f4809f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9368, "upload_time": "2018-07-22T10:39:08", "url": "https://files.pythonhosted.org/packages/fe/7d/60c3c58662b9be52b77b8929414e8d18437edc1aeea2fee001dabcaeb661/instagram-analyzer-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "e7142c0cf028e6344ebb859ca1490468", "sha256": "e9da378702838548873354f78345e8af36eb4381ea7f8409aac70ea6c97b8106" }, "downloads": -1, "filename": "instagram-analyzer-1.0.4.tar.gz", "has_sig": false, "md5_digest": "e7142c0cf028e6344ebb859ca1490468", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9364, "upload_time": "2018-07-22T10:45:48", "url": "https://files.pythonhosted.org/packages/ae/bc/af45064ccbe3c55d2f4b1cc735d141002b80b32c3abd0d34b358664c9ee8/instagram-analyzer-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "6d6e5e93ce151b0f3c4aa627a744f695", "sha256": "1a0704629adff945064b87e97713e9ae0918c4976edce87bf0623f53799f1927" }, "downloads": -1, "filename": "instagram-analyzer-1.0.5.tar.gz", "has_sig": false, "md5_digest": "6d6e5e93ce151b0f3c4aa627a744f695", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9440, "upload_time": "2018-07-22T10:51:14", "url": "https://files.pythonhosted.org/packages/e4/2b/2e64144fd24fcd9a956a7398338724339e1b29b2e88c33d0526cf6b2b41f/instagram-analyzer-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6d6e5e93ce151b0f3c4aa627a744f695", "sha256": "1a0704629adff945064b87e97713e9ae0918c4976edce87bf0623f53799f1927" }, "downloads": -1, "filename": "instagram-analyzer-1.0.5.tar.gz", "has_sig": false, "md5_digest": "6d6e5e93ce151b0f3c4aa627a744f695", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9440, "upload_time": "2018-07-22T10:51:14", "url": "https://files.pythonhosted.org/packages/e4/2b/2e64144fd24fcd9a956a7398338724339e1b29b2e88c33d0526cf6b2b41f/instagram-analyzer-1.0.5.tar.gz" } ] }