Metadata-Version: 2.4
Name: entrepreneurship
Version: 0.3.1
Summary: A Python package for those who hustle. Because sometimes you just need to ship it.
Project-URL: Homepage, https://github.com/jonbesga/entreprenership
License: MIT
Keywords: entrepreneurship,hustle,startup
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# entrepreneurship

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

## Installation

```bash
pip install entrepreneurship
```

---

## Quick Start

```python
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.

```python
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**

```python
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.

```python
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.

```python
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**

```python
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`

```python
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.

```python
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`

```python
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**

```python
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`

```python
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`

```python
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`

```python
Department.ENGINEERING
Department.SALES
Department.MARKETING
Department.HR
Department.FINANCE
```

---

## Utility Functions

```python
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
