Logo Lanfrica

ryanhamdaoui/CLI-Mahatati

Domain:

mobility

Record type:

software
Creator:
rya
Host:
A Python CLI tool that lets you search live intercity bus departures in Algeria by city zipcode. Powered by the unofficial Mahatati API from SOGRAL, it supports automatic date selection (today + tomorrow), city-to-code mapping, and displays clean, readable trip info including time, bus name, route, license plate, and price. # ๐ŸšŒ CLI Mahatati **CLI Mahatati** is a simple Python CLI tool for searching **live intercity bus departures in Algeria** using an unofficial **SOGRAL Mahatati API**. You can search by **city ZIP codes or names**, and the tool fetches bus trips for **today and tomorrow**, displaying time, route, license plate, bus name, and price. --- ## โœจ Features - โœ… Fetches live departure data using the Mahatati API - ๐Ÿ—•๏ธ Automatically includes both **today and tomorrowโ€™s** trips - ๐Ÿ” Search by **city ZIP codes** via command-line arguments - ๐Ÿง  Built-in mapping from **city names to full 12-digit codes** - ๐Ÿ“† Clean output with bus time, name, route, license plate, and fare --- ## ๐Ÿ’  Usage ### 1. Using ZIP code arguments ```bash python script.py ``` #### Example: ```bash python script.py 16000 45002 ``` This will search for trips from **Alger** (ZIP: `16000`) to **Mecheria** (ZIP: `45002`). --- ## ๐Ÿ“Ÿ Sample Output ``` Bus 1: Date : Wednesday, 17 April 2025 Time : 10:00:00 License Plate : 000010-424-16 Bus Name : BOUCHENEB NOUREDDINE Route : BECHAR Price : 1160 DZD ---------------------------------------- ``` --- ## ๐Ÿ“† Requirements - Python 3.6+ - `requests` module Install dependencies with: ```bash pip install requests ``` --- ## ๐Ÿฉ City Code Reference City-to-code mappings are based on official ZIP codes. You can expand your internal city dictionary using public resources: - ๐Ÿ“ MapsofWorld - Algeria Postal Codes - ๐Ÿ“ Wikipedia - Liste des codes postaux d'Algรฉrie - ๐Ÿ“ DataHub Postal Codes Dataset Example ZIP mappings used: | City | ZIP Code Fragment | Full Code | |-----------|-------------------|-------------------| | Alger | 16000 | 213-000016000 | | Mecheria | 45002 | 213-000045002 | | Naama | 45000 | 213-000045000 | --- ## ๐Ÿ“„ License This is an **unofficial** project and is not affiliated with **SOGRAL** or the **Mahatati** platform. For personal or educ โ€ฆ

Licenses