Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

NFC Data Exchange Format decoder and encoder.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ndeflib, version 0.3.3
Filename, size File type Python version Upload date Hashes
Filename, size ndeflib-0.3.3-py2.py3-none-any.whl (56.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size ndeflib-0.3.3.tar.gz (143.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page