{"action":"created","comment":{"url":"https://api.github.com/repos/pydata/pandas-datareader/pulls/comments/49285678","id":49285678,"diff_hunk":"@@ -0,0 +1,63 @@\n+from pandas_datareader.base import _BaseReader\n+\n+\n+class TSPReader(_BaseReader):\n+\n+    \"\"\"\n+    Returns DataFrame of historical TSP fund prices from symbols, over date\n+    range, start to end.\n+\n+    Parameters\n+    ----------\n+    symbols : string, array-like object (list, tuple, Series), or DataFrame\n+        Single stock symbol (ticker), array-like object of symbols or\n+        DataFrame with index containing stock symbols.\n+    start : string, (defaults to '1/1/2010')\n+        Starting date, timestamp. Parses many different kind of date\n+        representations (e.g., 'JAN-01-2010', '1/1/10', 'Jan, 1, 1980')\n+    end : string, (defaults to today)\n+        Ending date, timestamp. Same format as starting date.\n+    retry_count : int, default 3\n+        Number of times to retry query request.\n+    pause : int, default 0\n+        Time, in seconds, to pause between consecutive queries of chunks. If\n+        single value given for symbol, represents the pause between retries.\n+    session : Session, default None\n+        requests.sessions.Session instance to be used\n+    \"\"\"\n+\n+    def __init__(self,\n+            symbols=['Linc','L2020','L2030','L2040','L2050','G','F','C','S','I'],\n+            start=None, end=None, retry_count=3, pause=0.001,\n+            session=None):\n+        super(TSPReader, self).__init__(symbols=symbols,\n+                                               start=start, end=end,\n+                                               retry_count=retry_count,\n+                                               pause=pause, session=session)\n+        self._format = 'string'\n+\n+    @property\n+    def url(self):\n+        return 'https://www.tsp.gov/InvestmentFunds/FundPerformance/index.html'\n+\n+    def read(self):\n+        \"\"\" read one data from specified URL \"\"\"\n+        df = super(TSPReader, self).read()\n+        df.columns = map(lambda x:x.strip(),df.columns)\n+        return df\n+\n+    @property\n+    def params(self):\n+        return {'startdate':self.start.strftime('%m/%d/%Y'),'enddate':self.end.strftime('%m/%d/%Y'),\n+                'fundgroup':self.symbols,'whichButton':'CSV'}\n+\n+    @classmethod","path":"pandas_datareader/tsp.py","position":54,"original_position":54,"commit_id":"2351fab7587edb50450fe55709a156fb74deb752","original_commit_id":"2351fab7587edb50450fe55709a156fb74deb752","user":{"login":"davidastephens","id":5957850,"avatar_url":"https://avatars.githubusercontent.com/u/5957850?v=3","gravatar_id":"","url":"https://api.github.com/users/davidastephens","html_url":"https://github.com/davidastephens","followers_url":"https://api.github.com/users/davidastephens/followers","following_url":"https://api.github.com/users/davidastephens/following{/other_user}","gists_url":"https://api.github.com/users/davidastephens/gists{/gist_id}","starred_url":"https://api.github.com/users/davidastephens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidastephens/subscriptions","organizations_url":"https://api.github.com/users/davidastephens/orgs","repos_url":"https://api.github.com/users/davidastephens/repos","events_url":"https://api.github.com/users/davidastephens/events{/privacy}","received_events_url":"https://api.github.com/users/davidastephens/received_events","type":"User","site_admin":false},"body":"Makes sense, but in that case I would use a staticmethod.\r\n\r\nhttp://pythoncentral.io/difference-between-staticmethod-and-classmethod-in-python/\r\n","created_at":"2016-01-11T01:38:59Z","updated_at":"2016-01-11T01:38:59Z","html_url":"https://github.com/pydata/pandas-datareader/pull/157#discussion_r49285678","pull_request_url":"https://api.github.com/repos/pydata/pandas-datareader/pulls/157","_links":{"self":{"href":"https://api.github.com/repos/pydata/pandas-datareader/pulls/comments/49285678"},"html":{"href":"https://github.com/pydata/pandas-datareader/pull/157#discussion_r49285678"},"pull_request":{"href":"https://api.github.com/repos/pydata/pandas-datareader/pulls/157"}}},"pull_request":{"url":"https://api.github.com/repos/pydata/pandas-datareader/pulls/157","id":55119122,"html_url":"https://github.com/pydata/pandas-datareader/pull/157","diff_url":"https://github.com/pydata/pandas-datareader/pull/157.diff","patch_url":"https://github.com/pydata/pandas-datareader/pull/157.patch","issue_url":"https://api.github.com/repos/pydata/pandas-datareader/issues/157","number":157,"state":"open","locked":false,"title":"Added webscraper for Thrift Savings Plan","user":{"login":"e2thenegpii","id":12396293,"avatar_url":"https://avatars.githubusercontent.com/u/12396293?v=3","gravatar_id":"","url":"https://api.github.com/users/e2thenegpii","html_url":"https://github.com/e2thenegpii","followers_url":"https://api.github.com/users/e2thenegpii/followers","following_url":"https://api.github.com/users/e2thenegpii/following{/other_user}","gists_url":"https://api.github.com/users/e2thenegpii/gists{/gist_id}","starred_url":"https://api.github.com/users/e2thenegpii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e2thenegpii/subscriptions","organizations_url":"https://api.github.com/users/e2thenegpii/orgs","repos_url":"https://api.github.com/users/e2thenegpii/repos","events_url":"https://api.github.com/users/e2thenegpii/events{/privacy}","received_events_url":"https://api.github.com/users/e2thenegpii/received_events","type":"User","site_admin":false},"body":"I added a webscraper to put TSP fund data into a dataframe.  In order to import pandas_datareader on my machine I had to put a requirement requests>=2.3.0","created_at":"2016-01-05T17:32:28Z","updated_at":"2016-01-11T01:38:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cd7f583fe4b96b66531ded4eca391d04a05aa07","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pydata/pandas-datareader/pulls/157/commits","review_comments_url":"https://api.github.com/repos/pydata/pandas-datareader/pulls/157/comments","review_comment_url":"https://api.github.com/repos/pydata/pandas-datareader/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pydata/pandas-datareader/issues/157/comments","statuses_url":"https://api.github.com/repos/pydata/pandas-datareader/statuses/2351fab7587edb50450fe55709a156fb74deb752","head":{"label":"e2thenegpii:master","ref":"master","sha":"2351fab7587edb50450fe55709a156fb74deb752","user":{"login":"e2thenegpii","id":12396293,"avatar_url":"https://avatars.githubusercontent.com/u/12396293?v=3","gravatar_id":"","url":"https://api.github.com/users/e2thenegpii","html_url":"https://github.com/e2thenegpii","followers_url":"https://api.github.com/users/e2thenegpii/followers","following_url":"https://api.github.com/users/e2thenegpii/following{/other_user}","gists_url":"https://api.github.com/users/e2thenegpii/gists{/gist_id}","starred_url":"https://api.github.com/users/e2thenegpii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e2thenegpii/subscriptions","organizations_url":"https://api.github.com/users/e2thenegpii/orgs","repos_url":"https://api.github.com/users/e2thenegpii/repos","events_url":"https://api.github.com/users/e2thenegpii/events{/privacy}","received_events_url":"https://api.github.com/users/e2thenegpii/received_events","type":"User","site_admin":false},"repo":{"id":49075113,"name":"pandas-datareader","full_name":"e2thenegpii/pandas-datareader","owner":{"login":"e2thenegpii","id":12396293,"avatar_url":"https://avatars.githubusercontent.com/u/12396293?v=3","gravatar_id":"","url":"https://api.github.com/users/e2thenegpii","html_url":"https://github.com/e2thenegpii","followers_url":"https://api.github.com/users/e2thenegpii/followers","following_url":"https://api.github.com/users/e2thenegpii/following{/other_user}","gists_url":"https://api.github.com/users/e2thenegpii/gists{/gist_id}","starred_url":"https://api.github.com/users/e2thenegpii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e2thenegpii/subscriptions","organizations_url":"https://api.github.com/users/e2thenegpii/orgs","repos_url":"https://api.github.com/users/e2thenegpii/repos","events_url":"https://api.github.com/users/e2thenegpii/events{/privacy}","received_events_url":"https://api.github.com/users/e2thenegpii/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/e2thenegpii/pandas-datareader","description":"","fork":true,"url":"https://api.github.com/repos/e2thenegpii/pandas-datareader","forks_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/forks","keys_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/teams","hooks_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/hooks","issue_events_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/issues/events{/number}","events_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/events","assignees_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/assignees{/user}","branches_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/branches{/branch}","tags_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/tags","blobs_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/git/refs{/sha}","trees_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/statuses/{sha}","languages_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/languages","stargazers_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/stargazers","contributors_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/contributors","subscribers_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/subscribers","subscription_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/subscription","commits_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/commits{/sha}","git_commits_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/git/commits{/sha}","comments_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/comments{/number}","issue_comment_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/issues/comments{/number}","contents_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/contents/{+path}","compare_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/merges","archive_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/downloads","issues_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/issues{/number}","pulls_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/pulls{/number}","milestones_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/milestones{/number}","notifications_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/labels{/name}","releases_url":"https://api.github.com/repos/e2thenegpii/pandas-datareader/releases{/id}","created_at":"2016-01-05T15:41:47Z","updated_at":"2016-01-05T15:41:48Z","pushed_at":"2016-01-09T16:20:20Z","git_url":"git://github.com/e2thenegpii/pandas-datareader.git","ssh_url":"git@github.com:e2thenegpii/pandas-datareader.git","clone_url":"https://github.com/e2thenegpii/pandas-datareader.git","svn_url":"https://github.com/e2thenegpii/pandas-datareader","homepage":null,"size":387,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"pydata:master","ref":"master","sha":"c637507565a912f29b35354f43d98fb5e91be790","user":{"login":"pydata","id":1284191,"avatar_url":"https://avatars.githubusercontent.com/u/1284191?v=3","gravatar_id":"","url":"https://api.github.com/users/pydata","html_url":"https://github.com/pydata","followers_url":"https://api.github.com/users/pydata/followers","following_url":"https://api.github.com/users/pydata/following{/other_user}","gists_url":"https://api.github.com/users/pydata/gists{/gist_id}","starred_url":"https://api.github.com/users/pydata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydata/subscriptions","organizations_url":"https://api.github.com/users/pydata/orgs","repos_url":"https://api.github.com/users/pydata/repos","events_url":"https://api.github.com/users/pydata/events{/privacy}","received_events_url":"https://api.github.com/users/pydata/received_events","type":"Organization","site_admin":false},"repo":{"id":29273084,"name":"pandas-datareader","full_name":"pydata/pandas-datareader","owner":{"login":"pydata","id":1284191,"avatar_url":"https://avatars.githubusercontent.com/u/1284191?v=3","gravatar_id":"","url":"https://api.github.com/users/pydata","html_url":"https://github.com/pydata","followers_url":"https://api.github.com/users/pydata/followers","following_url":"https://api.github.com/users/pydata/following{/other_user}","gists_url":"https://api.github.com/users/pydata/gists{/gist_id}","starred_url":"https://api.github.com/users/pydata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydata/subscriptions","organizations_url":"https://api.github.com/users/pydata/orgs","repos_url":"https://api.github.com/users/pydata/repos","events_url":"https://api.github.com/users/pydata/events{/privacy}","received_events_url":"https://api.github.com/users/pydata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pydata/pandas-datareader","description":"","fork":false,"url":"https://api.github.com/repos/pydata/pandas-datareader","forks_url":"https://api.github.com/repos/pydata/pandas-datareader/forks","keys_url":"https://api.github.com/repos/pydata/pandas-datareader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pydata/pandas-datareader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pydata/pandas-datareader/teams","hooks_url":"https://api.github.com/repos/pydata/pandas-datareader/hooks","issue_events_url":"https://api.github.com/repos/pydata/pandas-datareader/issues/events{/number}","events_url":"https://api.github.com/repos/pydata/pandas-datareader/events","assignees_url":"https://api.github.com/repos/pydata/pandas-datareader/assignees{/user}","branches_url":"https://api.github.com/repos/pydata/pandas-datareader/branches{/branch}","tags_url":"https://api.github.com/repos/pydata/pandas-datareader/tags","blobs_url":"https://api.github.com/repos/pydata/pandas-datareader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pydata/pandas-datareader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pydata/pandas-datareader/git/refs{/sha}","trees_url":"https://api.github.com/repos/pydata/pandas-datareader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pydata/pandas-datareader/statuses/{sha}","languages_url":"https://api.github.com/repos/pydata/pandas-datareader/languages","stargazers_url":"https://api.github.com/repos/pydata/pandas-datareader/stargazers","contributors_url":"https://api.github.com/repos/pydata/pandas-datareader/contributors","subscribers_url":"https://api.github.com/repos/pydata/pandas-datareader/subscribers","subscription_url":"https://api.github.com/repos/pydata/pandas-datareader/subscription","commits_url":"https://api.github.com/repos/pydata/pandas-datareader/commits{/sha}","git_commits_url":"https://api.github.com/repos/pydata/pandas-datareader/git/commits{/sha}","comments_url":"https://api.github.com/repos/pydata/pandas-datareader/comments{/number}","issue_comment_url":"https://api.github.com/repos/pydata/pandas-datareader/issues/comments{/number}","contents_url":"https://api.github.com/repos/pydata/pandas-datareader/contents/{+path}","compare_url":"https://api.github.com/repos/pydata/pandas-datareader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pydata/pandas-datareader/merges","archive_url":"https://api.github.com/repos/pydata/pandas-datareader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pydata/pandas-datareader/downloads","issues_url":"https://api.github.com/repos/pydata/pandas-datareader/issues{/number}","pulls_url":"https://api.github.com/repos/pydata/pandas-datareader/pulls{/number}","milestones_url":"https://api.github.com/repos/pydata/pandas-datareader/milestones{/number}","notifications_url":"https://api.github.com/repos/pydata/pandas-datareader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pydata/pandas-datareader/labels{/name}","releases_url":"https://api.github.com/repos/pydata/pandas-datareader/releases{/id}","created_at":"2015-01-15T00:34:19Z","updated_at":"2016-01-10T19:05:04Z","pushed_at":"2016-01-09T16:20:21Z","git_url":"git://github.com/pydata/pandas-datareader.git","ssh_url":"git@github.com:pydata/pandas-datareader.git","clone_url":"https://github.com/pydata/pandas-datareader.git","svn_url":"https://github.com/pydata/pandas-datareader","homepage":null,"size":459,"stargazers_count":52,"watchers_count":52,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":29,"forks":25,"open_issues":29,"watchers":52,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pydata/pandas-datareader/pulls/157"},"html":{"href":"https://github.com/pydata/pandas-datareader/pull/157"},"issue":{"href":"https://api.github.com/repos/pydata/pandas-datareader/issues/157"},"comments":{"href":"https://api.github.com/repos/pydata/pandas-datareader/issues/157/comments"},"review_comments":{"href":"https://api.github.com/repos/pydata/pandas-datareader/pulls/157/comments"},"review_comment":{"href":"https://api.github.com/repos/pydata/pandas-datareader/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pydata/pandas-datareader/pulls/157/commits"},"statuses":{"href":"https://api.github.com/repos/pydata/pandas-datareader/statuses/2351fab7587edb50450fe55709a156fb74deb752"}}}}