-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jack Cherng <[email protected]>
- Loading branch information
Showing
20 changed files
with
585 additions
and
185 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
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
from magika import magika as magika, prediction_mode as prediction_mode | ||
|
||
Magika = magika.Magika | ||
MagikaError = magika.MagikaError | ||
PredictionMode = prediction_mode.PredictionMode | ||
from magika import magika as magika | ||
from magika.types import content_type_label as content_type_label, magika_error as magika_error, prediction_mode as prediction_mode | ||
|
||
__version__: str | ||
Magika = magika.Magika | ||
MagikaError = magika_error.MagikaError | ||
ContentTypeLabel = content_type_label.ContentTypeLabel | ||
PredictionMode = prediction_mode.PredictionMode |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
from magika.content_types import ContentType as ContentType, ContentTypesManager as ContentTypesManager | ||
from magika.logger import get_logger as get_logger | ||
from magika.prediction_mode import PredictionMode as PredictionMode | ||
from magika.types import MagikaOutputFields as MagikaOutputFields, MagikaResult as MagikaResult, ModelFeatures as ModelFeatures, ModelOutput as ModelOutput, ModelOutputFields as ModelOutputFields | ||
from magika.seekable import Buffer as Buffer, File as File, Seekable as Seekable | ||
from magika.types import ContentTypeInfo as ContentTypeInfo, ContentTypeLabel as ContentTypeLabel, MagikaError as MagikaError, MagikaPrediction as MagikaPrediction, MagikaResult as MagikaResult, ModelConfig as ModelConfig, ModelFeatures as ModelFeatures, ModelOutput as ModelOutput, PredictionMode as PredictionMode, Status as Status | ||
from pathlib import Path | ||
from typing import List, Optional | ||
|
||
DEFAULT_MODEL_NAME: str | ||
|
||
class Magika: | ||
def __init__(self, model_dir: Optional[Path] = None, prediction_mode: PredictionMode = ..., no_dereference: bool = False, verbose: bool = False, debug: bool = False, use_colors: bool = False) -> None: ... | ||
def __init__(self, model_dir: Path | None = None, prediction_mode: PredictionMode = ..., no_dereference: bool = False, verbose: bool = False, debug: bool = False, use_colors: bool = False) -> None: ... | ||
def identify_path(self, path: Path) -> MagikaResult: ... | ||
def identify_paths(self, paths: List[Path]) -> List[MagikaResult]: ... | ||
def identify_paths(self, paths: list[Path]) -> list[MagikaResult]: ... | ||
def identify_bytes(self, content: bytes) -> MagikaResult: ... | ||
@staticmethod | ||
def get_default_model_name() -> str: ... | ||
def get_model_name(self) -> str: ... | ||
|
||
class MagikaError(Exception): ... | ||
def get_supported_content_types(self) -> list[ContentTypeLabel]: ... | ||
def get_model_dir_name(self) -> str: ... |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
import abc | ||
from pathlib import Path | ||
|
||
class Seekable(abc.ABC, metaclass=abc.ABCMeta): | ||
def __init__(self) -> None: ... | ||
@property | ||
def size(self) -> int: ... | ||
@abc.abstractmethod | ||
def read_at(self, offset: int, size: int) -> bytes: ... | ||
def close(self) -> None: ... | ||
|
||
class File(Seekable): | ||
def __init__(self, path: Path) -> None: ... | ||
def read_at(self, offset: int, size: int) -> bytes: ... | ||
def close(self) -> None: ... | ||
|
||
class Buffer(Seekable): | ||
def __init__(self, buffer: bytes) -> None: ... | ||
def read_at(self, offset: int, size: int) -> bytes: ... |
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
from magika.types.content_type_info import ContentTypeInfo as ContentTypeInfo | ||
from magika.types.content_type_label import ContentTypeLabel as ContentTypeLabel | ||
from magika.types.magika_error import MagikaError as MagikaError | ||
from magika.types.magika_prediction import MagikaPrediction as MagikaPrediction | ||
from magika.types.magika_result import MagikaResult as MagikaResult | ||
from magika.types.model import ModelConfig as ModelConfig, ModelFeatures as ModelFeatures, ModelOutput as ModelOutput | ||
from magika.types.prediction_mode import PredictionMode as PredictionMode | ||
from magika.types.status import Status as Status | ||
|
||
__all__ = ['ContentTypeInfo', 'ContentTypeLabel', 'MagikaError', 'MagikaPrediction', 'MagikaResult', 'ModelConfig', 'ModelFeatures', 'ModelOutput', 'PredictionMode', 'Status'] |
Oops, something went wrong.