Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

PakGov Document Search CLI

A Python command-line tool for searching keywords across Pakistani government documents.

The tool searches multiple .txt documents, returns matching lines with surrounding context, and records searches in a CSV history file.

Features

  • Keyword Search — search across multiple government text documents.
  • Context Display — shows one line before and after each matching result.
  • Search History — records searches with date and time in history.csv.
  • Error Handling — handles invalid queries and missing document folders.
  • Modular Structure — separates document reading, search logic, and custom exceptions.
  • Command-Line Interface — designed to run directly from a terminal.

Technologies

  • Python 3
  • os
  • csv
  • re
  • datetime
  • sys

Concepts Demonstrated

  • File I/O
  • Text processing
  • Regular expressions
  • Command-line arguments
  • CSV data handling
  • Exception handling
  • Modular Python design

Project Structure

Pakgov-search-cli/
│
├── docs/                  # Text documents searched by the tool
├── search.py              # Main search functionality
├── document_reader.py     # Document reading logic
├── exceptions.py          # Custom exceptions
├── history.csv            # Search history
├── .gitignore
├── LICENSE
└── README.md

How It Works

  1. Place searchable .txt documents inside the docs/ directory.
  2. Run the CLI from the project directory.
  3. Enter a keyword to search.
  4. The program scans the available documents.
  5. Matching results are displayed with surrounding context.
  6. The search is recorded in history.csv.

Installation

Clone the repository:

git clone https://github.com/salikhussain71-code/Pakgov-search-cli.git

Enter the project directory:

cd Pakgov-search-cli

Running the Project

Run the main program:

python search.py

Make sure the docs/ directory contains the .txt documents you want to search.

Why This Project

Finding specific information across large collections of government documents can be time-consuming when performed manually.

This project provides a lightweight command-line approach for searching local document collections and displaying relevant context around matches.

License

This project is licensed under the MIT License.

关于 About

Python CLI for fast keyword search across Pakistani government documents, with contextual results, search history, error handling, and modular file processing.
clicommand-linedocument-searchfile-processinggovernment-documentsinformation-retrievalpakistanpythonpython-programmingpython3regular-expressionssearch-enginetext-processingtext-search

语言 Languages

Python100.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
8
Total Commits
峰值: 7次/周
Less
More

核心贡献者 Contributors