A PyQt5-based GUI application for calculating selling profits across different marketplaces, taking into account various fees, shipping costs, and seller tiers.
├── MarketplaceApp/
├── data/
│ ├── marketplaces/
│ │ ├── ebay.json
│ │ ├── tcgplayer.json
│ │ └── whatnot.json
│ └── shipping/
│ ├── fedex.json
│ ├── ups.json
│ └── usps.json
├── logs/
├── src/
│ ├── models/
│ │ ├── __init__.py
│ │ ├── fee.py
│ │ ├── marketplace.py
│ │ └── shipping.py
│ ├── ui/
│ │ ├── __init__.py
│ │ ├── main_window.py
│ │ ├── marketplace_widget.py
│ │ ├── product_widget.py
│ │ ├── results_widget.py
│ │ └── shipping_widget.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── calculator.py
│ │ ├── config_loader.py
│ │ └── logger.py
│ ├── __init__.py
│ └── main.py
├── tests/
│ ├── __init__.py
│ ├── test_calculator.py
│ ├── test_marketplace.py
│ └── test_shipping.py
├── README.md
└── requirements.txt
-
fee.py
: Defines fee types (percentage, flat, compound) and calculation logicFeeType
: Enum for different fee typesFeeApplication
: Enum for fee application (per item/order)Fee
: Dataclass for fee calculation
-
marketplace.py
: Marketplace and seller tier structuresSellerTier
: Dataclass for seller tier informationMarketplace
: Dataclass for marketplace configuration
-
shipping.py
: Shipping carrier and rate structuresShippingRate
: Dataclass for weight-based ratesShippingService
: Dataclass for shipping service optionsShippingCarrier
: Dataclass for carrier information
main_window.py
: Main application window integrating all componentsmarketplace_widget.py
: Marketplace and seller tier selectionproduct_widget.py
: Product details input (price, quantity, cost)shipping_widget.py
: Shipping carrier and service selectionresults_widget.py
: Displays calculation results and fee breakdown
-
calculator.py
: Core profit calculation logicProfitCalculator
: Handles all fee and profit calculationsProfitCalculationResult
: Dataclass for calculation results
-
config_loader.py
: JSON configuration file handlingConfigLoader
: Static methods for loading marketplace and shipping configs
{
"name": "TCGPlayer",
"tiers": {
"marketplace_seller": {
"name": "Marketplace Seller (Level 1-4 Account)",
"fees": {
"marketplace_commission": {
"type": "percentage",
"value": 10.25,
"application": "per_item"
},
"processing_fee": {
"type": "compound",
"percentage": 2.5,
"flat_fee": 0.30,
"application": "per_order"
}
}
}
}
}
{
"name": "USPS",
"services": {
"first_class": {
"name": "First Class Package",
"weight_limits": {
"min": 0,
"max": 16
},
"rates": [
{
"weight_up_to": 4,
"price": 4.50
},
{
"weight_up_to": 8,
"price": 5.25
}
]
}
}
}
- Install requirements:
pip install -r requirements.txt
-
Create necessary JSON configuration files in
data/marketplaces/
anddata/shipping/
-
Run the application:
python src/main.py
- ✅ Core data models
- ✅ Fee calculation logic
- ✅ GUI components
- ✅ Configuration loading
- ⏳ Test suite (to be implemented)
- ⏳ Error handling dialogs
- ⏳ Input validation
- ⏳ Save/Load functionality for frequent calculations
- Add comprehensive error handling and user feedback
- Implement input validation
- Add save/load functionality for calculations
- Create test suite
- Add support for tax calculations
- Implement bulk calculation features
- Add data export functionality