Skip to main content

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.

Source Distribution

ndeflib-0.3.0.tar.gz (143.1 kB view details)

Uploaded Source

Built Distribution

ndeflib-0.3.0-py2.py3-none-any.whl (57.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ndeflib-0.3.0.tar.gz.

File metadata

  • Download URL: ndeflib-0.3.0.tar.gz
  • Upload date:
  • Size: 143.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ndeflib-0.3.0.tar.gz
Algorithm Hash digest
SHA256 da79836df6bde86732b6110e5f4344cc051b5ec8d67680ac5552c59f005084c7
MD5 e536289192fefe57186fa5103201ac9c
BLAKE2b-256 961aa792c5fe410a81d71dc71aa31ef51427dbc9f48a7b422cb98cf4beacc363

See more details on using hashes here.

File details

Details for the file ndeflib-0.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ndeflib-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4d28449ac2bc9e14cc9dfe5f651d04488312ae910550540987e2618e1b4555a3
MD5 dbe4f464615bd52a8b6943c7551db630
BLAKE2b-256 605de7b16bef1fde87fa36464b20c51f6c8cbe7b007deccaa89f8fe35ce0a73c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page