A migration of the pandas functionality to read yahoo finance stock prices

Overview

This project is a migration of the pandas functionality to read yahoo finance stock prices

https://github.com/pydata/pandas-datareader/blob/main/pandas_datareader/yahoo/daily.py

This lib have a strong advantage on backtesting strategies as it can give all the dataframe in yahoo finance, this means that can get daily data on futures like NQ=F and ES=F since 2000 and it goes as far as getting data from 1927 on the SP500 yahoo finance symbol ^GSPC

Yahoo Finance data

Features

Get daily data from yahoo finance for the entire dataframe available

Getting started

Add the dependency to your pubspec.yaml:

yahoo_finance_data_reader: ^0.0.2

Usage

List<dynamic> prices = await YahooFinanceDailyReader().getDailyData('GOOG');

Additional information

To include in your app as a widget you can start with this future builder and debug your way until your desired result

FutureBuilder(
    future: const YahooFinanceDailyReader().getDailyData('GOOG'),
    builder:
        (BuildContext context, AsyncSnapshot<List<dynamic>> snapshot) {
        if (snapshot.connectionState == ConnectionState.done) {
        List<dynamic> historicalData = snapshot.data!;
        return ListView.builder(
            itemCount: historicalData.length,
            itemBuilder: (BuildContext context, int index) {
                return Container(
                    margin: const EdgeInsets.all(10),
                    child: Text(historicalData[index].toString()));
            });
        } else if (snapshot.hasError) {
        return Text('Error ${snapshot.error}');
        }

        return const Center(
        child: SizedBox(
            height: 50,
            width: 50,
            child: CircularProgressIndicator(),
        ),
        );
},
)

Use a proxy to use this project in flutter web

To use this project in flutter web and don't get the CORS error, you can use a prefix in the constructor of the data reader

List prices = 
    await YahooFinanceDailyReader(prefix: 'https://thingproxy.freeboard.io/fetch/https://').getDailyData('GOOG');

Like us on pub.dev

Package url: https://pub.dev/packages/yahoo_finance_data_reader

Instruction to publish the package to pub.dev

dart pub publish

You might also like...

This app for read quran in your smartphone

Alqurani This app has release in google play, free Google Play Features List of Surah Translate of surah Tafsir of surah List of daily du'a Contribute

Oct 5, 2022

Dart Web API Template Using Google Shelf Framework and Postgres Drivers, read readme to learn how to use

Shelf Web Framework Template by Alex Merced of AlexMercedCoder.com Cloning the Template git clone https://github.com/AlexMercedCoder/DartShelfPostgres

Dec 26, 2022

Implementing simple storage operations, CRUD (Create, Read, Update, Delete), using Firebase Firestore

Implementing simple storage operations, CRUD (Create, Read, Update, Delete), using Firebase Firestore

