NFC Data Exchange Format decoder and encoder.
Project description
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.1.1.tar.gz
(77.5 kB
view details)
Built Distribution
File details
Details for the file ndeflib-0.1.1.tar.gz
.
File metadata
- Download URL: ndeflib-0.1.1.tar.gz
- Upload date:
- Size: 77.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0af89bd370a36a50c5dbfd254daf0b026cd886797462c73e3564a10cb381436 |
|
MD5 | 2acb1c3674e8fe3d42bad8cb97bbdc09 |
|
BLAKE2b-256 | d5fd9c8e6261725ea7c384cec57f135c11b5b16109bd0e2fe33c399715de27f4 |
File details
Details for the file ndeflib-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: ndeflib-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 32.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abdc3435dac53449b85539ea1f5feb9d77a5a5ca06575f2ad177111f9e0dd6ea |
|
MD5 | 234c651b7fd770f1fb8ecce1205a5d9b |
|
BLAKE2b-256 | 1c33bef4605367b3f0be4f43157a7fea203a9a0b733a5e6720e7533e9ab5beee |