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.2.tar.gz (3.9 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.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pricefeed-0.1.2.tar.gz
  • Upload date:
  • Size: 3.9 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.2.tar.gz
Algorithm Hash digest
SHA256 aaff58815178b8e97b600a9a55db6370967ed6c306f2bd08796f0ecf005f7788
MD5 fc8ef307ccd53c35da7c0c7c78174fd1
BLAKE2b-256 311df4074eca010c023ab451879eb30b662110dcc2a4b15ee48f9b668f07188c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pricefeed-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 628424e80763c04052e725bd12ff8da6216b68e892f020cb8ca883cddb5e2c47
MD5 299385abe257d0452beafbeb877aebda
BLAKE2b-256 41ea2dc1d410559feb853b3a19b110855f1302aae7cbc053e2aa4334fdbc6226

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