Skip to main content

A set of classes for simulating various business-related scenarios for educational use

Project description

SimLab: Business Simulation Toolkit

This Python package provides a set of classes for simulating various business-related scenarios. It is designed for educational use, allowing students to experiment with modeling, analysis, and decision-making in different contexts.

Installation

To install SimLab with all features:

pip install sim-lab

For specific interfaces only:

# CLI only
pip install sim-lab[cli]

# Web interface
pip install sim-lab[web]

Features

  • Multiple simulation types for business scenarios
  • Command-line interface (CLI)
  • Terminal user interface (TUI)
  • Web interface with REST API
  • Visualization tools
  • Data import/export

Available Simulations

  • Stock Market Simulation: Simulate stock price fluctuations, incorporate technical indicators, and develop simple trading strategies.
  • Resource Fluctuations Simulation: Model changes in the price of a resource, analyze supply/demand dynamics, and implement hedging strategies.
  • Product Popularity Simulation: Simulate the rise and fall of product demand, investigate virality factors, and examine different marketing strategies.

Usage

Python API

from sim_lab import ResourceFluctuationsSimulation

# Create a resource simulation
sim = ResourceFluctuationsSimulation(
    start_price=100, 
    days=365, 
    volatility=0.05, 
    drift=0.01,
    supply_disruption_day=180, 
    disruption_severity=0.2
)

# Run the simulation and get results
prices = sim.run_simulation()

# Visualize the results
from sim_lab.viz import plot_time_series
plot_time_series(
    data=prices,
    title="Resource Price Fluctuations",
    xlabel="Days",
    ylabel="Price ($)",
    events={180: "Supply Disruption"}
)

Command Line Interface

# Run a stock market simulation
simlab stock run --start-price 100 --days 365 --volatility 0.02 --drift 0.001 --output prices.csv

# Get help for all commands
simlab --help

Terminal UI

# Launch the interactive terminal UI
simlab-tui

Web Interface

# Start the web server
simlab-web

# Then visit http://localhost:8000 in your browser

Project Goals (For Students)

  • Gain familiarity with using simulations to model dynamic systems
  • Understand the impact of different parameters on simulation outcomes
  • Develop data analysis and visualization skills in the context of business problems
  • Practice translating business concepts into simulation parameters

Documentation

For more detailed information about using SimLab, see the documentation.

Development

SimLab uses modern Python development tools:

  • uv for dependency management
  • Ruff for linting and formatting
  • pytest for testing
  • MkDocs for documentation

To setup a development environment:

# Clone the repository
git clone https://github.com/teaching-repositories/sim-lab.git
cd sim-lab

# Run the setup script
./scripts/setup_dev.sh

# Or manually
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e .[dev]

See DEVELOPMENT.md for more details.

Contributing

We welcome contributions to the SimLab project! See the Contributing Guide for more details.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

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

sim_lab-0.3.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

sim_lab-0.3.0-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file sim_lab-0.3.0.tar.gz.

File metadata

  • Download URL: sim_lab-0.3.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for sim_lab-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0142efdec21320b33b1eb910caef094173f650ae2229b36da7c8e9fe7b1e1648
MD5 6fa47cf8c30fb609f33263ed31f2d9c6
BLAKE2b-256 a730b9db8612ed392c12c5880dd33aa7ce925c99ac3ad0afafdc08940da8349b

See more details on using hashes here.

File details

Details for the file sim_lab-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: sim_lab-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for sim_lab-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1297f3285f090f9b7b9b60ad596b0980a07c7cdc94f50edbd577481084dfeff2
MD5 a17e417685d40996ff43ee89e900dba3
BLAKE2b-256 435c26924068b1af3449b38c23c27ddddde432752e43f6130c090a2c0286e64b

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