CRUD Firebase Implementing simple storage operations, CRUD (Create, Read, Update

Oct 29, 2022

Mangato - An Android & IOS app to read manga on your phone without ads.

Mangato - An Android & IOS app to read manga on your phone without ads.

Mangato Read your favorite Japanese manga on Mangato including Attack on Titan, Fairy Tail, The Seven Deadly Sins, Fuuka, One Piece, and more. WARNING

Nov 21, 2022

Bac-App-Flutter - Flutter application where you can read PDF locally or by internet and is saved

Bac-App-Flutter - Flutter application where you can read PDF locally or by internet and is saved

Bac App - Flutter Flutter application where you can read PDF locally or by inter

Jun 7, 2022

Bringing back contex.read and context.watch for riverpod

This package brings back the context extensions for riverpod that were discontinued in version 1.0.0. To read any provider, do context.read(myProvider

Sep 28, 2022

A Flutter plugin for fetching Firestore documents with read from cache first then server.

A Flutter plugin for fetching Firestore documents with read from cache first then server.

Firestore Cache A Flutter plugin for fetching Firestore documents with read from cache first then server. This plugin is mainly designed for applicati

Nov 24, 2022

This project is aimed to read online attendance by using QR code

This project is aimed to read online attendance by using QR code

Online Yoklama (Online Attandance) This project is aimed to read online attendance by using QR code. Materials ESP32 AI Thinker CAM PL2303 UART Buzzer

Jan 14, 2022

A Flutter plugin to read πŸ”– metadata of 🎡 media files. Supports Windows, Linux & Android.

A Flutter plugin to read πŸ”– metadata of 🎡 media files. Supports Windows, Linux & Android.

flutter_media_metadata A Flutter plugin to read metadata of media files. A part of Harmonoid open source project πŸ’œ Install Add in your pubspec.yaml.

Dec 2, 2022
Comments
  • No values returned

    No values returned

    If you wonder why is not working anymore, looks like yahoo started to encrypt the stores, there is also a thread on

    There is also this thread on pandas datareader with the same problem

    Screenshot 2022-12-17 at 12 09 02
    opened by ivofernandes 4
  • New class and feature?

    New class and feature?

    Hey, I have created a data class for your package (See below). It works like this:

    List<YahooFinDateData> data = (snapshot?.data ?? []).map((e) => YahooFinDateData.fromJson(e)).toList();
    
    • [x] #3
    • [x] #4

    It could look like this:

    YahooFinanceDailyReader().getDataFromDate(ticker, DateTime.now());
    

    Thanks!

    class YahooFinDateData {
      final dynamic json;
      final DateTime date;
      final double? open;
      final double? high;
      final double? low;
      final double? close;
      final int? volume;
      final double? adjClose;
    
      YahooFinDateData(
        this.json, {
        required this.date,
        required this.open,
        required this.high,
        required this.low,
        required this.close,
        required this.volume,
        required this.adjClose,
      });
    
      static YahooFinDateData fromJson(json) {
        return YahooFinDateData(
          json,
          date: DateTime.fromMillisecondsSinceEpoch(json['date'] * 1000),
          open: json['open'] == null ? null : double.parse(json['open'].toString()),
          high: json['high'] == null ? null : double.parse(json['high'].toString()),
          low: json['low'] == null ? null : double.parse(json['low'].toString()),
          close:
              json['close'] == null ? null : double.parse(json['close'].toString()),
          volume:
              json['volume'] == null ? null : int.parse(json['volume'].toString()),
          adjClose: json['adjclose'] == null
              ? null
              : double.parse(json['adjclose'].toString()),
        );
      }
    
      @override
      String toString() => json;
    }
    
    opened by BugsOverBugs 4
Owner
Ivo Fernandes
I'm a Flutter developer with 3 years of experience in flutter and 13 years of experience in software in general, started in 2008
Ivo Fernandes
Finance-App-UI - Finance App UI Made in Flutter. πŸ’˜

?? Finance App UI Design In Flutter ?? Click Here To Download The App Getting Started This project is a starting point for a Flutter application. A fe

Samarpan Dasgupta 3 Jul 8, 2022
A poor man's version of a pandas DataFrame for dart.

koala A poor man's version of a pandas DataFrame. Collect, access & manipulate related data. Examples Create a DataFrame from a csv file, preexisting

Janek Zangenberg 3 Nov 19, 2022
An application to track bitcoin prices around the world.

![App Brewery Banner](https://github.com/londonappbrewery/Images/blob/master/AppBreweryBanner.png) # Bitcoin Ticker ?? ## Our Goal The object

Aryaman Prakash 1 Jan 7, 2022
ITS A SIMPLE CRYPTO APP THAT GIVES OR DISPLAYS PRICES - %CHANGE AND CHANGE VALUE OF TICKER (VARIOUS CRYPTO ASSERTS)

btcpricetracker A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

jatin upadhyay 0 Dec 28, 2021
Flutter Web Finance

Flutter Web Finance A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

Morteza Bozorgzade 3 Mar 30, 2022
A finance app tracking financial inventory.

flutter_fintech A Fintech App that keeps track of your personal Finances Getting Started Clone or Fork this project if you're seeking to learn how to

Chocolate Victor 7 Dec 29, 2022
Yukino lets you read manga or stream anime ad-free from multiple sources for free! Available for Windows, Linux, MacOS and Android.

Yukino Yukino lets you read manga or stream anime ad-free from multiple sources. The project's name "Yukino" meaning "Snow" named after the character

Yukino 204 Jan 6, 2023
Rest Api Crud funtion . Created, Update, Delete , Read

flutter_application_10 A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you s

Jamirul islam (Joy) 2 Nov 30, 2022
The read-a-book app is using static data. the application I developed has a homepage and detail page

book_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Adil Ahmet SargΔ±n 1 Nov 12, 2021
Weather app using Bloc architecture pattern & generic HTTP client with interface implementation and much more for more detail read Readme

weather Weather application for current weather, hourly forecast for 48 hours, Daily forecast for 7 days and national weather alerts. How to Run Insta

Jibran Ahmed SiddiQui 9 Oct 29, 2022