Python package for parsing and generating NFC Data Exchange Format messages.
Python
Latest commit 606a6d8 Jan 31, 2017 @nehpetsde nehpetsde Hash and randomizer as attributes and shared conversion.
The simple pairing hash and randomizer values are now accessed as
attributes specific to the P192 and P256 variants. Also the conversion
between 128-bit integer values and 16-octet transmission values is
factored into a private shared method.
Permalink
Failed to load latest commit information.
docs
src/ndef
tests
.coveragerc
.gitignore
.travis.yml get notifications if build fails on travis Jul 14, 2016
CONTRIBUTING.rst
HISTORY.rst
LICENSE first version, mostly complete except Wi-Fi/Bluetooth carrier type re… Jul 6, 2016
MANIFEST.in Add codecov.yml to MANIFEST.in Jan 23, 2017
README.rst Insert correct link to stable documentation Jan 5, 2017
codecov.yml
requirements-dev.txt
requirements-pypi.txt
setup.cfg make sure that LICENSE file is part of the wheel files Jan 4, 2017
setup.py
tox.ini

README.rst

Parse or generate NDEF messages

Python Package Stable Documentation Latest Documentation Build Status Code Coverage

The ndeflib is an ISC-licensed Python package for parsing and generating NFC Data Exchange Format (NDEF) messages:

>>> import ndef
>>> hexstr = '9101085402656e48656c6c6f5101085402656e576f726c64'
>>> octets = bytearray.fromhex(hexstr)
>>> for record in ndef.message_decoder(octets): print(record)
NDEF Text Record ID '' Text 'Hello' Language 'en' Encoding 'UTF-8'
NDEF Text Record ID '' Text 'World' Language 'en' Encoding 'UTF-8'
>>> message = [ndef.TextRecord("Hello"), ndef.TextRecord("World")]
>>> b''.join(ndef.message_encoder(message)) == octets
True

The ndeflib documentation can be found on Read the Docs, the code on GitHub. It is continously tested for Python 2.7 and 3.5 with pretty complete test coverage.