Skip to main content

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

PyPI PyPI - Downloads

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

Metadata

Release files for TagBit 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TagBit 1.0
File Size Uploaded
tagbit-1.0.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TagBit 1.0
File Interpreter ABI Platform
TagBit-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.9 kB

Release files / tagbit-1.0.tar.gz

Download URL tagbit-1.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c80d0a4db6c7f780d6e633b0a7dcaa7566685d684719bcafcb10f0a6a2a003c9
BLAKE2b-256 checksum
How to use checksums
a28cf5efa011585a2e27bbe07a97b474dc7596762ecce0ecffde7d525b2db9eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 10, 2025.

Transparency log

Release files / TagBit-1.0-py3-none-any.whl

Download URL TagBit-1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46baad692b5d5b92b4b129c72b04a7cf1667ac05682660b22014bae586b8bc12
BLAKE2b-256 checksum
How to use checksums
38e5dea2f5c7d43ca258ae2af1c41b6135bff17bf182cf88cc6f1029ca5af4a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 10, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page