Unfortunately, the built-in barcode recognizing of Pixy2 is very specific, and it cannot be used for recognizing of any standart barcodes when it is used with Arduino.
Also, Python cannot be used on most Arduino boards because of the lack of resources.
There are many other ways how you can solve it.
!) if your object with barcode always placed and oriented +/- the same way - you may use Arduino with "usual" barcode scanner. (USB or UART/RS232 model)
2)If the position of the barcode is not fixed - I would propose to use a more powerful board (like Raspberry PI) and "usual" camera for recognizing. There a lot of the uncertain moments, so it needs deeper discussion. In that case, you may use your Pixy2 camera, but it is overkill because it will be used as standard source of the image.
There are also many other ways thow it can be solved.
Please feel free to contact me in chat.
My bid and timeline is approximate because project needs a discussion.
I have made more than 200 Arduino-based projects on different freelance stocks.
I work with Arduino since 2010 and have more than 25 years of experience in programming and electronics.