-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from intezer/feature/docs
docs: add documentation to some classes
- Loading branch information
Showing
21 changed files
with
481 additions
and
92 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = 'Intezer Python SDK' | ||
copyright = '2023, Intezer' | ||
author = 'Intezer' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = [ | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.autosummary', | ||
# 'sphinx.ext.viewcode', | ||
# 'sphinx.ext.napoleon' | ||
] | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
|
||
import os | ||
import sys | ||
sys.path.insert(0, os.path.abspath('..')) | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'sphinx_rtd_theme' | ||
html_static_path = ['_static'] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.. Intezer Python SDK documentation master file, created by | ||
sphinx-quickstart on Wed Feb 8 13:33:44 2023. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to Intezer Python SDK's documentation! | ||
============================================== | ||
|
||
|
||
GitHub (code repository, issues): https://github.com/intezer//analyze-python-sdk | ||
|
||
PyPI (installable, stable distributions): https://pypi.org/project/intezer-sdk. You can install Injector using pip:: | ||
|
||
pip install intezer-sdk | ||
|
||
Intezer SDK works with CPython 3.6+ . | ||
|
||
The SDK wraps Intezer Analyze API 2.0 (`View full API documentation <https://analyze.intezer.com/api-docs.html>`_) | ||
|
||
Setup | ||
##### | ||
Intezer works with global api configuration configured with and API key | ||
|
||
.. code-block:: python | ||
api.set_global_api('<api_key>') | ||
Basic Usage | ||
=========== | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
modules | ||
|
||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
intezer\_sdk package | ||
==================== | ||
|
||
Submodules | ||
---------- | ||
|
||
intezer\_sdk.account module | ||
------------------------------------- | ||
|
||
.. automodule:: intezer_sdk.account | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
intezer\_sdk.analyses\_history module | ||
------------------------------------- | ||
|
||
.. automodule:: intezer_sdk.analyses_history | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
:exclude-members: generate_analyses_history_filter | ||
|
||
intezer\_sdk.analyses\_results module | ||
------------------------------------- | ||
|
||
.. automodule:: intezer_sdk.analyses_results | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
intezer\_sdk.analysis module | ||
---------------------------- | ||
|
||
.. automodule:: intezer_sdk.analysis | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
:exclude-members: get_url_analysis_by_id, get_latest_analysis, get_file_analysis_by_id, get_analysis_by_id | ||
|
||
intezer\_sdk.api module | ||
----------------------- | ||
|
||
.. automodule:: intezer_sdk.api | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
:exclude-members: IntezerApi, raise_for_status | ||
|
||
intezer\_sdk.base\_analysis module | ||
---------------------------------- | ||
|
||
.. automodule:: intezer_sdk.base_analysis | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
intezer\_sdk.consts module | ||
-------------------------- | ||
|
||
.. automodule:: intezer_sdk.consts | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
intezer\_sdk.endpoint\_analysis module | ||
-------------------------------------- | ||
|
||
.. automodule:: intezer_sdk.endpoint_analysis | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
intezer\_sdk.errors module | ||
-------------------------- | ||
|
||
.. automodule:: intezer_sdk.errors | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
intezer\_sdk.family module | ||
-------------------------- | ||
|
||
.. automodule:: intezer_sdk.family | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
intezer\_sdk.index module | ||
------------------------- | ||
|
||
.. automodule:: intezer_sdk.index | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
intezer\_sdk.operation module | ||
----------------------------- | ||
|
||
.. automodule:: intezer_sdk.operation | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
intezer\_sdk.sub\_analysis module | ||
--------------------------------- | ||
|
||
.. automodule:: intezer_sdk.sub_analysis | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
intezer\_sdk.util module | ||
------------------------ | ||
|
||
.. automodule:: intezer_sdk.util | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: intezer_sdk | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=. | ||
set BUILDDIR=_build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
intezer_sdk | ||
=========== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
intezer_sdk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sphinx | ||
sphinx-rtd-theme |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import datetime | ||
from typing import Dict | ||
from typing import Optional | ||
from typing import Union | ||
|
||
from intezer_sdk._api import IntezerApi | ||
from intezer_sdk.operation import Operation | ||
|
||
|
||
def handle_operation(operations: Dict[str, Operation], | ||
api: IntezerApi, | ||
operation: str, | ||
result_url: str, | ||
wait: Union[bool, int], | ||
wait_timeout: Optional[datetime.timedelta]) -> Operation: | ||
if operation not in operations: | ||
operations[operation] = Operation(result_url, operation, api=api.api) | ||
|
||
if wait: | ||
if isinstance(wait, bool): | ||
operations[operation].wait_for_completion(sleep_before_first_check=True, | ||
wait_timeout=wait_timeout) | ||
else: | ||
operations[operation].wait_for_completion(wait, | ||
sleep_before_first_check=True, | ||
wait_timeout=wait_timeout) | ||
|
||
return operations[operation] |
Oops, something went wrong.