Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding command-line utility #8

Closed
wants to merge 1 commit into from
Closed

adding command-line utility #8

wants to merge 1 commit into from

Conversation

omgold
Copy link

@omgold omgold commented May 24, 2019

As there seem to be more people interested in this (#1), I would offer to donate my CLI utility for this library.

import subprocess
import argparse
import json
import tldextract
Copy link
Owner

@hrehfeld hrehfeld Sep 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing package dep in setup.py. here?

install_requires=[

Also, can we avoid this dep?

@hrehfeld
Copy link
Owner

hrehfeld commented Sep 6, 2019

Hmm, I have mixed feelings about this. Wouldn't it be a better idea to maintain this separately? The library is specifically NOT a commandline client (loads of options there iirc?), but something that's easy to use in scripts.

Also see the comments.

And sorry for the long wait :(


def main():
argument_parser = argparse.ArgumentParser(description="Fetch credentials from a running KeepassXC instance")
argument_parser.add_argument('url')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc?


extract_result = tldextract.extract(url)

# Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the thought process here? You try to do some sensible matching on the url? What usecase are you covering? At least this needs to be documented (see below @argparse) somehow.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is in parts from the qutebrowser scripts for old KeePass. The idea is, if no match is found for the given domain, to search 'upward' the tree of subdomains, up to the last before the TLD.

@omgold
Copy link
Author

omgold commented Sep 6, 2019

Hmm, I have mixed feelings about this. Wouldn't it be a better idea to maintain this separately? The library is specifically NOT a commandline client (loads of options there iirc?), but something that's easy to use in scripts.

Also see the comments.

And sorry for the long wait :(

That view is of certainly reasonable. It's just that when I found the lib, I also noticed the tickets asking for a CLI utility. As I needed one myself, I created this and then thought I could share it.

Actually I don't have an opinion on whether it should be included with the lib or not. It's just an offer, nothing more.

hanndecl pushed a commit to hanndecl/python-keepassxc-browser that referenced this pull request Feb 8, 2021
@omgold omgold closed this by deleting the head repository Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants