Skip to main content

ctypeslib converted libnfc and libfreefare with just enough of the interals to actually be usable.

sudo apt install libfreefare-dev
pip install pynfc
from pynfc import Nfc, Desfire, Timeout

n = Nfc("pn532_uart:/dev/ttyUSB0:115200")

DESFIRE_DEFAULT_KEY = b'\x00' * 8
MIFARE_BLANK_TOKEN = b'\xFF' * 1024 * 4

for target in n.poll():
    try:
        print(target.uid, target.auth(DESFIRE_DEFAULT_KEY if type(target) == Desfire else MIFARE_BLANK_TOKEN))
    except TimeoutException:
        pass

Metadata

Release files for pynfc 0.1.1

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

Source distribution (sdist)

Source distribution for pynfc 0.1.1
File Size Uploaded Provenance
pynfc-0.1.1.tar.gz 12.2 kB Without provenance Details

Release files / pynfc-0.1.1.tar.gz

Download URL pynfc-0.1.1.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dca9a7aa364d6bbfa4dc56afb13993263eb41a32f087205601f748ee593a6cac
BLAKE2b-256 checksum
How to use checksums
086329d09b71ad116e33e659846fabc4e6c662852c37e80d20737af990fb3688
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

Security for pynfc 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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