A Python package for frontend-related functionality with chart visualization tools
Project description
webengage-frontend
A Python package for frontend-related functionality.
Description
webengage-frontend is a Python package designed to provide frontend-related utilities and tools for WebEngage projects. It includes chart visualization capabilities for creating bar charts from pandas DataFrames.
Installation
From Source
# Clone the repository
git clone https://repo.webengage.com/data-consultancy/data-science-consulting-master-repo.git
cd data-science-consulting-master-repo/webengage-fe
# Install in development mode
pip install -e .
# Or install with development dependencies
pip install -e ".[dev]"
Using pip
pip install webengage-frontend
Requirements
- Python >= 3.8
Development Setup
- Clone the repository:
git clone https://repo.webengage.com/data-consultancy/data-science-consulting-master-repo.git
cd data-science-consulting-master-repo/webengage-fe
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements-dev.txt
- Install the package in development mode:
pip install -e .
Usage
Chart Visualization
Create bar charts from pandas DataFrames:
import pandas as pd
import matplotlib.pyplot as plt
from webengage_frontend import ChartVisualizer
# Create sample DataFrame
df = pd.DataFrame({
'category': ['A', 'B', 'C', 'D'],
'sales': [100, 150, 120, 180],
'profit': [20, 30, 25, 40]
})
# Initialize ChartVisualizer
visualizer = ChartVisualizer(df)
# Create bar chart with single y-axis column
fig = visualizer.bar_chart(
x='category',
y=['sales'],
title='Sales by Category',
xlabel='Category',
ylabel='Sales'
)
plt.show()
# Create bar chart with multiple y-axis columns
fig = visualizer.bar_chart(
x='category',
y=['sales', 'profit'],
title='Sales and Profit by Category',
xlabel='Category',
ylabel='Amount'
)
plt.show()
Development
Running Tests
pytest
Code Formatting
black src/
Linting
flake8 src/
Type Checking
mypy src/
Project Structure
webengage-fe/
├── src/
│ └── webengage_frontend/ # Main package directory
│ ├── __init__.py
│ ├── charts.py # Chart visualization classes
│ └── utils.py # Utility functions
├── tests/ # Test files
│ ├── __init__.py
│ └── test_utils.py
├── setup.py # Setup script
├── pyproject.toml # Modern Python packaging configuration
├── requirements.txt # Production dependencies
├── requirements-dev.txt # Development dependencies
├── MANIFEST.in # Package manifest
├── LICENSE # MIT License
├── .gitignore # Git ignore rules
└── README.md # This file
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Merge Request
License
This project is licensed under the MIT License.
Authors
- WebEngage
Project Status
Active development.
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.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webengage_frontend-0.1.0.tar.gz.
File metadata
- Download URL: webengage_frontend-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6d35bb8fb797343f10b85b9cb9c8cf45034f52c5cc2cc5d5e85471dc3e4d47b
|
|
| MD5 |
152a3fc9f8ebaa686a39bb0e2f2c84ef
|
|
| BLAKE2b-256 |
46827dfe85df597f78feedf88e317f6e44a8fd3ea92f0f43416ca2e29f077db6
|
File details
Details for the file webengage_frontend-0.1.0-py3-none-any.whl.
File metadata
- Download URL: webengage_frontend-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1dd34b59d25dabb5320c13d9f44eedced693a7d6cbba5c002f0038a56aafe94
|
|
| MD5 |
6efa43b37605ac4d0cacbf273f20d374
|
|
| BLAKE2b-256 |
ac7757c1a508a8610712f10661aa07088c0808699c3d10de5c673980e6feee45
|