From 1a295ad7550182f43533edc95ff5b57dcca7523a Mon Sep 17 00:00:00 2001 From: Dextroz <25749668+Dextroz@users.noreply.github.com> Date: Wed, 13 Feb 2019 18:35:17 +0000 Subject: [PATCH 1/5] Changes for PyPI support. --- README.md | 10 ++++++---- setup.py | 21 +++++++++++++++++++++ virustotal_python/__init__.py | 1 + 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 setup.py diff --git a/README.md b/README.md index dd48d4b..330be72 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,13 @@ requests = "*" ```pipenv install``` -## TODO -* Add package to PyPi package index. +Or + +```pip3 install virustotal-python``` ## Example Usage ```python -from virustotal import Virustotal +from virustotal_python import Virustotal from pprint import pprint vtotal = Virustotal("Insert API Key Here.") @@ -58,7 +59,8 @@ resp = vtotal.put_comment("ihaveaproblem.info", comment="This website is flagged ``` ```python -# Example resp for url_scan() +# Example resp for url_scan(). +# Assuming you have already initiated Virustotal() and imported pprint. resp = vtotal.url_scan("ihaveaproblem.info") # Query a single url. pprint(resp) {'json_resp': {'permalink': 'https://www.virustotal.com/url/fd21590d9df715452c8c000e1b5aa909c7c5ea434c2ddcad3f4ccfe9b0ee224e/analysis/1549973453/', diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..948ff35 --- /dev/null +++ b/setup.py @@ -0,0 +1,21 @@ +from setuptools import setup, find_packages + +with open("README.md", "r") as readme: + long_description = readme.read() + +setup( + name="virustotal-python", + version="0.0.1", + author="Dextroz", + author_email="dextrozmlg@gmail.com", + description="A light wrapper around the public VirusTotal API.", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://github.com/Dextroz/virustotal-python", + packages=find_packages(), + classifiers=[ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7" + ], +) \ No newline at end of file diff --git a/virustotal_python/__init__.py b/virustotal_python/__init__.py index d5c0d9e..848e22b 100644 --- a/virustotal_python/__init__.py +++ b/virustotal_python/__init__.py @@ -1 +1,2 @@ +from virustotal_python.virustotal import Virustotal name = "virustotal-python" \ No newline at end of file From 01cc67cb914aa043cc1c26e537adf4c8fc82ca33 Mon Sep 17 00:00:00 2001 From: Dextroz <25749668+Dextroz@users.noreply.github.com> Date: Wed, 13 Feb 2019 18:56:19 +0000 Subject: [PATCH 2/5] Updated Dependancies. --- Pipfile | 4 ++ Pipfile.lock | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 113 insertions(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 9ba262c..4ffc835 100644 --- a/Pipfile +++ b/Pipfile @@ -5,9 +5,13 @@ verify_ssl = true [dev-packages] black = "*" +twine = "*" [packages] requests = "*" [requires] python_version = "3.7" + +[pipenv] +allow_prereleases = true diff --git a/Pipfile.lock b/Pipfile.lock index 72e42cb..1d2a63d 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "72ba668b70bdbb494525a7245321ec141326313ae99334512b006bb42dad87f0" + "sha256": "c7b3bb4696877a2affec0b303b86679b2d3fd7569c7ba4ffe5f0162edb919d54" }, "pipfile-spec": 6, "requires": { @@ -76,6 +76,27 @@ "index": "pypi", "version": "==18.9b0" }, + "bleach": { + "hashes": [ + "sha256:213336e49e102af26d9cde77dd2d0397afabc5a6bf2fed985dc35b5d1e285a16", + "sha256:3fdf7f77adcf649c9911387df51254b813185e32b2c6619f690b593a617e19fa" + ], + "version": "==3.1.0" + }, + "certifi": { + "hashes": [ + "sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7", + "sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033" + ], + "version": "==2018.11.29" + }, + "chardet": { + "hashes": [ + "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", + "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + ], + "version": "==3.0.4" + }, "click": { "hashes": [ "sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13", @@ -83,12 +104,99 @@ ], "version": "==7.0" }, + "docutils": { + "hashes": [ + "sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", + "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274", + "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6" + ], + "version": "==0.14" + }, + "idna": { + "hashes": [ + "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", + "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c" + ], + "version": "==2.8" + }, + "pkginfo": { + "hashes": [ + "sha256:7424f2c8511c186cd5424bbf31045b77435b37a8d604990b79d4e70d741148bb", + "sha256:a6d9e40ca61ad3ebd0b72fbadd4fba16e4c0e4df0428c041e01e06eb6ee71f32" + ], + "version": "==1.5.0.1" + }, + "pygments": { + "hashes": [ + "sha256:5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a", + "sha256:e8218dd399a61674745138520d0d4cf2621d7e032439341bc3f647bff125818d" + ], + "version": "==2.3.1" + }, + "readme-renderer": { + "hashes": [ + "sha256:bb16f55b259f27f75f640acf5e00cf897845a8b3e4731b5c1a436e4b8529202f", + "sha256:c8532b79afc0375a85f10433eca157d6b50f7d6990f337fa498c96cd4bfc203d" + ], + "version": "==24.0" + }, + "requests": { + "hashes": [ + "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e", + "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b" + ], + "index": "pypi", + "version": "==2.21.0" + }, + "requests-toolbelt": { + "hashes": [ + "sha256:380606e1d10dc85c3bd47bf5a6095f815ec007be7a8b69c878507068df059e6f", + "sha256:968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0" + ], + "version": "==0.9.1" + }, + "six": { + "hashes": [ + "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", + "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" + ], + "version": "==1.12.0" + }, "toml": { "hashes": [ "sha256:229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c", "sha256:235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e" ], "version": "==0.10.0" + }, + "tqdm": { + "hashes": [ + "sha256:d385c95361699e5cf7622485d9b9eae2d4864b21cd5a2374a9c381ffed701021", + "sha256:e22977e3ebe961f72362f6ddfb9197cc531c9737aaf5f607ef09740c849ecd05" + ], + "version": "==4.31.1" + }, + "twine": { + "hashes": [ + "sha256:7d89bc6acafb31d124e6e5b295ef26ac77030bf098960c2a4c4e058335827c5c", + "sha256:fad6f1251195f7ddd1460cb76d6ea106c93adb4e56c41e0da79658e56e547d2c" + ], + "index": "pypi", + "version": "==1.12.1" + }, + "urllib3": { + "hashes": [ + "sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39", + "sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22" + ], + "version": "==1.24.1" + }, + "webencodings": { + "hashes": [ + "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78", + "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923" + ], + "version": "==0.5.1" } } } From fea294d419be172ce756cc24908360e40c5ee44b Mon Sep 17 00:00:00 2001 From: Dextroz <25749668+Dextroz@users.noreply.github.com> Date: Wed, 13 Feb 2019 18:56:25 +0000 Subject: [PATCH 3/5] Added requirements.txt --- requirements.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..68f11a2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,20 @@ +appdirs==1.4.3 +attrs==18.2.0 +black==18.9b0 +bleach==3.1.0 +certifi==2018.11.29 +chardet==3.0.4 +Click==7.0 +docutils==0.14 +idna==2.8 +pkginfo==1.5.0.1 +Pygments==2.3.1 +readme-renderer==24.0 +requests==2.21.0 +requests-toolbelt==0.9.1 +six==1.12.0 +toml==0.10.0 +tqdm==4.31.1 +twine==1.12.1 +urllib3==1.24.1 +webencodings==0.5.1 From 02e821f2f3e713098939a223d63d587f27be275d Mon Sep 17 00:00:00 2001 From: Dextroz <25749668+Dextroz@users.noreply.github.com> Date: Wed, 13 Feb 2019 18:56:30 +0000 Subject: [PATCH 4/5] Updated README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 330be72..80a87f6 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ A light wrapper around the public VirusTotal API. ``` [dev-packages] black = "*" +twine = "*" [packages] requests = "*" @@ -14,6 +15,10 @@ requests = "*" ```pipenv install``` +Or + +```pip install -r requirements.txt``` + Or ```pip3 install virustotal-python``` From 1bdf96fdc1272898d4bc086abe5afba0fdf43bcd Mon Sep 17 00:00:00 2001 From: Dextroz <25749668+Dextroz@users.noreply.github.com> Date: Wed, 13 Feb 2019 18:57:16 +0000 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 80a87f6..11c54ef 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ requests = "*" Or -```pip install -r requirements.txt``` +```pip3 install -r requirements.txt``` Or