Skip to main content

schnee

schnee is a Python package and CLI for working with NFC/RFID tags through a PC/SC reader, with a current focus on NTAG profile inspection and NDEF URL writes.

Installation

Install the package from PyPI:

pip install schnee

Requirements

schnee talks to tags through PC/SC via pyscard, so practical use requires:

  • a compatible NFC or smart card reader
  • a working system PC/SC library/service
  • access to the target tag

Platform-specific PC/SC prerequisites:

  • Linux: install a PC/SC implementation such as pcsc-lite and ensure the pcscd daemon/service is installed and running. Depending on your distribution, you may also need your reader's driver package.
  • Windows: pyscard uses the built-in WinSCard PC/SC subsystem that ships with Windows; make sure the smart card service and your reader driver are available.
  • macOS: pyscard uses the system PCSC.framework, which is included with macOS; make sure the reader is connected and recognized by the system.

If the PC/SC stack, service, or reader is not available, pyscard may fail to import, no readers may be discovered, or CLI commands that access hardware will fail during reader discovery or card communication.

CLI Usage

After installation, the schnee command is available on your PATH.

Show the top-level help:

schnee --help

List selectable backends and detected PC/SC readers:

schnee backends

Read the current NTAG profile as JSON:

schnee ntag read --backend pcsc

Use a specific reader by name:

schnee ntag read --backend "pcsc:ACS ACR1252 1S CL Reader PICC 0"

Write a URL as a single NDEF URI record:

schnee ntag write-url --backend pcsc --url "https://example.com"

For NTAG 424 DNA tags that require application authentication before writing, provide the current 16-byte AES key as 32 hex characters:

schnee ntag write-url \
  --backend pcsc \
  --url "https://example.com" \
  --ntag424-master-key-hex 00112233445566778899aabbccddeeff

Warning: passing a secret key on the command line can expose it through shell history, terminal logging, or process listings visible to other local users. Avoid using real production keys this way; prefer a safer secret input mechanism if one is available in your environment.

Verify an NTAG 424 DNA SDM MAC from mirrored URL data:

schnee ntag verify-sdm-mac \
  --signed-text "example.com/t?uid=044C2F82322190&ctr=250000&mac=" \
  --mac 260d8310beb0e062 \
  --sdm-key-hex 00112233445566778899aabbccddeeff \
  --uid 044C2F82322190 \
  --counter 250000

When the tag stored the URI record without NDEF URI compression, keep the default --ndef-prefix no_prefix and pass --signed-text exactly as it was mirrored.

When the tag stored the URI record with an NDEF URI Identifier Code such as https (which expands to https://), pass that token through --ndef-prefix. The verifier removes the expanded prefix from signed_text before MAC calculation only when both of the following are true:

  • the selected --ndef-prefix expands to a non-empty prefix such as https://
  • --signed-text starts with that expanded prefix

This means signed_text may include the display prefix copied from the tag scan, or it may already be prefix-normalized. Both are accepted as long as --ndef-prefix matches the URI Identifier Code used when the URL was stored.

For a tag that used compressed https:// storage, these two commands verify the same signed bytes:

schnee ntag verify-sdm-mac \
  --signed-text "https://example.com/t?uid=044C2F82322190&ctr=250000&mac=" \
  --mac 260d8310beb0e062 \
  --sdm-key-hex 00112233445566778899aabbccddeeff \
  --uid 044C2F82322190 \
  --counter 250000 \
  --ndef-prefix https
schnee ntag verify-sdm-mac \
  --signed-text "example.com/t?uid=044C2F82322190&ctr=250000&mac=" \
  --mac 260d8310beb0e062 \
  --sdm-key-hex 00112233445566778899aabbccddeeff \
  --uid 044C2F82322190 \
  --counter 250000 \
  --ndef-prefix https

If you provide --uid or --counter, those bytes must match the tag's SDM configuration and the mirrored URL contents. In particular, --counter expects 3 mirrored bytes as 6 hex characters in URL order, and the mirrored ctr= value inside --signed-text should use that same hex representation. The verifier handles the NTAG 424 DNA counter byte-order conversion internally.

Python API

The stable Python entry points currently exposed by the package are the service classes re-exported from schnee.services. For example, you can list the selectable backends from Python:

from schnee.services import ListBackendNamesService

backends = ListBackendNamesService.call(ListBackendNamesService.Request())
print(backends)

This call uses the same backend discovery as schnee backends, so it also depends on a working PC/SC environment when the PC/SC backend is enabled.

Trademarks and Disclaimer

  • Trademarks: NTAG, MIFARE, and NXP are registered trademarks of NXP B.V. This project is an independent open-source implementation and is not affiliated with, endorsed by, or sponsored by NXP B.V.
  • Accuracy of Information: This SDK is developed based on publicly available datasheets. While every effort has been made to ensure the accuracy of the implementation, the author makes no guarantees regarding its suitability for any specific purpose.
  • Limitation of Liability: In no event shall the author be liable for any damages arising from the use of this software, including but not limited to hardware damage (NFC tags, readers, etc.), data loss, or "bricking" of tags due to incorrect AES key configuration or authentication failures. Use this software at your own risk.

Metadata

Release files for schnee 2026.5.10

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

Source distribution (sdist)

Source distribution for schnee 2026.5.10
File Size Uploaded Provenance
schnee-2026.5.10.tar.gz 84.5 kB With provenance Details

Built distribution (wheel)

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

Total release size: 138.7 kB

Release files / schnee-2026.5.10.tar.gz

Download URL schnee-2026.5.10.tar.gz
Size 84.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6cab3481128b27fd0fb1d08d00d9322e112f3ba2b423d505486fa13d68a8784b
BLAKE2b-256 checksum
How to use checksums
c10a4b16589c9506c4964e0e0f0f7ad9445fff08b11f3ef1a241a47756323d9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 May 9, 2026.

Transparency log

Release files / schnee-2026.5.10-py3-none-any.whl

Download URL schnee-2026.5.10-py3-none-any.whl
Size 54.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
557f0bbac96437a0f43c4c5f3e194146106c8a99f4e2f34935081fec16a88eb4
BLAKE2b-256 checksum
How to use checksums
04d1b00bafd88648134ffb56e6ef1599e0fa66c5f6b569e3485ea832d1d15af0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 May 9, 2026.

Transparency log

Security for schnee 2026.5.10

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for schnee-2026.5.10.tar.gz

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 May 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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