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

v0.1.0 - Library redesign #24

Merged
merged 86 commits into from
Nov 21, 2020
Merged

v0.1.0 - Library redesign #24

merged 86 commits into from
Nov 21, 2020

Conversation

dbrennand
Copy link
Owner

@dbrennand dbrennand commented Nov 14, 2020

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 by virustotal-python <= 0.0.9, the COMPATIBILITY_ENABLED parameter can be provided to the Virustotal class. Additionally, if a HTTP status code other than 200 (successful) occurs, then the class VirustotalError is returned (unless COMPATIBILITY_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

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.
@dbrennand
Copy link
Owner Author

All tests passed.

@dbrennand
Copy link
Owner Author

LGTM

@dbrennand dbrennand merged commit 05dfa8a into master Nov 21, 2020
@dbrennand dbrennand deleted the redesign branch November 21, 2020 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant