Skip to main content

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.

  1. 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.
>>>
  1. 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)
  1. 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.

  1. 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

sales-analysis-0.4.tar.gz (215.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sales_analysis-0.4-py3-none-any.whl (216.8 kB view details)

Uploaded Python 3

File details

Details for the file sales-analysis-0.4.tar.gz.

File metadata

  • Download URL: sales-analysis-0.4.tar.gz
  • Upload date:
  • Size: 215.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for sales-analysis-0.4.tar.gz
Algorithm Hash digest
SHA256 f38b1b623f212181764092f85591d7c0c4f41840737a0ef0a733ac3748d8db56
MD5 4efee8615ac7576ac2b34a4f424ad363
BLAKE2b-256 29f8e248880f5add0f292e7eb6b5a6f207cff0b7eb27341bbfb82366f4764e1b

See more details on using hashes here.

File details

Details for the file sales_analysis-0.4-py3-none-any.whl.

File metadata

  • Download URL: sales_analysis-0.4-py3-none-any.whl
  • Upload date:
  • Size: 216.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for sales_analysis-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 55b761b78067b815814bcb0775e33e18adc6e99d4ffb4e5dbe015b43e2b0a530
MD5 2775d64ca1c216726091f0bc42d23bca
BLAKE2b-256 b3cfbe6052a8f3ae763f67e8350bf58693b5feb171cfd4475c7898a931dcf6d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page