Skip to main content

REST Client for Tiingo Data Platform API

Project description

=============
Tiingo Python
=============


.. image:: https://img.shields.io/pypi/v/tiingo.svg
:target: https://pypi.python.org/pypi/tiingo

.. image:: https://img.shields.io/codecov/c/github/hydrosquall/tiingo-python.svg?maxAge=600
:target: https://codecov.io/gh/hydrosquall/tiingo-python
:alt: Coverage

.. image:: https://img.shields.io/travis/hydrosquall/tiingo-python.svg
:target: https://travis-ci.org/hydrosquall/tiingo-python

.. image:: https://readthedocs.org/projects/tiingo-python/badge/?version=latest
:target: https://tiingo-python.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://pyup.io/repos/github/hydrosquall/tiingo-python/shield.svg
:target: https://pyup.io/repos/github/hydrosquall/tiingo-python/
:alt: Updates


Tiingo is a financial data platform that makes high quality financial tools available to all. Tiingo has a REST and Real-Time Data API, which this library helps you to access. Presently, the API includes support for the following endpoints:

* Stock Market Ticker Closing Prices + Metadata. Data includes full distribution details and is validated using a proprietary EOD Price Engine.
* Curated news from top financial news sources + blogs. Stories are tagged with topic tags and relevant stock tickers by Tiingo's algorithms.


Usage
--------

First, install the library from PyPi:

.. code-block:: shell

pip install tiingo

Next, initialize your client object. It is recommended to use an environment
variable to initialize your client object for convenience.

.. code-block:: python

from tiingo import TiingoClient
# Set TIINGO_API_KEY in your environment variables in your .bash_profile, OR
# pass a dictionary with 'api_key' as a key into the TiingoClient.

client = TiingoClient()

Alternately, you may use a dictionary to customize/authorize your client.

.. code-block:: python

config = {}

# To reuse the same HTTP Session across API calls (and have better performance), include a session key.
config['session'] = True

# If you don't have your API key as an environment variable,
# pass it in via a configuration dictionary.
config['api_key'] = "MY_SECRET_API_KEY"

# Initialize
client = TiingoClient(config)

Now you can use ``TiingoClient`` to make your API calls. (Other parameters are available for each endpoint beyond what is used in the below examples, inspect the docstring for each function for details.).

.. code-block:: python

# Get Ticker
ticker_metadata = client.get_ticker_metadata("GOOGL")

# Get latest prices, based on 3+ sources, as CSV or JSON, sampled weekly
ticker_price = client.get_ticker_price("GOOGL", frequency="weekly")

# Check what tickers are available, as well as metadata about each ticker
# including supported currency, exchange, and available start/end dates.
tickers = client.get_stock_tickers()

# Get news articles about given tickers or search terms from given domains
articles = client.get_news(tickers=['GOOGL', 'APPL'],
tags=['Laptops'],
sources=['washingtonpost.com'],
startDate='2017-01-01',
endDate='2017-08-31')


Further Docs
--------

* Official Tiingo Documentation: https://api.tiingo.com
* Tiingo-Python Documentation (Under Construction): https://tiingo-python.readthedocs.io.

Features
--------

* Easy programmatic access to Tiingo API
* Reuse requests session across API calls for better performance
* Coming soon:
* Client-side validation of tickers
* Data validation of returned responses
* Case insensitivity for ticker names


Credits
---------

* Many thanks to Rishi Singh for creating Tiingo.

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage

=======
History
=======

0.1.0 (2017-08-24)
------------------

* First release on PyPI.


Project details


Download files

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

Source Distribution

tiingo-0.3.1.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tiingo-0.3.1-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file tiingo-0.3.1.tar.gz.

File metadata

  • Download URL: tiingo-0.3.1.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tiingo-0.3.1.tar.gz
Algorithm Hash digest
SHA256 35799fa315327333383fe8befcb3a48a262213c30f19900989a3797f3afe95eb
MD5 4c7b7ff3e13b24cdd22c9a1ce1225f22
BLAKE2b-256 b96fb6a3f819f70b887f4bbe77abcda39b2051037fc364219f5af3e3af44cc5b

See more details on using hashes here.

File details

Details for the file tiingo-0.3.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for tiingo-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4021e36140a5e57ebd1227791bd141f85ca6605b6c957f2dbc4b5bdd92596ca6
MD5 d6a8f02f0e8857d2df119b16d6693587
BLAKE2b-256 a05be1483814f1286b3dabed0cced9f1bd84414cd642743f7f9882e92566bd13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page