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
pythonto 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-02to 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'
Metadata
Release files for sales-analysis 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sales-analysis-0.4.tar.gz | 215.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sales_analysis-0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 432.2 kB
Release files / sales-analysis-0.4.tar.gz
| Download URL | sales-analysis-0.4.tar.gz |
|---|---|
| Size | 215.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f38b1b623f212181764092f85591d7c0c4f41840737a0ef0a733ac3748d8db56
|
|
BLAKE2b-256 checksum How to use checksums |
29f8e248880f5add0f292e7eb6b5a6f207cff0b7eb27341bbfb82366f4764e1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
|
Release files / sales_analysis-0.4-py3-none-any.whl
| Download URL | sales_analysis-0.4-py3-none-any.whl |
|---|---|
| Size | 216.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55b761b78067b815814bcb0775e33e18adc6e99d4ffb4e5dbe015b43e2b0a530
|
|
BLAKE2b-256 checksum How to use checksums |
b3cfbe6052a8f3ae763f67e8350bf58693b5feb171cfd4475c7898a931dcf6d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
|