Optimizing the payment process of e-commerce
Project description
Ecommerce Payment Optimizer
The Payment Optimizer package provides tools for analyzing and optimizing payment methods in e-commerce to maximize revenue generation. It includes A/B testing capabilities using t-tests to compare different payment options' effectiveness.
Features
- A/B testing (t-test) functionality to evaluate the performance of different payment methods.
- Analysis tools to understand which payment options are more beneficial for e-commerce revenue.
- Integration with Power BI for visualization of test results through a dashboard.
- API for managing user registration, updating user information, adding transactions, and more.
Subpackages
The payment_optimizer package consists of three essential subpackages:
- db: This subpackage facilitates various database operations, including generating fake data, writing data to CSV files, creating schemas, and generating the e_commerce.db file. Additionally, it provides functionalities for populating tables with generated data. The sql_interactions.py module serves as a bridge between SQL and Python, enabling seamless interactions between the two.
- models: In this subpackage, the necessary data is prepared, model metrics are created, and A/B testing is conducted for three payment options: only pre-payment is available, both pre and post-payment are available, and only post-payment is available. The results of the model are stored in a dictionary for further use.
- api: The API serves as the backend for the PayOpt application, providing endpoints for user authentication, product search, and additional functionalities for users with granted access and special permissions. It includes features such as user login, product search based on various criteria (product name, brand, price), and routers for handling endpoints specific to granted users and authentication requirements.
Required Inputs
To utilize the package effectively, ensure that the schema adheres to the following format:
Installation
You can install Payment Optimizer using pip:
pip install pay_opt
Usage
Below is a basic example demonstrating how to utilize certain functions from the package:
from pay_opt.models import ABTesting
ab_test = ABTesting(data_connect)
ab_test.preprocess_data()
model_result = ab_test.perform_ab_test(start_date, end_date)
API Calls
Default Endpoints
- Root Endpoint: http://localhost:8000/
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Power BI Report: http://localhost:8000/
- Product Search: http://localhost:8000/search
Denied View Endpoints
- GET User Transactions: http://localhost:8000/mytransactions
- PUT Update Transaction: http://localhost:8000/mytransactions/update
- POST Create Transaction: http://localhost:8000/transactions/new
Granted View Endpoints
- GET Users: http://localhost:8000/users
- POST Create User: http://localhost:8000/user/create
- PUT Update User: http://localhost:8000/user/update
- GET Ratings: http://localhost:8000/ratings
- POST Create Rating: http://localhost:8000/rating/create
- PUT Update Rating: http://localhost:8000/rating/update
- GET Payment Methods: http://localhost:8000/payment_methods
- POST Create Payment Method: http://localhost:8000/payment_method/create
- PUT Update Payment Method: http://localhost:8000/payment_method/update
- GET Transactions: http://localhost:8000/transactions
- POST Create Transaction: http://localhost:8000/transaction/create
- PUT Update Transaction: http://localhost:8000/transaction/update
- GET Products: http://localhost:8000/products
- POST Create Product: http://localhost:8000/product/create
- PUT Update Product: http://localhost:8000/product/update
- GET Transaction Products: http://localhost:8000/transaction_products
- POST Create Transaction Product: http://localhost:8000/transaction_product/create
- PUT Update Transaction Product: http://localhost:8000/transaction_product/update
Documentation
For detailed documentation and usage examples, refer to the official documentation. Link to our Project in PyPi: PyPi package:
License
Payment Optimizer is distributed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.