Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors #6

Closed
NkdmsL opened this issue Jun 19, 2017 · 1 comment · Fixed by #10
Closed

Errors #6

NkdmsL opened this issue Jun 19, 2017 · 1 comment · Fixed by #10

Comments

@NkdmsL
Copy link

NkdmsL commented Jun 19, 2017

I tried to use the class FinancialsDownloader() class and didnt work :(.

Code example below:

fd = gm.FinancialsDownloader()
test = fd._download('APPL', 'is')

and gives the error:

with urllib2.urlopen(url) as response:
NameError: name 'urllib2' is not defined ...

In order to fix the problem I changed the line 300
FROM with urllib2.urlopen(url) as response: TO with urllib.request.urlopen(url) as response:

As soon as I overcomed the problem above I am getting the following error that is caused by line 302 json_data = json.loads(json_text) :

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I am on a dead-end situation now :(

@linwoodc3
Copy link
Contributor

linwoodc3 commented Jul 23, 2017

@NkdmsL I think you need to try the example exactly as specified

import good_morning as gm
kr = gm.KeyRatiosDownloader()
kr_frames = kr.download('AAPL')

Regardign urllib2, yes, I think that made it in there from my commit somehow. I'm fixing and will send a pull request to @petercerno . I made changes this morn and had it pull back Apple stock in an environment with Python 3.5.

This is an error similar to #7

linwoodc3 added a commit to linwoodc3/good-morning that referenced this issue Jul 23, 2017
… and exception handling for passing empty string and invalid ticker symbol
linwoodc3 added a commit to linwoodc3/good-morning that referenced this issue Jul 23, 2017
…ling, adds unittests, and includeds contin. integration tests for Windows, Linux, OSX.
linwoodc3 added a commit to linwoodc3/good-morning that referenced this issue Jul 23, 2017
commit c1fcdae
Merge: fde97ac fd73447
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 14:08:59 2017 -0400

    Merge branch 'urlFix_linwoodError' of https://github.com/linwoodc3/good-morning into urlFix_linwoodError

commit fde97ac
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 10:28:18 2017 -0400

    Fixes petercerno#6 and petercerno#7 url problems, adds exception handling, adds unittests, and includeds contin. integration tests for Windows, Linux, OSX.

commit fd73447
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 13:36:25 2017 -0400

    Fixing the travis ci build. # 17

commit f58f591
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 13:17:00 2017 -0400

    Fixing the travis ci build. # 16

commit fcc539a
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 13:06:44 2017 -0400

    Fixing the travis ci build. # 15

commit 6fc4e9f
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 12:55:46 2017 -0400

    Fixing the travis ci build. # 14

commit 6d04c78
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 12:40:49 2017 -0400

    Fixing the travis ci build. # 13

commit a280acf
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 12:20:20 2017 -0400

    Fixing the travis ci build. # 12

commit 57abfd1
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 12:12:17 2017 -0400

    Fixing the travis ci build. # 11

commit 536ec5d
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:51:13 2017 -0400

    Fixing the travis ci build. # 9

commit 7e8a6d7
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:39:51 2017 -0400

    Fixing the travis ci build. # 8

commit 7e95db7
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:33:16 2017 -0400

    Fixing the travis ci build. # 7

commit d97535a
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:23:15 2017 -0400

    Fixing the travis ci build. # 6

commit 7b48720
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:19:08 2017 -0400

    Fixing the travis ci build. # 5

commit 64f6f12
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:09:12 2017 -0400

    Fixing the travis ci build. # 4

commit c8501e9
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 10:56:42 2017 -0400

    Fixing the travis ci build. # 3

commit 7853d38
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 10:50:37 2017 -0400

    Fixing the travis ci build. # 2

commit 9a00fbf
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 10:47:04 2017 -0400

    Fixing the travis ci build.

commit 3df0634
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 10:28:18 2017 -0400

    Fixes petercerno#6 and petercerno#7 url problems.  Also adds unit test and exception handling for passing empty string and invalid ticker symbol
linwoodc3 added a commit to linwoodc3/good-morning that referenced this issue Jul 23, 2017
commit c1fcdae
Merge: fde97ac fd73447
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 14:08:59 2017 -0400

    Merge branch 'urlFix_linwoodError' of https://github.com/linwoodc3/good-morning into urlFix_linwoodError

commit fde97ac
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 10:28:18 2017 -0400

    Fixes petercerno#6 and petercerno#7 url problems, adds exception handling, adds unittests, and includeds contin. integration tests for Windows, Linux, OSX.

commit fd73447
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 13:36:25 2017 -0400

    Fixing the travis ci build. # 17

commit f58f591
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 13:17:00 2017 -0400

    Fixing the travis ci build. # 16

commit fcc539a
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 13:06:44 2017 -0400

    Fixing the travis ci build. # 15

commit 6fc4e9f
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 12:55:46 2017 -0400

    Fixing the travis ci build. # 14

commit 6d04c78
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 12:40:49 2017 -0400

    Fixing the travis ci build. # 13

commit a280acf
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 12:20:20 2017 -0400

    Fixing the travis ci build. # 12

commit 57abfd1
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 12:12:17 2017 -0400

    Fixing the travis ci build. # 11

commit 536ec5d
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:51:13 2017 -0400

    Fixing the travis ci build. # 9

commit 7e8a6d7
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:39:51 2017 -0400

    Fixing the travis ci build. # 8

commit 7e95db7
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:33:16 2017 -0400

    Fixing the travis ci build. # 7

commit d97535a
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:23:15 2017 -0400

    Fixing the travis ci build. # 6

commit 7b48720
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:19:08 2017 -0400

    Fixing the travis ci build. # 5

commit 64f6f12
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 11:09:12 2017 -0400

    Fixing the travis ci build. # 4

commit c8501e9
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 10:56:42 2017 -0400

    Fixing the travis ci build. # 3

commit 7853d38
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 10:50:37 2017 -0400

    Fixing the travis ci build. # 2

commit 9a00fbf
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 10:47:04 2017 -0400

    Fixing the travis ci build.

commit 3df0634
Author: Linwood Creekmore III <[email protected]>
Date:   Sun Jul 23 10:28:18 2017 -0400

    Fixes petercerno#6 and petercerno#7 url problems.  Also adds unit test and exception handling for passing empty string and invalid ticker symbol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants