Skip to main content

A generic pricefeed generator with configurable deliveries and statistical info on prices generated.

Project description

PriceFeed

This is a generator for random price feeds that can be used to generate a new price at will or at predefined time intervals. The PriceFeed object will also maintain statistics on all the prices that it generated.

A typical use-case is in a development environment where you would like to mimic a pricefeed.

You can install the package via PyPI or from source.

Install from PyPI

pip install pricefeed

Install from Source (GitHub)

git clone https://github.com/smart-t/pricefeed.git
cd pricefeed
pip install .

Example: How to use this package

import pricefeed as pf

AAPL_ticker = pf.Pricefeed("AAPL", 235.0, 500, 0.001)
for i in range(10):
  print(f"{i} : {next(AAPL_ticker)}")

The above script will generate a new price every 500 miliseconds and completes a list with 10 simulated 'AAPL' stock prices starting at $235.0. The 4th argument is used to indicate how volatile the stock movement will be.

The generated prices are designed to stay relatively close to the given start price.

The third and fourth properties (delay and vol) are optional, and if not provided they default to 1000ms (1sec) and a volatility of 0.01.

Contributions

This is an opensource project where you are invited to contribute and help evolve the pricefeed as we go.

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

pricefeed-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

pricefeed-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file pricefeed-0.1.1.tar.gz.

File metadata

  • Download URL: pricefeed-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pricefeed-0.1.1.tar.gz
Algorithm Hash digest
SHA256 06cd0c038ddce61797e9e3c302945343fc7a11f31186a3b69485be620d2b2bb9
MD5 9b1acf78b64b664198f0c7004f526cb4
BLAKE2b-256 4ea4678960ff0eb69b3ae99fae61f56d6d837aae1870768c8775c5fee66a4a49

See more details on using hashes here.

File details

Details for the file pricefeed-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pricefeed-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pricefeed-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58cfd1b5817b4745375e1e9ebf04791c91091f93aa8470cd02fecd20b8042d16
MD5 1e07d395bd3054fd73e6f8ef55652fca
BLAKE2b-256 509938fb7e916a3aa17a0b6423e21907dcb2920d901de430afbf0e4689e68e77

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