{"library":"pyscard","title":"pyscard - Smartcard module for Python","description":"pyscard is a Python library for smart card communication using PC/SC API. It provides high-level wrappers for reading/writing to smart cards, monitoring card insertion/removal, and sending APDUs. Version 2.3.1 (October 2025) supports Python >=3.9 and SWIG 4.4. Active development with monthly releases.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pyscard"],"cli":null},"imports":["from smartcard.CardRequest import CardRequest","from smartcard.CardConnection import CardConnection","from smartcard.scard import SCardGetErrorMessage"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import smartcard.util\nfrom smartcard.CardRequest import CardRequest\nfrom smartcard.CardConnection import CardConnection\n\ndef get_atr():\n    request = CardRequest(timeout=5)\n    card_service = request.waitforcard()\n    card_service.connection.connect()\n    atr = card_service.connection.getATR()\n    print('ATR:', smartcard.util.toHexString(atr))\n    card_service.connection.disconnect()\n\nif __name__ == '__main__':\n    get_atr()","lang":"python","description":"Wait up to 5 seconds for a smart card, connect, retrieve and print the ATR.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}