-
Notifications
You must be signed in to change notification settings - Fork 14
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
v0.1.0 - Library redesign #24
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…dd to this more later).
Remove ImportError print. Add API_VERSION parameter and docstring to __init__ Adjust headers for each API version. Raise exception when API_VERSION is invalid. file_scan: Update docstring, added new parameter upload_url, added support for v3 API. Add new method file_upload_url.
…quest. Add file_id method. add file_id_analyse method.
Move to init method of Virustotal class.
… something better soon. Fix mistake with BASEURL being BASE_URL.
Alter wording to retrieve. Add data and object_type properties. Usage with v3 API endpoints. Simplify response_code property. Replace json parameter with data in request(). Make method the last parameter in request(). Add docstring raises for validate_response().
Add API key image.
Remove repeated code.
All tests passed. |
LGTM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The library has been redesigned to accommodate for the 3rd version of the VirusTotal API.
Please note that the library can still interact with the 2nd version of the VirusTotal API.
Changes
Usage is now via
request()
. The first parameter being the resource endpoint (e.g:files/{id}
) followed by query parameters, data sent in the body of the request, JSON payload, files and the request method.The library now returns the class
VirustotalResponse
however, to preserve the response dictionary returned byvirustotal-python
<= 0.0.9, theCOMPATIBILITY_ENABLED
parameter can be provided to theVirustotal
class. Additionally, if a HTTP status code other than 200 (successful) occurs, then the classVirustotalError
is returned (unlessCOMPATIBILITY_ENABLED
) is provided. Then again, the old dictionary response is returned.New tests have been created to test the majority of the endpoints.
New examples can be found in the
examples
directory. Most of the use cases have been covered.New README with examples and how to run tests.
Add ability to provide API key via the environment variable
VIRUSTOTAL_API_KEY
.Add ability to provide a timeout for requests.
This PR addresses issue #23