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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lib2fas-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3f92090c41f9e141ae4428f57d0326fd0effafe39f19f0b98ba4f5a4071acb7a
MD5 9f8f04f5e02a00c310dda39d3f974cf2
BLAKE2b-256 02a4f94fce56581d5fe2a2775c6d907265084222ed354c433f5489255f0c5173

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for lib2fas-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e5f585ae2d72766fbeb732bf5ab090d186d7559198930242b409b43ef8a93d4f
MD5 1873bf5e7054fdf935094d776bafc53b
BLAKE2b-256 e9f0502ef8cd2fcc268dc2b3457706a9fe253c4bea9893e09e186da5fa4e170f

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