Skip to content

Commit

Permalink
fix: extracted core funcionality to lib2fas
Browse files Browse the repository at this point in the history
BREAKING CHANGE
  • Loading branch information
robinvandernoord committed Jan 29, 2024
1 parent 3a922fa commit 88ca459
Show file tree
Hide file tree
Showing 16 changed files with 269 additions and 572 deletions.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
# 2fas Python

2fas-python is an unofficial implementation
of [2FAS - the Internet’s favorite open-source two-factor authenticator](https://2fas.com).
It consists of a core library in Python and a CLI tool.

## Installation

To install this project, use pip or pipx:

```bash
pip install 2fas
# or:
pipx install 2fas
```

## Usage

To see all available options, you can run:
```bash
2fas --help
```

If you simply run `2fas` or `2fas /path/to/file.2fas`, an interactive menu will show up.
If you only want a specific TOTP code, you can run `2fas <service>` or `2fas /path/to/file.2fas <service>`.
Multiple services can be specified: `2fas <service1> <service2> [/path/to/file.2fas]`.
Fuzzy matching is applied to (hopefully) catch some typo's.
You can run `2fas --all` to generate codes for all TOTP in your `.2fas` file.

### Settings
```bash
# see all settings:
2fas --settings # shortcut: -s
# see a specific setting:
2fas --setting key
# update a setting:
2fas --setting key value
```

The `--settings`, `--setting` or `-s` flag can be used to read/write settings.
This can also be done from within the interactive menu.

### As a Library

Please see the documentation of [lib2fas-python](https://github.com/robinvandernoord/lib2fas-python) for more details on
using this as a Python library.

## License

This project is licensed under the MIT License.
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "2fas"
dynamic = ["version"]
description = 'Unofficial implementation of 2fas for Python'
description = 'Unofficial implementation of 2fas for Python (as a CLI tool)'
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
Expand All @@ -23,13 +23,10 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"cryptography",
"lib2fas",
"configuraptor>=1.25",
"PyOTP",
"keyring",
"typer[all]",
"questionary",
"rapidfuzz",
]

[template.plugins.default]
Expand Down Expand Up @@ -185,3 +182,8 @@ add_ignore = [
pythonpath = [
"src",
]

[tool.coverage.run]
omit = [
"src/twofas/cli.py",
]
4 changes: 4 additions & 0 deletions src/twofas/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
"""
This file stores the module version.
"""

__version__ = "0.1.0"
8 changes: 6 additions & 2 deletions src/twofas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from .core import load_services
"""
Entrypoint which exposes app.
"""

__all__ = ["load_services"]
from .cli import app

__all__ = ["app"]
136 changes: 0 additions & 136 deletions src/twofas/_security.py

This file was deleted.

75 changes: 0 additions & 75 deletions src/twofas/_types.py

This file was deleted.

Loading

0 comments on commit 88ca459

Please sign in to comment.