diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..bb3ec5f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include README.md diff --git a/bin/urlfinder b/bin/urlfinder new file mode 100755 index 0000000..6e7056d --- /dev/null +++ b/bin/urlfinder @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +import urlfinderlib +import sys + +if __name__ == '__main__': + try: + file_path = sys.argv[1] + except: + print('Usage: urlfinder /path/to/file') + sys.exit(1) + + try: + with open(file_path, 'rb') as f: + urls = sorted(list(set(urlfinderlib.find_urls(f.read())))) + for url in urls: + print(url) + except: + print('Usage: urlfinder /path/to/file') + sys.exit(1) diff --git a/setup.py b/setup.py index e56cfb0..b533288 100644 --- a/setup.py +++ b/setup.py @@ -23,10 +23,11 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='0.1.2', + version='0.2.0', description='Library to find URLs and check their validity.', long_description=long_description, + long_description_content_type='text/markdown', # The project's main homepage. url='https://github.com/IntegralDefense/urlfinderlib', @@ -94,6 +95,8 @@ #'sample': ['package_data.dat'], }, + scripts=['bin/urlfinder'], + # Although 'package_data' is the preferred approach, in some case you may # need to place data files outside of your packages. See: # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa