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

List of commodities #122

Open
Orchid420 opened this issue Oct 21, 2022 · 1 comment
Open

List of commodities #122

Orchid420 opened this issue Oct 21, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Orchid420
Copy link

Can you build a screener to get a list of all commodities?

https://finance.yahoo.com/commodities/

Thanks

@dpguthrie dpguthrie added enhancement New feature or request help wanted Extra attention is needed labels Oct 21, 2022
@dpguthrie
Copy link
Owner

You might not need a screener for this as the code below would give you what you're looking for:

import pandas as pd  # Optional
from yahooquery import Ticker


symbols = [
    'ES=F',
    'YM=F',
    'NQ=F',
    'RTY=F',
    'ZB=F',
    'ZN=F',
    'ZF=F',
    'ZT=F',
    'GC=F',
    'MGC=F',
    'SI=F',
    'SIL=F',
    'PL=F',
    'HG=F',
    'PA=F',
    'CL=F',
    'HO=F',
    'NG=F',
    'RB=F',
    'BZ=F',
    'B0=F',
    'ZC=F',
    'ZO=F',
    'KE=F',
    'ZR=F',
    'ZM=F',
    'ZL=F',
    'ZS=F',
    'GF=F',
    'HE=F',
    'LE=F',
    'CC=F',
    'KC=F',
    'CT=F',
    'LBS=F',
    'OJ=F',
    'SB=F',
]

t = Ticker(symbols)
quotes = t.quotes

# Optional pandas step
df = pd.DataFrame(quotes).T

But, the custom screener functionality is something I'd like to have in this library but don't have the time to build right now. If you want to build it out and open a PR, would be happy to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants