Skip to main content

A web scraper for ticker symbols from yahoo finance

Project description

Yahoo ticker downloader
=======================

Produces .csv, .json, .yaml, and .xls files (All files contain same data in a
different format) for stocks, futures, ETF, indexes, mutual funds
and currency. The ticker symbol, company name and exchange are saved.
The category the symbol belongs to is only stored for stock symbols.

It gets its data from `http://finance.yahoo.com/lookup/`_. Please note: it
is not possible to get all the symbols due to limitations set by Yahoo.
About 75%-90% of all symbols are gathered using this script depending on type.

Installation
---------------------

From python package manager (preferred):

.. code:: bash

pip install Yahoo-ticker-downloader

From source:

.. code:: bash

python setup.py install

Running
---------------------

The first param is one of the following types: ``stocks`` ``etf``
``index`` ``currency`` ``future`` ``mutualfund``

.. code:: bash

YahooTickerDownloader.py stocks

The program takes several hours before any output is generated.
The program supports suspending and resuming a download.
Press CTRL+C to suspend download. Restart the program
in the same working directory to resume downloading.

Example of output:

.. code:: csv

Ticker,Name,Exchange,categoryName,categoryNr
ENZ,"Enzo Biochem Inc.",NYQ,"Medical Laboratories & Research",525
ENZN,"Enzon Pharmaceuticals Inc.",NMS,Biotechnology,515
ENZR,"Energizer Resources Inc.",PNK,,0
EOAA.DE,"E.ON AG",GER,"Diversified Utilities",913
KMX,"CarMax Inc.",NYQ,"Auto Dealerships",744
KMY.MU,KIMBERLY-CLARK,MUN,"Personal Products",323
KN1.DU,ECOUNION,DUS,"Business Software & Services",826
KNCAY,"Konica Minolta Holdings Inc.",PNK,,0
KND,"Kindred Healthcare Inc.",NYQ,"Long-Term Care Facilities",523
KNDI,"Kandi Technologies, Corp",NGM,"Auto Manufacturers - Major",330
...ect

Depending on the type you are downloading, you will between 3.000 and 26.000
entries.

Further resources
---------------------

Download history for symbols: ystockquote_

Changelog
---------------------

* Version 0.3.0

* Use https instead of http
* Retry to fetch a page if it contains no symbols (A "fix" for issue #4)
* Renamed all 'Curreny' to 'Currency'
* Relative imports are used
* Fix: .csv file it outputs is encoded in UTF-8 when using python2
* Performance: Considerable reduced memory consumption
* It now outputs .json, .yaml and .xls files in addition to .csv

.. _`http://finance.yahoo.com/lookup/`: http://finance.yahoo.com/lookup/
.. _ystockquote: https://pypi.python.org/pypi/ystockquote/

Project details


Release history Release notifications

History Node

2.2.0

History Node

2.1.1

History Node

2.1.0

History Node

2.0.1

History Node

2.0.0

History Node

1.0.0

History Node

0.10.1

History Node

0.10.0

History Node

0.8.1

History Node

0.7.0

History Node

0.5.1

History Node

0.5.0

History Node

0.4.3

History Node

0.4.2

History Node

0.4.1

History Node

0.4.0

This version
History Node

0.3.0

History Node

0.2.8

History Node

0.2.7

History Node

0.2.6

History Node

0.2.5

History Node

0.2.4

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
Yahoo-ticker-downloader-0.3.0.tar.gz (6.9 kB) Copy SHA256 hash SHA256 Source None Aug 14, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page