Skip to main content

Random stock quotes generator based on real data distribution

Project description

test codecov

rndqts

Random stock market quotes

Fetching from Yahoo

from rndqts.quotes import Quotes

print(Quotes("PETR4.sa", progress=False).data)
"""
                 Open       High        Low      Close        Volume
Date                                                                
2000-01-03   4.050103   4.050103   4.050103   4.050103  3.538944e+10
2000-01-04   3.826055   3.826055   3.826055   3.826055  2.886144e+10
2000-01-05   3.787450   3.787450   3.787450   3.787450  4.303360e+10
2000-01-06   3.774351   3.774351   3.774351   3.774351  3.405568e+10
2000-01-07   3.791586   3.791586   3.791586   3.791586  2.091264e+10
...               ...        ...        ...        ...           ...
2021-01-04  28.650000  29.180000  28.530001  28.910000  7.471970e+07
2021-01-05  28.900000  30.180000  28.240000  30.040001  9.518110e+07
2021-01-06  30.160000  30.900000  30.049999  30.100000  9.656250e+07
2021-01-07  30.340000  31.150000  30.340000  31.000000  5.617130e+07
2021-01-08  31.459999  31.760000  30.350000  31.120001  6.713630e+07

[5171 rows x 5 columns]

"""

Random stock quotes

from rndqts.quotes import Quotes

# Caching real quotes from Yahoo.
Quotes("PETR4.sa", progress=False).data
Quotes("VALE3.sa", progress=False).data
Quotes("CSNA3.sa", progress=False).data
Quotes("USIM5.sa", progress=False).data

# Generating random quotes.
random_quotes = Quotes("rnd", seed=42).data.values
print(random_quotes)
"""
[[1.00947569e+00 1.01632731e+00 1.00068496e+00 1.00548117e+00
  3.00000000e+00]
 [1.03308968e+00 1.02043589e+00 1.05266991e+00 1.03492298e+00
  9.00000000e+00]
 [1.04744580e+00 1.03139980e+00 1.06120381e+00 1.03847023e+00
  2.10000000e+01]
 ...
 [4.80039558e+01 4.75309233e+01 4.80039558e+01 4.75395970e+01
  7.81903330e+07]
 [4.67677030e+01 4.73311476e+01 4.65310483e+01 4.65310483e+01
  7.81903350e+07]
 [4.71360374e+01 4.71360374e+01 4.59864740e+01 4.68941008e+01
  5.73796740e+07]]

"""
"""

"""

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

rndqts-0.2101.5.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

rndqts-0.2101.5-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file rndqts-0.2101.5.tar.gz.

File metadata

  • Download URL: rndqts-0.2101.5.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.9.1

File hashes

Hashes for rndqts-0.2101.5.tar.gz
Algorithm Hash digest
SHA256 0eb52536bfb62d231a1f459ea4f2d396bffb560f108ddbdc94530a6d2f4b8488
MD5 799a24f444c202d86181dc5ae250424d
BLAKE2b-256 ea2d71929e4d83d18bf5a4f5d357c059ac8f57d332107842e2cc395fb544672a

See more details on using hashes here.

File details

Details for the file rndqts-0.2101.5-py3-none-any.whl.

File metadata

  • Download URL: rndqts-0.2101.5-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.9.1

File hashes

Hashes for rndqts-0.2101.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8f5e587d371485f02a4d4d4e71410f4b1bae9b2e846b6b567d9230d06dff0482
MD5 0734a4ee26c50f70f88122a949a2bad9
BLAKE2b-256 ad731a2aafe8fa5186876a470ad863fe34db2c152080c38dac10b81d21de6526

See more details on using hashes here.

Supported by

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