Spaces:
No application file
No application file
Commit ·
f07e050
1
Parent(s): 3792e80
Add cli file - initial commit
Browse files
cli.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import nhtsa_api_call
|
| 2 |
+
|
| 3 |
+
def main():
|
| 4 |
+
print("🚗 Welcome to the Car Dealership VIN Lookup!\n")
|
| 5 |
+
keep_searching = True
|
| 6 |
+
while keep_searching:
|
| 7 |
+
vin = input("Please enter a valid VIN or 0 (zero) to exit: \n").strip()
|
| 8 |
+
year, make, model = nhtsa_api_call.get_vehicle_info(vin)
|
| 9 |
+
if year and make and model:
|
| 10 |
+
print(f"✅ VIN {vin}")
|
| 11 |
+
print(f" Year: {year}")
|
| 12 |
+
print(f" Make: {make}")
|
| 13 |
+
print(f" Model: {model}")
|
| 14 |
+
keep_searching = True
|
| 15 |
+
elif vin == "0":
|
| 16 |
+
keep_searching = False
|
| 17 |
+
break
|
| 18 |
+
else:
|
| 19 |
+
print(f"❌ VIN {vin} not found in database. Try again.")
|
| 20 |
+
keep_searching = True
|
| 21 |
+
|
| 22 |
+
if __name__ == "__main__":
|
| 23 |
+
main()
|