Git Product home page Git Product logo

yfmongo's Introduction

PyPI version
yfMongo

yfMongo is a simple command line app to store and manage Yahoo Finance stock data in a MongoDb database.
It allows you to build a local corpus of stock data that can be reused and updated easily wihout having to be constantly online.
The API access is handled using YahooFetcher .

Install

pip install yfm

Features

  • Retrieve stock data from Yahoo Finance using Yahoo tickers
  • Store tickers locally in MongoDb
  • Retrieve some indexes constituent data
  • Update tickers data daily
  • Fetch by date range
  • Export the data to JSON and CSV

Requirements

  • Python v2.6 at least
  • Pymongo python module
  • a running MongoDb instance

Database structure

By default yfMongo creates a database called yfmongo in your local MongoDb setup. Inside this database, two collections contain all the data:

  • symbols : tickers list
  • timeline : tickers data (opening price, closing, max, min, volumen and date)

Usage

yfm can be used as a command line tool to load symbols into the mongodb database or directly as a python module:

yfm add goog                        # add the 'goog' ticker to the database
yfm add mse  06/05/2013 12/05/2013  # add mse and fetch the data between 6th May 2013 and 12th May 2013.
yfm add index ftse                  # add the tickers for the index FTSE
yfm remove goog                     # removes GOOG from the db, ticker and timeline info
yfm update                          # for each ticker retrieve data since last day until today
yfm show mse                        # displays mse content

Directly from within python, tipycally to read from the database

import yfm
fetcher = yfm.fetcher()
fetcher.getTicker("goog")  # read from the db
fetcher.update() # same as 'yfm update'

Openshift integration

In order to use yfm in OpenShift, edit yfm file and override the following parameters: hostname = os.environ.get("OPENSHIFT_MONGODB_DB_HOST") port = os.environ.get("OPENSHIFT_MONGODB_DB_PORT") user = os.environ.get("OPENSHIFT_MONGODB_DB_USERNAME") password = os.environ.get("OPENSHIFT_MONGODB_DB_PASSWORD")

yfmongo's People

Contributors

rubenafo avatar

Watchers

 avatar

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.