प्रोजेक्ट टेम्पलेट·Pro
Python CSV रिपोर्ट
एक स्क्रिप्ट जो बिक्री की CSV को टर्मिनल में सारांश और बार चार्ट वाले HTML पेज में बदलती है: महीने, श्रेणी और प्रोडक्ट के हिसाब से कुल। केवल स्टैंडर्ड लाइब्रेरी, सैंपल डेटा और टेस्ट शामिल। Linux एनवायरनमेंट में Python चाहिए।
इसे इंस्टॉल करने के लिए PocketCode Pro चाहिए।
अगर आपके Android डिवाइस पर PocketCode इंस्टॉल है, तो यह पेज ऐप में खुलेगा।
प्रीव्यू
फ़ाइलें
README.md
data/sales.csv
report.py
tests/__init__.py
tests/test_report.pyREADME.md
# Sales report from a CSV, in Python A script that reads a CSV of sales and gives you two things: a summary in the terminal (revenue, units, median sale, totals per month and per category) and `report.html`, a page with bar charts that works offline. It only uses Python's standard library (csv, decimal, statistics, html): nothing to install with pip. Sample data is included. ## Run it in PocketCode You need the app's Linux environment with Python 3.10 or newer: install it in Settings › Compilers and runtimes, or with the Developer pack in Terminal › Linux. When you tap Run, the first line of the Run panel should say Python 3 (Linux). 1. Open `report.py` and tap Run. The Run panel prints the summary and writes `report.html`. 2. Open `report.html` and tap the globe icon (DevBrowser) at the top of the editor to see the charts. With your own data, from the terminal (Open Terminal Here, in the editor menu): ```sh python3 report.py my-sales.csv -o my-report.html ``` The CSV needs these columns: `date` (YYYY-MM-DD), `product`, `category`, `units`, `unit_price`. A wrong line stops the script and says which line it is. ## Run the tests ```sh python3 -m unittest -v ``` ## Where things are | Path | What it does | |---|---| | `report.py` | Reading the CSV, the totals, the terminal summary and the HTML | | `data/sales.csv` | Sample data: 32 sales over three months | | `tests/test_report.py` | Tests with unittest |यह प्रीव्यू छोटा किया गया है। पूरा कंटेंट इंस्टॉल करने पर मिलेगा।
1.0.0 में बदलाव
पहला संस्करण।