Pynfc
`ctypeslib` converted libnfc and libfreefare.
Install / Use
/learn @BarnabyShearer/PynfcREADME
.. Autogenerated by https://github.com/BarnabyShearer/meta
===== pynfc
.. image:: https://readthedocs.org/projects/pynfc/badge/?version=latest :target: https://pynfc.readthedocs.io/en/latest/ .. image:: https://img.shields.io/pypi/v/pynfc?color=success :target: https://pypi.org/project/pynfc
ctypeslib converted libnfc and libfreefare.
Install
.. code-block:: bash
sudo apt install libclang-dev libfreefare-dev
python3 -m pip install pynfc
Usage
.. code-block:: python
from pynfc import Nfc, Desfire, Timeout
n = Nfc("pn532_uart:/dev/ttyUSB0:115200")
DESFIRE_DEFAULT_KEY = b'\x00' * 8
MIFARE_BLANK_TOKEN = b'\xFF' * 1024 * 4
for target in n.poll():
try:
print(target.uid, target.auth(DESFIRE_DEFAULT_KEY if type(target) == Desfire else MIFARE_BLANK_TOKEN))
except TimeoutException:
pass
Develop
.. code-block:: bash
sudo apt install libfreefare-dev libclang-5.0-dev
git clone https://github.com/BarnabyShearer/pynfc.git
cd pynfc
python3 setup.py develop --user
Related Skills
node-connect
348.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
348.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
