davidpeckham / vpic-api

Python client library for decoding VINs and querying the NHTSA Vehicle Product Information Catalog (vPIC) API
MIT License
7 stars 2 forks source link

Batch decoding function #9

Open JL-71 opened 4 months ago

JL-71 commented 4 months ago

Hi David,

Thanks for the vpic package! My team is really interested in applying it to one of our projects, and it worked fine for us to decode a single vehicle. But when we tried to use the decode_vin_batch function for batch decoding, we got a Json decode error (Expecting value: line 1 column 1 (char 0)). I saw you had similar failures under Actions. Just wanted to see if that is the same error we've experienced, and if so, do you have a plan to fix it.

In addition, from your notes it looks like the batch decoding feature only works for 50 VINS at a time. Is there an alternative to do more than that without using a loop?

Many thanks!

davidpeckham commented 4 months ago

Hi,

@sshane reported this issue (#8) submitted a pull request that fixes the batch query parsing error. I merged his pull request, but an unrelated dependency problem is breaking the build. I haven't had time to look into it yet.

For your projects, do you need basic vehicle information like manufacturer, make, model, model year, series, and trim. Or do you need to know more about the vehicle (engine, restraints, ...)?

JL-71 commented 4 months ago

Got it! Thanks for the quick reply!

For our project we would need at least the vehicle type in addition to the basic information. Is this something doable with the current module available?

davidpeckham commented 4 months ago

You may want to consider https://github.com/davidpeckham/vin instead. It decodes basic vehicle information, including vehicle type, and is very fast. It supports passenger cars, light trucks, and multipurpose passenger vehicles.

JL-71 commented 4 months ago

Does it include a batch decoding function? I can't seem to find it. And we would also need it for heavy trucks.

davidpeckham commented 4 months ago

It decodes one VIN at a time, and can decode hundreds of VINs per second. You could easily write a function to call it with a list of VINs.

Is there something about your use case that makes this impractical?

I'm willing to add heavy trucks.

JL-71 commented 4 months ago

I see! No nothing makes this impractical as far as I know, but just checked if you already had some built-in function for that.

Would it cost you too much time to add all possible vehicle types? I can't tell all of the types we have off the top of my head (there could be changes too), so it would be most useful if we can just give a VIN and it can spit out whatever type it is. If it doesn't work this way, then never mind.

Thank you!