A lightweight python library for reading and writing to NFC tags via PC/SC
Project description
TagBit
TagBit is a lightweight python library for reading and writing to NFC tags through the PC/SC API.
I built this library because nfcpy lacked support for the Sony PaSoRi RC-S300. Because I built it around that device it isn't yet guaranteed to work with other readers, although since it is built around PC/SC it should have basic support for most readers.
TagBit uses pyscard to interface with the NFC reader.
Installation
You can install TagBit from PyPI using pip.
pip install tagbit
Usage
TagBit can be used to read and write NDEF messages, and to create dumps of Amiibos. Here are some examples:
Reading
from tagbit import Reader
reader = Reader()
tag = reader.get_tag()
records = tag.read() # Returns the NDEF records from the tag.
Writing
from tagbit import Reader
import ndef # https://pypi.org/project/ndeflib/
records = [
ndef.TextRecord("Hello, world!", 'en'),
]
reader = Reader()
tag = reader.get_tag()
tag.write(records) # Saves the NDEF records to the tag.
Amiibos
from tagbit import Reader
reader = Reader()
tag = reader.get_tag()
amiibo_id = tag.get_id() # Returns the UID of the Amiibo.
amiibo_bin = tag.dump() # Creates a dump of the Amiibo.
Plans
- Add support for MIFARE Classic 1k and other formats
- Add tools for creating Amiibos from dumps
- Test with other NFC reader models and expand compatibility
- Improve NDEF implementation if needed
Support
If you liked this project, go ahead and give it a star! And if it really helped you out, consider sending me a tip!
BTC:
bc1q0pp60krluv7a2w5cls09l9ahat5lqvu7mt9efq
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tagbit-1.0.tar.gz.
File metadata
- Download URL: tagbit-1.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c80d0a4db6c7f780d6e633b0a7dcaa7566685d684719bcafcb10f0a6a2a003c9
|
|
| MD5 |
5dc3fbf8f2cfd2ca433dbec786f1f7c8
|
|
| BLAKE2b-256 |
a28cf5efa011585a2e27bbe07a97b474dc7596762ecce0ecffde7d525b2db9eb
|
Provenance
The following attestation bundles were made for tagbit-1.0.tar.gz:
Publisher:
publish.yml on ModestBitboard/TagBit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tagbit-1.0.tar.gz -
Subject digest:
c80d0a4db6c7f780d6e633b0a7dcaa7566685d684719bcafcb10f0a6a2a003c9 - Sigstore transparency entry: 161361590
- Sigstore integration time:
-
Permalink:
ModestBitboard/TagBit@e7c387546af7c6c055bad10a998fea2616be5d07 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/ModestBitboard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e7c387546af7c6c055bad10a998fea2616be5d07 -
Trigger Event:
release
-
Statement type:
File details
Details for the file TagBit-1.0-py3-none-any.whl.
File metadata
- Download URL: TagBit-1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46baad692b5d5b92b4b129c72b04a7cf1667ac05682660b22014bae586b8bc12
|
|
| MD5 |
f4c742ca81f7b571b2551dcebdd2bd22
|
|
| BLAKE2b-256 |
38e5dea2f5c7d43ca258ae2af1c41b6135bff17bf182cf88cc6f1029ca5af4a4
|
Provenance
The following attestation bundles were made for TagBit-1.0-py3-none-any.whl:
Publisher:
publish.yml on ModestBitboard/TagBit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tagbit-1.0-py3-none-any.whl -
Subject digest:
46baad692b5d5b92b4b129c72b04a7cf1667ac05682660b22014bae586b8bc12 - Sigstore transparency entry: 161361591
- Sigstore integration time:
-
Permalink:
ModestBitboard/TagBit@e7c387546af7c6c055bad10a998fea2616be5d07 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/ModestBitboard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e7c387546af7c6c055bad10a998fea2616be5d07 -
Trigger Event:
release
-
Statement type: