A Python client for checking parcel fraud history for Bangladesh.
- 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.
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 .
from fraud_checker import ParcelFraudChecker
client = ParcelFraudChecker()
history = client.check_parcel_history("01712345678")
print(history)
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"
)
Initialize the API client.
request_timeout
: Timeout for API requests in seconds (default: 10.0).
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 a Bangladeshi mobile number.
mobile_number
: The number to validate.- Returns:
True
if valid,False
otherwise.
Represents the parcel history data.
user_name
: The name associated with the mobile number (if available).courier_data
: A list ofParcelData
objects.source
: The source of the data.
Represents a single parcel entry.
label
: The courier service name (e.g., "pathao").order
: The number of orders.cancel
: The number of cancellations.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Thanks to LLCG for providing the API.
- Inspired by the need for a simple and reliable way to check parcel fraud history.
For questions, issues, or feature requests, please open an issue on GitHub.