Git Product home page Git Product logo

Comments (7)

danielecook avatar danielecook commented on June 2, 2024

I'm not entirely sure what the issue is. Did you install the module with pip?

from iex-api-python.

hydroplosion avatar hydroplosion commented on June 2, 2024

I was getting that after installing from pip. Installing from a clone with sudo works.

from iex-api-python.

danielecook avatar danielecook commented on June 2, 2024

Interesting. I don't see this issue on MacOS. Perhaps this is windows specific?

from iex-api-python.

hydroplosion avatar hydroplosion commented on June 2, 2024

(original post scrapped)
Seems I'm having capitalization issues. Was using Ubuntu in my previous comment, but on macOS the pip install doesn't seem to have the updated class names and wants lowercase i.e. stock('aapl'). I haven't gone back to try pip on Ubuntu, but might explain why manual install worked.

from iex-api-python.

danielecook avatar danielecook commented on June 2, 2024

Hey @hydroplosion I recently updated the package to use more traditional class names. Now the package uses Stock instead of stock. Usage is:

from iex import Stock
aapl = Stock("AAPL")

But certain classes don't have any required arguments when creating an instance. For example, the Market class doesn't require any arguments. Because it doesn't require any arguments, its pre-instantiated and can be imported as a class or an instance:

from iex import Market
market = Market()
market.gainers()

OR

from iex import market
market.gainers()

Hope that helps.

from iex-api-python.

hydroplosion avatar hydroplosion commented on June 2, 2024

@danielecook yes, I did notice that. This is why I am thinking pip is not updated with the latest code using capital letter class names.

Python 3.7.0 (default, Jul 30 2018, 17:14:49) 
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from iex import Stock
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Stock' from 'iex' (/usr/local/lib/python3.7/site-packages/iex/__init__.py)
>>> from iex import stock
>>> aapl = Stock('aapl')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Stock' is not defined
>>> aapl = stock('aapl')
>>>

from iex-api-python.

danielecook avatar danielecook commented on June 2, 2024

oh I am sorry, I misunderstood. I think I need to release a new version.

from iex-api-python.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.