A sales analysis package for an imaginary e-shop
Project description
sales_analysis: web application to view sales data
What is it?
sales_analysis is a lightweight tool for viewig sales data in web browser. Note: The input data must be in the same format, as the .csv
files in sales_analysis/data_pipeline/data
Where to get it?
The package can be installed by running
pip install sales_analysis
Dependancies
License
BSD 3
How to run the app
After successfully installing sales_analysis
. The app may be run without any modification to sales_analysis/data_pipeline/data
. However, this will execute the sample data provided. In order to change the default behaviour, the data in sales_analysis/data_pipeline/data
must be replaced with new data. Note: It is imperative that this folder contains data formatted in the same way as provided.
Once the data has been imported, then follow the steps below.
- Open a terminal and enter
python
to launch an interactive python session.
> python
Python 3.7.7 (default, Mar 23 2020, 16:19:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
- Then enter the following
>>> from sales_analysis import sales_app
>>> app.run()
This will output the following.
* Serving Flask app "sales_analysis" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
- Then copy and paste
http://127.0.0.1:5000/
into a browser. The default page will return the message below
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
- Add a valid date to the url. For example, add
2019-08-02
to the url i.e.http://127.0.0.1:5000/2019-08-02
. This will output the following in the browser.
{"customers":10.0,
"discount_rate_avg":0.12950211356271726,
"items":3082.0,
"order_total_avg":1341449.559055637,
"total_discount_amount":20061245.64408109}
If an incorrectly formatted date is passed, the server will raise an error. For example, if 2019-08
is passed, the following error is raised.
ValueError: time data '2019-08' does not match format '%Y-%m-%d'
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
Built Distribution
Hashes for sales_analysis-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 647f6de5617c942f0f0fe03b8cfdc7e138ab9c278b20ff14ca7c63789a364fc4 |
|
MD5 | 30d6b3f658fe68784d7c6a9ff418836f |
|
BLAKE2b-256 | 1fcc08f0ac687f6b5c9babccd987efe7c96ecb7e3cb2c4d3c95b270c00f24010 |