All notes

Data & Analytics / PharmaPOS

Pharmacy Management System v2.0

A comprehensive pharmacy management solution built with Python and Tkinter, designed for small to medium-sized pharmacies and medical stores.

October 29, 20255 min readPython1 stars
Open the full technical write-up

A comprehensive pharmacy management solution built with Python and Tkinter, designed for small to medium-sized pharmacies and medical stores.

Pharmacy Management System

What the project includes

Core Functionality

  • Medicine Inventory Management: Add, update, delete, and search medicines
  • Point of Sale System: Complete POS interface for sales transactions
  • Database Management: SQLite database for reliable data storage
  • User-Friendly Interface: Modern, intuitive GUI with professional styling

Advanced workflows

  • Low Stock Alerts: Automatic notifications for medicines running low
  • Expiry Date Tracking: Monitor medicines approaching expiration
  • Sales Analytics: Comprehensive reports and analytics dashboard
  • Category Management: Organize medicines by categories
  • Search & Filter: Advanced search capabilities
  • Sales History: Track all sales transactions
  • Inventory Reports: Generate detailed inventory reports

Reports & Analytics

  • Low Stock Report: Identify medicines needing restocking
  • Expiring Medicines: Track medicines nearing expiration
  • Sales Summary: Revenue and sales statistics
  • Category Distribution: Visual charts of inventory by category
  • Top Selling Medicines: Best-performing products analysis

Quick Start

Prerequisites

  • Python 3.7 or higher (Download here)
  • pip (included with Python)

Windows Installation (One-Click)

  1. Download or clone the repository

    git clone https://github.com/Tuhin-SnapD/PharmaPOS.git
    cd PharmaPOS
    
  2. Double-click pharmacy.bat

    • The script will automatically:
      • Check Python installation
      • Create virtual environment (optional)
      • Install dependencies
      • Start the application

Manual Installation

  1. Clone the repository

    git clone https://github.com/Tuhin-SnapD/PharmaPOS.git
    cd PharmaPOS
    
  2. Create virtual environment

    python mathematics -m venv venv
    
  3. Activate virtual environment

    Windows:

    venv\Scripts\activate
    

    macOS/Linux:

    source venv/bin/activate
    
  4. Install dependencies

    pip install -r requirements.txt
    
  5. Run the application

    python main.py
    

Without Virtual Environment

  1. Install dependencies globally

    pip install matplotlib pandas
    
  2. Run the application

    python main.py
    

Usage

Main Application

  • Medicine Management: Use the main interface to manage your medicine inventory
  • Navigation: Use the menu bar to access different features
  • Search: Use the search functionality to quickly find medicines

Point of Sale

  • Access via Tools > Point of Sale menu
  • Search for medicines by name or category
  • Add items to cart with quantities
  • Process sales transactions
  • Automatic inventory updates

Reports & Analytics

  • Access via Tools > Reports & Analytics menu
  • View low stock alerts
  • Check expiring medicines
  • Analyze sales performance
  • Generate visual charts

Database Schema

The system uses SQLite database with the following tables:

Medicines Table

  • id: Primary key
  • name: Medicine name
  • price: Unit price
  • quantity: Stock quantity
  • category: Medicine category
  • discount: Discount percentage
  • expiry_date: Expiration date
  • supplier: Supplier information
  • created_at: Record creation timestamp
  • updated_at: Last update timestamp

Sales Table

  • id: Primary key
  • medicine_id: Foreign key to medicines
  • quantity_sold: Quantity sold
  • total_amount: Total sale amount
  • sale_date: Sale timestamp

How files are organized

PharmaPOS/
ā”œā”€ā”€ šŸ“ src/                    # Source code
│   ā”œā”€ā”€ pharmacy_app.py       # Main application
│   ā”œā”€ā”€ sales.py              # Point of sale system
│   └── reports.py            # Reports and analytics
ā”œā”€ā”€ šŸ“ scripts/               # Utility scripts
│   └── demo_data.py          # Demo data generator
ā”œā”€ā”€ šŸ“ data/                  # Data storage (auto-created)
│   └── pharmacy.db          # SQLite database (created automatically)
ā”œā”€ā”€ šŸš€ pharmacy.bat          # One-click launcher (Windows)
ā”œā”€ā”€ šŸ“„ main.py               # Main entry point
ā”œā”€ā”€ šŸ“„ requirements.txt      # Python dependencies
└── šŸ“„ README.md             # This file

Technical Details

How the system is built

  • Frontend: Tkinter GUI framework
  • Backend: SQLite database
  • Language: Python 3.7+
  • Design Pattern: Object-oriented programming

Dependencies

  • matplotlib>=3.5.0 - For charts and graphs
  • pandas>=1.3.0 - For data analysis

Key Components

  • pharmacy_app.py: Main application and database management
  • sales.py: Point of sale system
  • reports.py: Reports and analytics
  • requirements.txt: Package dependencies

Improvements from v1.0

Code Quality

  • Refactored from monolithic to modular structure
  • Object-oriented design with proper classes
  • Type hints for better code maintainability
  • Comprehensive error handling

Database

  • Migrated from text files to SQLite database
  • Proper data integrity and relationships
  • ACID compliance for reliable transactions

User Interface

  • Modern, professional design
  • Improved layout and navigation
  • Better user experience
  • Menu bar with organized features

What the project includes

  • Point of Sale system
  • Advanced reporting and analytics
  • Low stock and expiry alerts
  • Visual charts and graphs
  • Enhanced search capabilities

Development

Setting Up Development Environment

  1. Clone the repository

    git clone https://github.com/Tuhin-SnapD/PharmaPOS.git
    cd PharmaPOS
    
  2. Create and activate virtual environment

    python -m venv venv
    venv\Scripts\activate  # Windows
    # or
    source venv/bin/activate  # macOS/Linux
    
  3. Install dependencies

    pip install -r requirements.txt
    
  4. Run the application

    python main.py
    

Adding Demo Data

To populate the database with sample data:

python scripts/demo_data.py

Note: This will clear existing data and create demo medicines and sales records.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Authors

  • Repository: Tuhin-SnapD
  • Original Version: Developed for e-cell KIET Endeavour'21 hackathon
  • Enhanced Version: Improved with modern features and better architecture

Acknowledgments

  • Original development team for the initial concept
  • Python community for excellent libraries
  • Tkinter documentation and examples

Support

For support, please open an issue in the GitHub repository.

Important Notes

  • This system is designed for educational and small business purposes
  • For production use in larger pharmacies, consider additional security measures
  • Always backup your database regularly
  • Keep your Python environment and dependencies updated

Made with for pharmacy management

Related notes

Backend & APIs

MeetingMind

Turn meetings, email, and chat into clear decisions and next actions.

AI/ML & Data Science

AI Lab

A hands-on AI, machine learning, deep learning, computer vision, and data analytics lab built for learners who want practical projects, readable code, and a clear roadmap.

DevOps & Cloud

One-Click Multi-Cloud Provisioner

A comprehensive DevOps automation tool that provisions complete infrastructure on AWS and GCP using Terraform, Ansible, and Python.