How to import and use external python APIS and packages

I want to import and use py-authorize an API for payment gateway
For example:

import py-authorize

but don’t know how to use it. How such API’s or python packages could be used in ERPNext development or customization?


The specific part of your question:
Add py-authorize to requirements.txt of what ever app you’re working in.
Then run bench update -- requirements to add py-authorize to the bench’s virtual environment.

The general part of your question:
The API piece is a little more complicated and there are lots of ways to do it. If the API action is associated with a human-initiated document, you probably don’t need anything else (I’m assuming that py-authorize has a library for making http requests as a dependency like requests or urllib). If you want a design that polls for information on’s server, you should leverage the scheduler and long worker queues. If you can give more background on your design , we can point you in a better direction.


@tmatteson thanks a lot. I will try it