pyscard
Smartcard module for Python.
What it is and what it does
pyscard is a Python library that bridges your application to smartcard readers and the cards themselves. It provides both high-level and low-level APIs for reading card data, executing commands, and managing authentication workflows. The library wraps the underlying platform smartcard infrastructure and exposes it through Python, so you can enumerate readers, establish connections, and send commands without dealing directly with system-level card interfaces.
The package is production-stable and actively maintained, supporting Python 3.9 through 3.13 with prebuilt wheels for Windows, macOS, and Unix. Its single runtime dependency is typing_extensions, keeping the footprint minimal. It's useful for applications that need to interact with government ID cards, payment cards, security tokens, or other smartcards.
Use it for:
- Read and verify data from government-issued ID cards or passports in identity verification workflows.
- Implement smartcard-based authentication for secure access control or two-factor authentication systems.
- Build payment or banking applications that interact with credit or debit cards.
- Develop security token management tools that communicate with hardware security modules.
- Create diagnostic or testing utilities for smartcard reader hardware and card compatibility validation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pyscard provides Python bindings to interact with smartcard readers and cards, enabling applications to read, write, and authenticate using physical smartcards.
Yes, if you need to interact with smartcards. The library is production-stable, actively maintained, has no known vulnerabilities, and supports modern Python versions. Install friction is moderate due to platform-specific dependencies, but prebuilt wheels are available. The copyleft license (LGPLv2+) is standard for this domain and poses no barrier for most use cases.
Install
pyscard on PyPI
pip
pip install pyscarduv
uv add pyscardpoetry
poetry add pyscardInstalling pyscard
Before you install
Medium install friction due to platform-specific wheels and compiled dependencies; however, prebuilt wheels are available for Windows, macOS, and Unix across Python 3.9–3.13, reducing build complexity. The package is actively maintained with a recent release.
License in practice
Licensed under LGPLv2+, a copyleft license requiring derivative works to be distributed under compatible terms; acceptable for most applications but review required if you plan to distribute proprietary modifications.
Quickstart
pip install pyscard
import pyscard
# Use pyscard to enumerate and connect to smartcard readers
# See https://pyscard.sourceforge.io/pyscard-framework.html#framework-samples
Requires a smartcard reader device connected to the system; the underlying smartcard subsystem must be installed and running on your platform.
Verify before relying
- Whether the package supports NFC/contactless cards or only contact-based smartcards.
- Performance characteristics and latency for high-frequency card operations.
- Compatibility with specific smartcard standards and card types beyond general support.
- Exact API surface and available methods for card communication and data access.
Package facts
| License | not declared (copyleft) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — typing_extensions |
| Maintenance | actively maintained — 289 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 84,358/month — #14,003 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyscard-2.3.1-cp310-cp310-macosx_10_9_universal2.whl; pyscard-2.3.1-cp310-cp310-win32.whl; pyscard-2.3.1-cp310-cp310-win_amd64.whl; pyscard-2.3.1-cp311-cp311-macosx_10_9_universal2.whl; pyscard-2.3.1-cp311-cp311-win32.whl; pyscard-2.3.1-cp311-cp311-win_amd64.whl; pyscard-2.3.1-cp311-cp311-win_arm64.whl; pyscard-2.3.1-cp312-cp312-macosx_10_13_universal2.whl; pyscard-2.3.1-cp312-cp312-macosx_15_0_x86_64.whl; pyscard-2.3.1-cp312-cp312-win32.whl; pyscard-2.3.1-cp312-cp312-win_amd64.whl; pyscard-2.3.1-cp312-cp312-win_arm64.whl; pyscard-2.3.1-cp313-cp313-macosx_10_13_universal2.whl; pyscard-2.3.1-cp313-cp313-macosx_15_0_x86_64.whl; pyscard-2.3.1-cp313-cp313-win32.whl; pyscard-2.3.1-cp313-cp313-win_amd64.whl; pyscard-2.3.1-cp313-cp313-win_arm64.whl; pyscard-2.3.1-cp39-cp39-macosx_10_9_universal2.whl
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
PyKCS11PyKCS11 provides a Python wrapper around the…
copyleft · top 15,000 on PyPI
pyobjc-framework-CryptoTokenKitProvides Python bindings to macOS's…
permissive · top 15,000 on PyPI
python-pkcs11Provides a high-level Python interface to…
permissive · top 15,000 on PyPI
PyRICPyRIC provides programmatic control over Linux…
copyleft · top 15,000 on PyPI
home-assistant-chip-coreProvides Python bindings and tools for the…
permissive · top 15,000 on PyPI
adaptive-cards-templating-pyExpands Adaptive Card templates by substituting…
permissive · top 15,000 on PyPI
razorpayPython client library for the Razorpay payment…
permissive · top 5,000 on PyPI
microsoft-teams-cardsProvides Pydantic-based models for building…
permissive · top 5,000 on PyPI
streamlit-cardA Streamlit component that renders interactive…
permissive · top 15,000 on PyPI
spidevProvides Python bindings to interact with SPI…
permissive · top 15,000 on PyPI