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.2.tar.gz (74.2 kB view hashes)

Uploaded Source

Built Distribution

lib2fas-0.1.2-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

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