Skip to main content

Add your description here

Project description

rs_trader

from rs_trader import Exchange
from rs_trader.interfaces import DatabaseInterface
from rs_trader.storage import JsonDatabase
from rs_trader.structs import Order, OrderStatus, OrderType

# Initialize the database and exchange
database = JsonDatabase()
exchange = Exchange(database=database)

# Place a buy order
buy_order = Order(user_id=1, item_id=1001, order_type=OrderType.BUY, quantity=10, price=150)
exchange.place_order(buy_order)

# Place a sell order
sell_order = Order(user_id=2, item_id=1001, order_type=OrderType.SELL, quantity=5, price=140)
exchange.place_order(sell_order)

#TODO: this will probably move to exchange.get_orders()
orders = database.get_orders()
print(orders)

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

rs_trader-0.1.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

rs_trader-0.1.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rs_trader-0.1.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rs_trader-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f18beeaf24659e1b8903f274d78fd6019afc2b9c31790f7637c02ab8d5175eb3
MD5 4541221090d3149c7097bba51360d03f
BLAKE2b-256 dd77e686ee07bbda9d09508606a96d71b501746cf654eb4fae13b8a41186e2c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for rs_trader-0.1.1.tar.gz:

Publisher: python-package.yml on extreme4all/rs_trader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: rs_trader-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rs_trader-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d381804e36cc2ec3187289602fdee3f8574616bafc2b3771d9ed89bb521d0b1
MD5 14a21b255770074058e0a356bebaa960
BLAKE2b-256 e3247c2a60a81532d5ea1bf42e8f52a80576910e47a93cc5474978041b5d6978

See more details on using hashes here.

Provenance

The following attestation bundles were made for rs_trader-0.1.1-py3-none-any.whl:

Publisher: python-package.yml on extreme4all/rs_trader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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