Skip to main content

A Python client for checking parcel fraud history for Bangladesh.

Project description

Fraud Checker

A Python client for checking parcel fraud history for Bangladesh.


Table of Contents


Features

  • Validate Bangladeshi Mobile Numbers: Ensure the mobile number is in the correct format.
  • Check Parcel History: Retrieve parcel history for a given mobile number.
  • Error Handling: Properly handles invalid inputs and API errors.
  • Randomized Headers: Mimics browser behavior to avoid detection.

Installation

You can install the fraud_checker package via pip:

pip install fraud_checker

Alternatively, you can install it directly from the source:

git clone https://github.com/Almas-Ali/fraud_checker.git
cd fraud_checker
pip install .

Usage

Basic Example

from fraud_checker import ParcelFraudChecker

client = ParcelFraudChecker()
history = client.check_parcel_history("01712345678")
print(history)

Example Output

ParcelHistory(
    user_name=None,
    courier_data=[
        ParcelData(label='pathao', order=0, cancel=0),
        ParcelData(label='steadfast', order=0, cancel=0),
        ParcelData(label='redx', order=0, cancel=0),
        ParcelData(label='paperfly', order=0, cancel=0)
    ],
    source="1"
)

API Reference

ParcelFraudChecker

__init__(self, ..., request_timeout: float = 10.0)

Initialize the API client.

  • request_timeout: Timeout for API requests in seconds (default: 10.0).

check_parcel_history(self, mobile_number: str) -> ParcelHistory

Retrieve parcel history for a mobile number.

  • mobile_number: A valid Bangladeshi mobile number (11 digits).
  • Returns: A ParcelHistory object containing the parcel history data.
  • Raises:
    • InvalidMobileNumberError: If the mobile number format is invalid.
    • APIError: If the API request fails.

validate_mobile_number(self, mobile_number: str) -> bool

Validate a Bangladeshi mobile number.

  • mobile_number: The number to validate.
  • Returns: True if valid, False otherwise.

Models

ParcelHistory

Represents the parcel history data.

  • user_name: The name associated with the mobile number (if available).
  • courier_data: A list of ParcelData objects.
  • source: The source of the data.

ParcelData

Represents a single parcel entry.

  • label: The courier service name (e.g., "pathao").
  • order: The number of orders.
  • cancel: The number of cancellations.

Contributing

Contributions are welcome! Please follow these steps:

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

License

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


Acknowledgments

  • Thanks to LLCG for providing the API.
  • Inspired by the need for a simple and reliable way to check parcel fraud history.

Support

For questions, issues, or feature requests, please open an issue on GitHub.

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

fraud_checker-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

fraud_checker-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file fraud_checker-0.1.0.tar.gz.

File metadata

  • Download URL: fraud_checker-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for fraud_checker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f6e24966484b33d955e98db70a6323207c15e383304c234da40418a8a8bd550a
MD5 575c8b904b4070aa5c92a4b2eb4876f0
BLAKE2b-256 32fa964bda0d05034438bedf64d59ffcf9cd9b1a10605d7a2521c9b2a4bc394e

See more details on using hashes here.

File details

Details for the file fraud_checker-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fraud_checker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for fraud_checker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95131da98b559e0a99012c0491bcf1fd2a8ca8d71850fefb9424b2bce5b3f44d
MD5 71f8dd5d19c8aba31a8a0915ea146a4e
BLAKE2b-256 86a5d29fbb429c78b250aa4bc680c0136674c22e8a6e897549d9de5ea1718adc

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