
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
async-stripe
Advanced tools
An asynchronous wrapper around Stripe's official python library.
async-stripe monkey-patches the stripe library and replaces the synchronous http request methods with asynchronous methods.
Monkey-patching allows us to avoid a complete rewrite and keep the usage api similar to the official library.
This doesn't use threads, but actual async coroutines and non-blocking http client to make requests. Hence, the performance is much better than other wrapper libraries which use threading.
Install requires Python 3.6 or newer.
$ pip install async-stripe
The usage api is similar to Stripe's official library:
from async_stripe import stripe
stripe.api_key = '<stripe-secret-key>'
payment_intent = await stripe.PaymentIntent.create(amount=1000, currency='usd')
print(payment_intent.id)
/!\ Note: Since this library monkey-patches the actual stripe library,
you should avoid using the two in the same process.
Once you import async_stripe, the official stripe library gets patched with
async methods and the original synchronous api won't be available.
Please see stripe-python's README file for configuring logging and other things.
async-stripe aims to be a drop-in async replacement for stripe. However,
there are a few things which are not yet supported:
AsyncHTTPClient will be used by default.When adding new features and monkey-patches, please add relevant tests and ensure that all the tests also pass.
In most cases, you shouldn't need to write the tests yourself: you can just copy-paste the tests form the original stripe library and change the synchronous methods to asynchronous methods.
For testing, first, install and run the stripe-mock api server.
Next, install pytest, pytest-mock and pytest-asyncio python packages in
your virtualenv.
Finally, run the tests like this:
$ pytest tests
# or run a specific test
$ pytest tests/api_resources/test_customer.py
$ pytest tests/api_resources/test_customer.py::TestCustomer
A lot of the code (especially tests) are copied with slight modifications from Stripe's official library. That code is licensed under MIT License.
Rest of the original code is licensed under BSD-3-Clause License.
FAQs
An asynchronous wrapper around Stripe's official python library.
We found that async-stripe demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.