Package: rndqts
rndqtsRandom stock market quotesLatest versionInstallationas a standalone lib.# Set up a virtualenv.python3-mvenvvenvsourcevenv/bin/activate# Install from PyPI...pipinstall--upgradepip
pipinstall-Urndqts# ...or, install from updated source code.pipinstallgit+https://github.com/davips/rndqtsas an editable lib inside your project.cdyour-projectsourcevenv/bin/activate
gitclonehttps://github.com/davips/rndqts../rndqts
pipinstall--upgradepip
pipinstall-e../rndqtsExamplesFetching from YahoofromrndqtsimportRealprint(Real("VALE3.sa").data)"""Fetching VALE3.SA ...[*********************100%***********************]  1 of 1 completedOpen       High        Low      Close    VolumeDate2020-12-17  82.771173  84.158663  82.455396  83.440994  213678002020-12-18  83.842888  84.570121  83.661076  84.015129  238431002020-12-21  82.436261  83.632377  81.125317  83.115654  318773002020-12-22  83.115654  83.240048  81.747298  83.192207  231570002020-12-23  82.799879  83.756771  82.675485  83.594101  177102002020-12-28  84.005561  84.761506  83.326168  83.546249  260013002020-12-29  84.177801  84.397882  82.780740  83.316597  197275002020-12-30  83.431427  83.814178  82.914705  83.680214  30102700"""Random stock quotesfromrndqtsimportRealisticfromrndqtsimportReal# Real quotes to fetch from Yahoo.r1=Real("PETR4.sa")r2=Real("CSNA3.sa")r3=Real("VALE3.sa")r4=Real("USIM5.sa")# Generating random quotes.print(Realistic([r1,r2,r3,r4]).data)"""Fetching PETR4.SA ...[*********************100%***********************]  1 of 1 completedFetching CSNA3.SA ...[*********************100%***********************]  1 of 1 completedFetching USIM5.SA ...[*********************100%***********************]  1 of 1 completedOpen    High     Low   Close  VolumeDate0      99.71  105.87   99.28  104.65   124991     105.44  105.72  103.69  104.36    94842     103.58  105.33  103.31  104.65   118553     104.25  104.72   99.10   99.80    51554      98.36   98.99   97.81   98.99    64445      99.65  100.64   99.10   99.94    29986     100.43  101.34   99.62   99.88    37487      97.59  100.78   93.42   98.84    24108      99.58  100.67   96.47   97.76    14959      97.76   97.91   96.15   97.85    108710     99.29   99.85   98.66   98.66     80511     98.12   98.41   95.27   96.29     76412     96.75   97.59   96.54   96.95     85313     98.14   98.21   93.27   95.50     85114     95.05   96.15   94.91   95.96     65115     94.51   94.58   89.68   91.43     44416     91.43   92.96   91.29   91.35     55517     91.81   92.07   91.09   91.81     48818     93.59   95.77   92.71   94.87     51019     94.72   97.32   94.43   96.96     63020     96.50   96.70   95.67   96.30     56521     98.56  102.95   95.44   97.31     70722     98.35   99.30   96.96   97.88     39023     98.16   98.59   92.45   93.53     23924     93.66   94.09   93.08   93.94     29925     92.80   97.65   92.73   95.36     30026     96.04   96.21   94.72   95.66     24727     93.86   95.22   92.37   94.64     30928     94.12   94.85   91.24   92.95     22929     92.38   93.21   88.42   89.13     16930     89.27   89.54   86.88   87.21     13731     87.38   87.61   83.80   84.49     15032     87.32   89.52   86.36   87.87      6833     87.62   88.09   87.19   87.65      5534     86.72   87.96   85.90   87.14      6935     86.94   89.12   86.42   88.72      6036     88.60   89.15   88.19   88.33      4037     88.15   91.93   87.92   91.17      3738     91.60   91.74   90.56   90.73      4739     87.79   88.76   85.63   87.24      5940     86.63   87.83   86.47   86.96      7241     88.29   93.05   88.23   91.27      9042     91.48   92.03   89.24   89.64     10443     89.89   90.34   89.42   89.86     12944     90.36   93.21   89.66   91.49     16245     93.24   94.75   91.91   92.48     12246     90.72   91.58   88.65   89.50     11747     89.85   94.52   89.44   93.85     14748     93.23   93.75   92.31   92.96     18449     92.50   93.26   91.68   93.01     12650     92.36   95.63   91.72   94.81     15851     95.33   98.18   95.05   97.14     16752     96.66   97.42   96.38   96.66     19053     95.94   99.03   94.91   97.73     23854     98.34  102.73   97.46  101.92     29855    102.64  103.35   99.13   99.99     143"""Synthetic (non-realistic) quotesfromrndqtsimportSyntheticprint(Synthetic()[:5].data)"""Open    High     Low   Close  VolumeDate0     112.22  117.64  104.00  111.43   118681     121.24  122.02  100.54  108.78   116892     118.44  124.60  110.35  123.54   122083     129.35  141.99  127.66  136.83   119584     114.05  145.78  102.64  136.04   14673"""Saving as a CSV filefromrndqtsimportRealReal("VALE3.sa").data.to_csv("/tmp/myfile.csv")PlottingfromrndqtsimportRealprint((Real("VALE3.sa").data))# Real("VALE3.sa").plot()"""Fetching VALE3.sa ...[*********************100%***********************]  1 of 1 completed""""""Open       High        Low      Close    VolumeDate2020-12-17  82.771173  84.158663  82.455396  83.440994  213678002020-12-18  83.842888  84.570121  83.661076  84.015129  238431002020-12-21  82.436261  83.632377  81.125317  83.115654  318773002020-12-22  83.115654  83.240048  81.747298  83.192207  231570002020-12-23  82.799879  83.756771  82.675485  83.594101  177102002020-12-28  84.005561  84.761506  83.326168  83.546249  260013002020-12-29  84.177801  84.397882  82.780740  83.316597  197275002020-12-30  83.431427  83.814178  82.914705  83.680214  30102700"""Features (current or planned)Fetch from yahooAutomatic local cachingSlicingPlot candle sticksCacheable and identified by hash idDistinct kinds of quotesRealmarket quotesRealisticrandom, based on real quotesSyntheticentirely based on Gaussian distributions from a pseudo random number generatorgood for software testlazy / infiniteHoldingcombination of real quotes, without randomnessuseful for dataset augmentation with fictional tickersNews fetchinghttps://blog.datahut.co/scraping-nasdaq-news-using-python