Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/barnabyshearer/pynfc
`ctypeslib` converted libnfc and libfreefare.
https://github.com/barnabyshearer/pynfc
desfire mifare nfc rfid
Last synced: about 5 hours ago
JSON representation
`ctypeslib` converted libnfc and libfreefare.
- Host: GitHub
- URL: https://github.com/barnabyshearer/pynfc
- Owner: BarnabyShearer
- License: bsd-3-clause
- Created: 2016-09-22T12:59:00.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2022-12-08T01:04:22.000Z (almost 2 years ago)
- Last Synced: 2024-10-28T17:33:28.651Z (10 days ago)
- Topics: desfire, mifare, nfc, rfid
- Language: C
- Homepage: https://pynfc.readthedocs.io/en/latest/
- Size: 60.5 KB
- Stars: 16
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
..
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 pynfcUsage
-----.. 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:
passDevelop
-------.. 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