{"action":"created","comment":{"url":"https://api.github.com/repos/mrooney/mintapi/pulls/comments/45881071","id":45881071,"diff_hunk":"@@ -237,13 +242,73 @@ def get_transactions_json(self, include_investment=False,\n                 expected_content_type='text/json')\n             data = json.loads(result.text)\n             txns = data['set'][0].get('data', [])\n+            df = pd.DataFrame(txns)\n+            if start_date:\n+                dates = list(df['odate'])\n+                cy = datetime.isocalendar(date.today())[0]\n+                try:\n+                    first_dt = datetime.strptime(dates[0] + str(cy), '%b %d%Y')\n+                except:\n+                    first_dt = datetime.strptime(dates[0], '%m/%d/%y')\n+                if first_dt < start_date:\n+                    break\n             if not txns:\n                 break\n             all_txns.extend(txns)\n             offset += len(txns)\n-\n         return all_txns\n \n+    def _dateconvert(self, dateraw):\n+        # Converts dates from json data\n+        cy = datetime.isocalendar(date.today())[0]\n+        try:\n+            newdate = datetime.strptime(dateraw + str(cy), '%b %d%Y')\n+        except:\n+            newdate = datetime.strptime(dateraw, '%m/%d/%y')\n+        return newdate\n+\n+    def _debit_credit(self, row):\n+        # Reverses credit balances\n+        dic = {False: -1, True: 1}\n+        return float(row['amount'][1:].replace(',', '')) * dic[row['isDebit']]\n+\n+    def get_detailed_transactions(self, start_date=None,\n+                                  include_investment=False,\n+                                  skip_duplicates=False,\n+                                  remove_pending=True):\n+        \"\"\"Returns the JSON transaction data as a DataFrame, and converts\n+        current year dates and prior year dates into consistent datetime\n+        format, and reverses credit activity.\n+\n+        Note: start_date must be in format mm/dd/yy. If pulls take too long,\n+        use a more recent start date. See json explanations of\n+        include_investment and skip_duplicates.\n+\n+        Also note: Mint includes pending transactions, however these sometimes\n+        change dates/amounts after the transactions post. They have been\n+        removed by default in this pull, but can be included by changing\n+        include_pending to False","path":"mintapi/api.py","position":84,"original_position":84,"commit_id":"dfcad406b1f20d680f6449adfe7d54ad3072e7e8","original_commit_id":"dfcad406b1f20d680f6449adfe7d54ad3072e7e8","user":{"login":"mrooney","id":123717,"avatar_url":"https://avatars.githubusercontent.com/u/123717?v=3","gravatar_id":"","url":"https://api.github.com/users/mrooney","html_url":"https://github.com/mrooney","followers_url":"https://api.github.com/users/mrooney/followers","following_url":"https://api.github.com/users/mrooney/following{/other_user}","gists_url":"https://api.github.com/users/mrooney/gists{/gist_id}","starred_url":"https://api.github.com/users/mrooney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrooney/subscriptions","organizations_url":"https://api.github.com/users/mrooney/orgs","repos_url":"https://api.github.com/users/mrooney/repos","events_url":"https://api.github.com/users/mrooney/events{/privacy}","received_events_url":"https://api.github.com/users/mrooney/received_events","type":"User","site_admin":false},"body":"Should this be \"remove_pending\" instead of include_pending?","created_at":"2015-11-25T15:40:16Z","updated_at":"2015-11-25T15:40:16Z","html_url":"https://github.com/mrooney/mintapi/pull/50#discussion_r45881071","pull_request_url":"https://api.github.com/repos/mrooney/mintapi/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/mrooney/mintapi/pulls/comments/45881071"},"html":{"href":"https://github.com/mrooney/mintapi/pull/50#discussion_r45881071"},"pull_request":{"href":"https://api.github.com/repos/mrooney/mintapi/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/mrooney/mintapi/pulls/50","id":51435919,"html_url":"https://github.com/mrooney/mintapi/pull/50","diff_url":"https://github.com/mrooney/mintapi/pull/50.diff","patch_url":"https://github.com/mrooney/mintapi/pull/50.patch","issue_url":"https://api.github.com/repos/mrooney/mintapi/issues/50","number":50,"state":"open","locked":false,"title":"Beef up json pull and create new detailed pull","user":{"login":"dtiz","id":15842536,"avatar_url":"https://avatars.githubusercontent.com/u/15842536?v=3","gravatar_id":"","url":"https://api.github.com/users/dtiz","html_url":"https://github.com/dtiz","followers_url":"https://api.github.com/users/dtiz/followers","following_url":"https://api.github.com/users/dtiz/following{/other_user}","gists_url":"https://api.github.com/users/dtiz/gists{/gist_id}","starred_url":"https://api.github.com/users/dtiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtiz/subscriptions","organizations_url":"https://api.github.com/users/dtiz/orgs","repos_url":"https://api.github.com/users/dtiz/repos","events_url":"https://api.github.com/users/dtiz/events{/privacy}","received_events_url":"https://api.github.com/users/dtiz/received_events","type":"User","site_admin":false},"body":"This update allows the json pull to be limited to a start date (in format mm/dd/yy). This speeds up the pull time dramatically if you have lots of transactions.\r\n\r\nAlso created a new beefier pull that starts with the json pull, then converts the dates, reverses the credits, and drops pending transactions (because pending transactions sometimes change when they actually post). Added two helper functions for the new one, so maybe those can be pulled in as lambdas.","created_at":"2015-11-21T07:19:06Z","updated_at":"2015-11-25T15:40:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b37d498537f6ed627fac6f6c29df902887fdf0c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mrooney/mintapi/pulls/50/commits","review_comments_url":"https://api.github.com/repos/mrooney/mintapi/pulls/50/comments","review_comment_url":"https://api.github.com/repos/mrooney/mintapi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mrooney/mintapi/issues/50/comments","statuses_url":"https://api.github.com/repos/mrooney/mintapi/statuses/dfcad406b1f20d680f6449adfe7d54ad3072e7e8","head":{"label":"dtiz:master","ref":"master","sha":"dfcad406b1f20d680f6449adfe7d54ad3072e7e8","user":{"login":"dtiz","id":15842536,"avatar_url":"https://avatars.githubusercontent.com/u/15842536?v=3","gravatar_id":"","url":"https://api.github.com/users/dtiz","html_url":"https://github.com/dtiz","followers_url":"https://api.github.com/users/dtiz/followers","following_url":"https://api.github.com/users/dtiz/following{/other_user}","gists_url":"https://api.github.com/users/dtiz/gists{/gist_id}","starred_url":"https://api.github.com/users/dtiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtiz/subscriptions","organizations_url":"https://api.github.com/users/dtiz/orgs","repos_url":"https://api.github.com/users/dtiz/repos","events_url":"https://api.github.com/users/dtiz/events{/privacy}","received_events_url":"https://api.github.com/users/dtiz/received_events","type":"User","site_admin":false},"repo":{"id":46603695,"name":"mintapi","full_name":"dtiz/mintapi","owner":{"login":"dtiz","id":15842536,"avatar_url":"https://avatars.githubusercontent.com/u/15842536?v=3","gravatar_id":"","url":"https://api.github.com/users/dtiz","html_url":"https://github.com/dtiz","followers_url":"https://api.github.com/users/dtiz/followers","following_url":"https://api.github.com/users/dtiz/following{/other_user}","gists_url":"https://api.github.com/users/dtiz/gists{/gist_id}","starred_url":"https://api.github.com/users/dtiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtiz/subscriptions","organizations_url":"https://api.github.com/users/dtiz/orgs","repos_url":"https://api.github.com/users/dtiz/repos","events_url":"https://api.github.com/users/dtiz/events{/privacy}","received_events_url":"https://api.github.com/users/dtiz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dtiz/mintapi","description":"a screen-scraping API for Mint.com","fork":true,"url":"https://api.github.com/repos/dtiz/mintapi","forks_url":"https://api.github.com/repos/dtiz/mintapi/forks","keys_url":"https://api.github.com/repos/dtiz/mintapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dtiz/mintapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dtiz/mintapi/teams","hooks_url":"https://api.github.com/repos/dtiz/mintapi/hooks","issue_events_url":"https://api.github.com/repos/dtiz/mintapi/issues/events{/number}","events_url":"https://api.github.com/repos/dtiz/mintapi/events","assignees_url":"https://api.github.com/repos/dtiz/mintapi/assignees{/user}","branches_url":"https://api.github.com/repos/dtiz/mintapi/branches{/branch}","tags_url":"https://api.github.com/repos/dtiz/mintapi/tags","blobs_url":"https://api.github.com/repos/dtiz/mintapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dtiz/mintapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dtiz/mintapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/dtiz/mintapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dtiz/mintapi/statuses/{sha}","languages_url":"https://api.github.com/repos/dtiz/mintapi/languages","stargazers_url":"https://api.github.com/repos/dtiz/mintapi/stargazers","contributors_url":"https://api.github.com/repos/dtiz/mintapi/contributors","subscribers_url":"https://api.github.com/repos/dtiz/mintapi/subscribers","subscription_url":"https://api.github.com/repos/dtiz/mintapi/subscription","commits_url":"https://api.github.com/repos/dtiz/mintapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/dtiz/mintapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/dtiz/mintapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/dtiz/mintapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/dtiz/mintapi/contents/{+path}","compare_url":"https://api.github.com/repos/dtiz/mintapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dtiz/mintapi/merges","archive_url":"https://api.github.com/repos/dtiz/mintapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dtiz/mintapi/downloads","issues_url":"https://api.github.com/repos/dtiz/mintapi/issues{/number}","pulls_url":"https://api.github.com/repos/dtiz/mintapi/pulls{/number}","milestones_url":"https://api.github.com/repos/dtiz/mintapi/milestones{/number}","notifications_url":"https://api.github.com/repos/dtiz/mintapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dtiz/mintapi/labels{/name}","releases_url":"https://api.github.com/repos/dtiz/mintapi/releases{/id}","created_at":"2015-11-21T06:14:01Z","updated_at":"2015-11-21T06:14:01Z","pushed_at":"2015-11-21T08:32:18Z","git_url":"git://github.com/dtiz/mintapi.git","ssh_url":"git@github.com:dtiz/mintapi.git","clone_url":"https://github.com/dtiz/mintapi.git","svn_url":"https://github.com/dtiz/mintapi","homepage":null,"size":117,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mrooney:master","ref":"master","sha":"b11e2c9975acd896f5c2761c24489de0d770633b","user":{"login":"mrooney","id":123717,"avatar_url":"https://avatars.githubusercontent.com/u/123717?v=3","gravatar_id":"","url":"https://api.github.com/users/mrooney","html_url":"https://github.com/mrooney","followers_url":"https://api.github.com/users/mrooney/followers","following_url":"https://api.github.com/users/mrooney/following{/other_user}","gists_url":"https://api.github.com/users/mrooney/gists{/gist_id}","starred_url":"https://api.github.com/users/mrooney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrooney/subscriptions","organizations_url":"https://api.github.com/users/mrooney/orgs","repos_url":"https://api.github.com/users/mrooney/repos","events_url":"https://api.github.com/users/mrooney/events{/privacy}","received_events_url":"https://api.github.com/users/mrooney/received_events","type":"User","site_admin":false},"repo":{"id":8212948,"name":"mintapi","full_name":"mrooney/mintapi","owner":{"login":"mrooney","id":123717,"avatar_url":"https://avatars.githubusercontent.com/u/123717?v=3","gravatar_id":"","url":"https://api.github.com/users/mrooney","html_url":"https://github.com/mrooney","followers_url":"https://api.github.com/users/mrooney/followers","following_url":"https://api.github.com/users/mrooney/following{/other_user}","gists_url":"https://api.github.com/users/mrooney/gists{/gist_id}","starred_url":"https://api.github.com/users/mrooney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrooney/subscriptions","organizations_url":"https://api.github.com/users/mrooney/orgs","repos_url":"https://api.github.com/users/mrooney/repos","events_url":"https://api.github.com/users/mrooney/events{/privacy}","received_events_url":"https://api.github.com/users/mrooney/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrooney/mintapi","description":"a screen-scraping API for Mint.com","fork":false,"url":"https://api.github.com/repos/mrooney/mintapi","forks_url":"https://api.github.com/repos/mrooney/mintapi/forks","keys_url":"https://api.github.com/repos/mrooney/mintapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrooney/mintapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrooney/mintapi/teams","hooks_url":"https://api.github.com/repos/mrooney/mintapi/hooks","issue_events_url":"https://api.github.com/repos/mrooney/mintapi/issues/events{/number}","events_url":"https://api.github.com/repos/mrooney/mintapi/events","assignees_url":"https://api.github.com/repos/mrooney/mintapi/assignees{/user}","branches_url":"https://api.github.com/repos/mrooney/mintapi/branches{/branch}","tags_url":"https://api.github.com/repos/mrooney/mintapi/tags","blobs_url":"https://api.github.com/repos/mrooney/mintapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrooney/mintapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrooney/mintapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrooney/mintapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrooney/mintapi/statuses/{sha}","languages_url":"https://api.github.com/repos/mrooney/mintapi/languages","stargazers_url":"https://api.github.com/repos/mrooney/mintapi/stargazers","contributors_url":"https://api.github.com/repos/mrooney/mintapi/contributors","subscribers_url":"https://api.github.com/repos/mrooney/mintapi/subscribers","subscription_url":"https://api.github.com/repos/mrooney/mintapi/subscription","commits_url":"https://api.github.com/repos/mrooney/mintapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrooney/mintapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrooney/mintapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrooney/mintapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrooney/mintapi/contents/{+path}","compare_url":"https://api.github.com/repos/mrooney/mintapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrooney/mintapi/merges","archive_url":"https://api.github.com/repos/mrooney/mintapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrooney/mintapi/downloads","issues_url":"https://api.github.com/repos/mrooney/mintapi/issues{/number}","pulls_url":"https://api.github.com/repos/mrooney/mintapi/pulls{/number}","milestones_url":"https://api.github.com/repos/mrooney/mintapi/milestones{/number}","notifications_url":"https://api.github.com/repos/mrooney/mintapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrooney/mintapi/labels{/name}","releases_url":"https://api.github.com/repos/mrooney/mintapi/releases{/id}","created_at":"2013-02-15T04:51:50Z","updated_at":"2015-11-24T22:37:56Z","pushed_at":"2015-11-21T08:32:18Z","git_url":"git://github.com/mrooney/mintapi.git","ssh_url":"git@github.com:mrooney/mintapi.git","clone_url":"https://github.com/mrooney/mintapi.git","svn_url":"https://github.com/mrooney/mintapi","homepage":null,"size":136,"stargazers_count":215,"watchers_count":215,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":5,"forks":61,"open_issues":5,"watchers":215,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mrooney/mintapi/pulls/50"},"html":{"href":"https://github.com/mrooney/mintapi/pull/50"},"issue":{"href":"https://api.github.com/repos/mrooney/mintapi/issues/50"},"comments":{"href":"https://api.github.com/repos/mrooney/mintapi/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/mrooney/mintapi/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/mrooney/mintapi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mrooney/mintapi/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/mrooney/mintapi/statuses/dfcad406b1f20d680f6449adfe7d54ad3072e7e8"}}}}