Skip to main content

A Python package for those who hustle. Because sometimes you just need to ship it.

Project description

entrepreneurship

A Python package for simulating how businesses run. Model companies, hire employees, launch products, and simulate looping businesses like a coffee shop.

Installation

pip install entrepreneurship

Quick Start

from entrepreneurship import CoffeeShop

shop = CoffeeShop("Beans & Dreams")

for report in shop.run(days=30):
    print(report.summary())

print(shop.final_report())

The Idea: A Business as a Loop

A business is a program stuck in a loop — intentionally.

customers arrive → orders taken → coffee made → served → money collected → repeat

Each day is one iteration. The loop runs until you close the shop or run out of cash.


Coffee Shop Simulation

CoffeeShop

The main simulation class. Each call to open_day() runs one iteration of the business loop.

from entrepreneurship import CoffeeShop

shop = CoffeeShop(
    name="Beans & Dreams",
    cash=10_000,            # starting cash
    daily_rent=200,         # fixed cost per day
    daily_staff_cost=300,   # fixed cost per day
    avg_customers_per_day=40,
)

Methods

Method Description
open_day() Simulate one business day. Returns a DayReport.
run(days) Run the loop for N days. Returns a list of DayReport.
is_open() Returns True if the shop is still running (has cash).
close() Manually close the shop.
final_report() Print a summary of the entire run.

Manual loop example

shop = CoffeeShop("The Daily Grind")

while shop.is_open():
    report = shop.open_day()
    print(report.summary())
    if report.daily_profit < -500:
        print("Bad day. Closing early.")
        shop.close()

DayReport

Returned by open_day(). Contains everything that happened in a day.

report = shop.open_day()

report.day            # day number
report.customers      # how many customers came in
report.orders         # list of Order objects
report.daily_revenue  # total sales
report.daily_costs    # rent + staff + ingredients
report.daily_profit   # revenue - costs
report.cash           # cash on hand after this day

print(report.summary())
# Day 1
#   Customers : 43
#   Revenue   : $241.50
#   Costs     : $543.20
#   Profit    : $-301.70
#   Cash      : $9,698.30

MenuItem

A drink on the menu. Price scales with size.

from entrepreneurship import MenuItem, DrinkSize

latte = MenuItem(name="Latte", base_price=4.50, cost_to_make=1.20)

latte.price(DrinkSize.SMALL)   # 4.50
latte.price(DrinkSize.MEDIUM)  # 5.85
latte.price(DrinkSize.LARGE)   # 7.20

Custom menu example

from entrepreneurship import CoffeeShop, MenuItem

menu = [
    MenuItem("Drip Coffee",  base_price=2.50, cost_to_make=0.30),
    MenuItem("Cortado",      base_price=4.00, cost_to_make=0.90),
    MenuItem("Chai Latte",   base_price=5.00, cost_to_make=1.40),
]

shop = CoffeeShop("Third Wave", menu=menu)

DrinkSize

from entrepreneurship import DrinkSize

DrinkSize.SMALL   # 1.0x base price
DrinkSize.MEDIUM  # 1.3x base price
DrinkSize.LARGE   # 1.6x base price

Order

Represents one customer order.

order.customer_name  # "Alice"
order.item           # MenuItem
order.size           # DrinkSize
order.total          # price charged
order.profit         # total - cost_to_make

print(order)
# Alice: Large Latte ($7.20)

Company Simulation

For modeling a general business with employees and products.

Company

from entrepreneurship import Company, Employee, Product, Department

acme = Company("Acme Corp", cash=500_000)

Methods

Method Description
hire(employee) Add an employee. Adds their salary to expenses.
launch_product(product) Add a product and mark it as launched.
make_sale(product, quantity) Record a sale. Adds revenue and cash.
pay_salaries() Deduct all employee salaries from cash.
raise_funding(amount, investor) Add cash from an investor.
runway() How many months of cash remain at current burn rate.
status_report() Print a full snapshot of the company.
is_profitable() Returns True if revenue > expenses.

Example

from entrepreneurship import Company, Employee, Product, Department, ProductStatus

acme = Company("Acme Corp", cash=500_000)

alice = Employee("Alice", role="CTO", department=Department.ENGINEERING, salary=120_000)
acme.hire(alice)

widget = Product("Widget Pro", price=99.99)
acme.launch_product(widget)

acme.make_sale(widget, quantity=100)
acme.pay_salaries()

print(acme.status_report())

Employee

employee = Employee(
    name="Bob",
    role="Sales Lead",
    department=Department.SALES,
    salary=80_000,
)

employee.work()           # "Bob (Sales Lead) is getting things done."
employee.give_raise(5000) # "Bob got a $5,000 raise. Now earning $85,000."
employee.fire()           # "Bob has been let go. Godspeed."

Product

from entrepreneurship import Product, ProductStatus

widget = Product("Widget Pro", price=99.99)

widget.launch()     # "Widget Pro is live!"
widget.deprecate()  # "Widget Pro has been sunset. It had a good run."
widget.status       # ProductStatus.DEPRECATED

Department

Department.ENGINEERING
Department.SALES
Department.MARKETING
Department.HR
Department.FINANCE

Utility Functions

from entrepreneurship import hustle, pivot, done

hustle("build a two-sided marketplace")
# "Executing: build a two-sided marketplace"

pivot("nobody wants two sides")
# "Pivoting because: nobody wants two sides"

done()
# "Shipped."

License

MIT

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

entrepreneurship-0.3.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

entrepreneurship-0.3.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file entrepreneurship-0.3.1.tar.gz.

File metadata

  • Download URL: entrepreneurship-0.3.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for entrepreneurship-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8aa3c328bbbe4abfc92dbd68db8b9a3b465b7554d73c1f5aa905429f4e0c8f1f
MD5 51fd7c749dfd6dce6d1fb9612636313f
BLAKE2b-256 3e210e136ab810652af9df1341408248e8f31f0deec8031ae1a3ed4f3f2fe872

See more details on using hashes here.

File details

Details for the file entrepreneurship-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for entrepreneurship-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 771fd79cd3c3bbc91ef40890273844cc89f84998812f2c62be829fb06e7a2078
MD5 071394798b7a3541f2b626b54c96325f
BLAKE2b-256 7752e063309f2d2ef7dc677a923e008329624bfb5b6b6d156435a89c2493adc7

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