Skip to main content

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

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

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

tagbit-1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TagBit-1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

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

Hashes for tagbit-1.0.tar.gz
Algorithm Hash digest
SHA256 c80d0a4db6c7f780d6e633b0a7dcaa7566685d684719bcafcb10f0a6a2a003c9
MD5 5dc3fbf8f2cfd2ca433dbec786f1f7c8
BLAKE2b-256 a28cf5efa011585a2e27bbe07a97b474dc7596762ecce0ecffde7d525b2db9eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for tagbit-1.0.tar.gz:

Publisher: publish.yml on ModestBitboard/TagBit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for TagBit-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46baad692b5d5b92b4b129c72b04a7cf1667ac05682660b22014bae586b8bc12
MD5 f4c742ca81f7b571b2551dcebdd2bd22
BLAKE2b-256 38e5dea2f5c7d43ca258ae2af1c41b6135bff17bf182cf88cc6f1029ca5af4a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for TagBit-1.0-py3-none-any.whl:

Publisher: publish.yml on ModestBitboard/TagBit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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