Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

API Modules Run #13

Open
n3l5 opened this issue Dec 6, 2020 · 6 comments
Open

API Modules Run #13

n3l5 opened this issue Dec 6, 2020 · 6 comments

Comments

@n3l5
Copy link

n3l5 commented Dec 6, 2020

Having a devil of a time figuring out how to run a module against a sample.

I am using the v3 api and can see the Modules listed in API , but I can't seem to find the ability to actually run them against a sample. Can someone give me a hint?

@acd62081
Copy link
Contributor

If you have an Office document like Word or Excel, then you would go to the modules tab and select Office -Office Document Parser. Then you need pick something along the lines of MetaData or Document Streams in the sub module and then click Run.

For a PDF file, you can select the PDF - PDF Document Parser or Strings.

You might also need to make sure you have installed all of the requirements listed in the requirements.txt file located in the viper-modules repo if you haven't done so already.
https://github.com/viper-framework/viper-modules/blob/master/requirements.txt

@n3l5
Copy link
Author

n3l5 commented Dec 12, 2020

If you have an Office document like Word or Excel, then you would go to the modules tab and select Office -Office Document Parser. Then you need pick something along the lines of MetaData or Document Streams in the sub module and then click Run.

For a PDF file, you can select the PDF - PDF Document Parser or Strings.

You might also need to make sure you have installed all of the requirements listed in the requirements.txt file located in the viper-modules repo if you haven't done so already.
https://github.com/viper-framework/viper-modules/blob/master/requirements.txt

I understand how to do this manually via the web interface, I am wondering if it is possible to do via the API.

@acd62081
Copy link
Contributor

Sorry, it was a late night and apparently my reading comprehension wasn't working . You may have figured this out already, but it doesn't appear that running modules is supported from the API yet. The API docs at http:\\viper url/api/v3/docs/ are only showing list operations and if you look at the viperapi/views.py you can see the run_module functions located at the bottom are commented out with the notes of:
TODO(frennkie) check whether and how to run modules

https://github.com/viper-framework/viper-web/blob/5fa2b55afe3606785302284eefd01810ca227c0b/viper_web/viperapi/views.py

I may be wrong, but I am not seeing a way to run them using the API.
Hopefully someone else will chime in shortly with a definite answer.

@frennkie
Copy link
Collaborator

frennkie commented Dec 13, 2020

@n3l5 @acd62081 Yes, you are right - currently the V3 API does not support running modules.

If you want to contribute a Pull Request I'm happy to give you some hints and do a review. The link to

# TODO(frennkie) check whether and how to run modules
is already a good start. The code there is from the viper code before the migration to V3 and would need to be adapted. This shouldn't be too complicated. :-D

@acd62081
Copy link
Contributor

@frennkie Probably not too complicated for you based on what I have seen you do. I have no experience with web development but I will look through and see if I can figure out what needs to be done.
I would imagine that is something along the lines of:

  1. Create a Serializer
  2. Create a module in the views.py called run-module that calls the serializer
  3. Update the urls.py file.

Feel free to send me any hints that you know about.
It may take a little while for the pull request to be submitted.

@n3l5
Copy link
Author

n3l5 commented Dec 14, 2020

I won't be of any help, at least not immediately, to help build this; but I'll take a peek and see if I can come up with something. Can for sure help with any testing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants