Skip to main content

Unofficial implementation of 2fas for Python (as a library)

Project description

lib2fas Python

Unofficial implementation of 2fas for Python (as a library).

Installation

To install this project, use pip:

pip install lib2fas
# or to also install the cli tool:
pip install 2fas

Usage

After installing the package, you can import it in your Python scripts as follows:

import lib2fas

services = lib2fas.load_services("/path/to/file.2fas", passphrase="optional") # -> TwoFactorStorage

services.generate() # generate all TOTP keys
github = services.find("githbu") # fuzzy match should find GitHub, returns a new TwoFactorStorage.

for label, services in github.items():
    # one label can have multiple services!
    for service in services:
        print(label, service.name, service.generate_int())

License

This project is licensed under the MIT License.

Project details


Download files

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

Source Distribution

lib2fas-0.1.4.tar.gz (68.7 kB view details)

Uploaded Source

Built Distribution

lib2fas-0.1.4-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file lib2fas-0.1.4.tar.gz.

File metadata

  • Download URL: lib2fas-0.1.4.tar.gz
  • Upload date:
  • Size: 68.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.26.0

File hashes

Hashes for lib2fas-0.1.4.tar.gz
Algorithm Hash digest
SHA256 acedf78b595516a8c9667b44306fdc5f60fb316adeb479d631401dd07d08b90a
MD5 baea7c00bc2845dda477388837cf8a2b
BLAKE2b-256 a78022795f8ac7d3bf85a369cac79ab98734164239cc709d30d3acafbf13aa66

See more details on using hashes here.

Provenance

File details

Details for the file lib2fas-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: lib2fas-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.26.0

File hashes

Hashes for lib2fas-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 205af24d8d3c84c567be2d3f12deedcf2eb930cf100140968d660ec4bc58c825
MD5 9191f471fdac95e974feaea1fe2ff602
BLAKE2b-256 ca450aad08bc7294aa94fe040f615cbaf87c7256ff4d4d1e04217980bd666df0

See more details on using hashes here.

Provenance

Supported by

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