Reference

Version

src.PyReprism.__version__

Current PyReprism version.

Python

class PyReprism.languages.python.Python

Bases: object

This is the class for processing Python source code

__init__()
__module__ = 'PyReprism.languages.python'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify Python boolean literals.

Returns:

A compiled regex pattern to match Python boolean literals and None.

Return type:

re.Pattern

static comment_regex() Pattern

Compile and return a regular expression pattern to identify different types of comments and non-comment code in Python source files.

Returns:

A compiled regex pattern with named groups to match single-line comments, multiline comments, and non-comment code elements.

Return type:

re.Pattern

static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify Python delimiters.

Returns:

A compiled regex pattern to match Python delimiters.

Return type:

re.Pattern

static file_extension() str

Return the file extension used for Python files.

Returns:

The file extension for Python files.

Return type:

str

static keywords() list

Return a list of Python keywords and built-in functions.

Returns:

A list of Python keywords and built-in function names.

Return type:

list

static keywords_regex() Pattern

Compile and return a regular expression pattern to identify Python keywords.

Returns:

A compiled regex pattern to match Python keywords.

Return type:

re.Pattern

static number_regex() Pattern

Compile and return a regular expression pattern to identify numeric literals in Python code.

Returns:

A compiled regex pattern to match Python numeric literals, including integers, floats, and complex numbers.

Return type:

re.Pattern

static operator_regex() Pattern

Compile and return a regular expression pattern to identify Python operators.

Returns:

A compiled regex pattern to match various Python operators and logical keywords.

Return type:

re.Pattern

static remove_comments(source_code: str, isList: bool = False) str

Remove comments from the provided Python source code string.

Parameters:
  • source_code (str) – The Python source code from which to remove comments.

  • isList (bool) – (Optional) A flag indicating if the input is a list of source code lines. This parameter is not used in the function logic.

Returns:

The source code with all comments removed.

Return type:

str

static remove_keywords(source: str) str

Remove all Python keywords from the provided source code string.

Parameters:

source (str) – The source code string from which to remove Python keywords.

Returns:

The source code string with all Python keywords removed.

Return type:

str

Java

class PyReprism.languages.java.Java

Bases: object

__init__()
__module__ = 'PyReprism.languages.java'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify Java boolean literals.

Returns:

A compiled regex pattern to match Java boolean literals.

Return type:

re.Pattern

static comment_regex() Pattern

Compile and return a regular expression pattern to identify different types of comments and non-comment code in Java source files.

Returns:

A compiled regex pattern with named groups to match single-line comments, multiline comments, and non-comment code elements.

Return type:

re.Pattern

static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify Java delimiters.

Returns:

A compiled regex pattern to match Java delimiters.

Return type:

re.Pattern

static file_extension() str

Return the file extension used for Java files.

Returns:

The file extension for Java files.

Return type:

str

static keywords() list

Return a list of Java keywords and built-in functions.

Returns:

A list of Java keywords and built-in function names.

Return type:

list

static keywords_regex() Pattern

Compile and return a regular expression pattern to identify Java keywords.

Returns:

A compiled regex pattern to match Java keywords.

Return type:

re.Pattern

static number_regex() Pattern

Compile and return a regular expression pattern to identify numeric literals in Java code.

Returns:

A compiled regex pattern to match Java numeric literals, including integers, floats, and complex numbers.

Return type:

re.Pattern

static operator_regex() Pattern

Compile and return a regular expression pattern to identify Java operators.

Returns:

A compiled regex pattern to match various Java operators and logical keywords.

Return type:

re.Pattern

static remove_comments(source_code: str) str

Remove comments from the provided Java source code string.

Parameters:

source_code (str) – The Java source code from which to remove comments.

Returns:

The source code with all comments removed.

Return type:

str

static remove_keywords(source: str) str

Remove all Java keywords from the provided source code string.

Parameters:

source (str) – The source code string from which to remove Java keywords.

Returns:

The source code string with all Java keywords removed.

Return type:

str

C++

class PyReprism.languages.cpp.CPP

Bases: object

__init__()
__module__ = 'PyReprism.languages.cpp'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify C++ boolean literals.

Returns:

A compiled regex pattern to match C++ boolean literals.

Return type:

re.Pattern

static comment_regex() Pattern

Compile and return a regular expression pattern to identify different types of comments and non-comment code in C source files.

Returns:

A compiled regex pattern with named groups to match single-line comments, multiline comments, and non-comment code elements.

Return type:

re.Pattern

static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify C and C++ delimiters.

Returns:

A compiled regex pattern to match C and C++ delimiters.

Return type:

re.Pattern

static file_extension() str

Return the file extension used for C++ files.

Returns:

The file extension for C++ files.

Return type:

str

static keywords() list

Return a list of C++ keywords and built-in functions.

Returns:

A list of C++ keywords and built-in function names.

Return type:

list

static keywords_regex() Pattern

Return a list of C++ keywords and built-in functions.

Returns:

A list of C++ keywords and built-in function names.

Return type:

list

static number_regex() Pattern

Compile and return a regular expression pattern to identify numeric literals in C++ code.

Returns:

A compiled regex pattern to match C++ numeric literals, including integers, floats, and complex numbers.

Return type:

re.Pattern

static operator_regex() Pattern

Compile and return a regular expression pattern to identify C++ operators.

Returns:

A compiled regex pattern to match various C++ operators and logical keywords.

Return type:

re.Pattern

static remove_comments(source_code: str) str

Remove comments from the provided C++ source code string.

Parameters:

source_code (str) – The C++ source code from which to remove comments.

Returns:

The source code with all comments removed.

Return type:

str

static remove_keywords(source: str) str

Remove all C++ keywords from the provided source code string.

Parameters:

source (str) – The source code string from which to remove C++ keywords.

Returns:

The source code string with all C++ keywords removed.

Return type:

str

C

class PyReprism.languages.c.C

Bases: object

__init__()
__module__ = 'PyReprism.languages.c'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify C boolean literals.

Returns:

A compiled regex pattern to match C boolean literals.

Return type:

re.Pattern

static comment_regex() Pattern

Compile and return a regular expression pattern to identify different types of comments and non-comment code in C source files.

Returns:

A compiled regex pattern with named groups to match single-line comments, multiline comments, and non-comment code elements.

Return type:

re.Pattern

static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify C and C++ delimiters.

Returns:

A compiled regex pattern to match C and C++ delimiters.

Return type:

re.Pattern

static file_extension() str

Return the file extension used for C files.

Returns:

The file extension for C files.

Return type:

str

static keywords() list

Return a list of C keywords and built-in functions.

Returns:

A list of C keywords and built-in function names.

Return type:

list

static keywords_regex() Pattern

Compile and return a regular expression pattern to identify C keywords.

Returns:

A compiled regex pattern to match C keywords.

Return type:

re.Pattern

static number_regex() Pattern

Compile and return a regular expression pattern to identify numeric literals in C code.

Returns:

A compiled regex pattern to match C numeric literals, including integers, floats, and complex numbers.

Return type:

re.Pattern

static operator_regex() Pattern

Compile and return a regular expression pattern to identify C operators.

Returns:

A compiled regex pattern to match various C operators and logical keywords.

Return type:

re.Pattern

static remove_comments(source_code: str) str

Remove comments from the provided C source code string.

Parameters:

source_code (str) – The C source code from which to remove comments.

Returns:

The source code with all comments removed.

Return type:

str

static remove_keywords(source: str) str

Remove all C keywords from the provided source code string.

Parameters:

source (str) – The source code string from which to remove C keywords.

Returns:

The source code string with all C keywords removed.

Return type:

str

Scala

class PyReprism.languages.scala.Scala

Bases: object

__init__()
__module__ = 'PyReprism.languages.scala'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify Scala boolean literals.

This function generates a regular expression that matches the Scala boolean literals true, false, and the special constant null.

Returns:

A compiled regex pattern to match Scala boolean literals and null.

Return type:

re.Pattern

static comment_regex() Pattern
static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify Scala language delimiters.

This function generates a regular expression that matches Scala language delimiters, which include parentheses (), brackets [], braces {}, commas ,, colons :, periods ., semicolons ;, angle brackets <, >, the question mark ?, and the underscore _.

Returns:

A compiled regex pattern to match Scala delimiters.

Return type:

re.Pattern

static file_extension() str
static keywords() list
static keywords_regex() Pattern
static number_regex() Pattern
static operator_regex() Pattern
static remove_comments(source_code: str, isList: bool = False) str

Remove comments from the provided Java source code string.

Parameters:

source_code (str) – The Java source code from which to remove comments.

Returns:

The source code with all comments removed.

Return type:

str

static remove_keywords(source: str) str

Dart

class PyReprism.languages.dart.Dart

Bases: object

__init__()
__module__ = 'PyReprism.languages.dart'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify Dart boolean literals.

This function generates a regular expression that matches the Dart boolean literals true, false, and the special constant null.

Returns:

A compiled regex pattern to match Dart boolean literals and null.

Return type:

re.Pattern

static comment_regex()
static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify Dart language delimiters.

This function generates a regular expression that matches Dart language delimiters, which include parentheses (), brackets [], braces {}, commas ,, colons :, periods ., semicolons ;, and angle brackets <, >.

Returns:

A compiled regex pattern to match Dart delimiters.

Return type:

re.Pattern

static file_extension() str
static keywords() list
static keywords_regex()
static number_regex()
static operator_regex()
static remove_comments(source_code: str, isList: bool = False) str
static remove_keywords(source: str)

Rust

class PyReprism.languages.rust.Rust

Bases: object

__init__()
__module__ = 'PyReprism.languages.rust'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify Rust boolean literals.

This function generates a regular expression that matches the Rust boolean literals true, false, and the special constant None.

Returns:

A compiled regex pattern to match Rust boolean literals and None.

Return type:

re.Pattern

static comment_regex() Pattern
static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify Rust language delimiters.

This function generates a regular expression that matches Rust language delimiters, which include parentheses (), brackets [], braces {}, commas ,, colons :, periods ., semicolons ;, angle brackets <, >, and the question mark ?.

Returns:

A compiled regex pattern to match Rust delimiters.

Return type:

re.Pattern

static file_extension() str
static keywords() list
static keywords_regex() Pattern
static number_regex() Pattern
static operator_regex() Pattern
static remove_comments(source_code: str, isList: bool = False) str

Remove comments from the provided Rust source code string.

Parameters:

source_code (str) – The Rust source code from which to remove comments.

Returns:

The source code with all comments removed.

Return type:

str

static remove_keywords(source: str) str

Kotlin

class PyReprism.languages.kotlin.Kotlin

Bases: object

__init__()
__module__ = 'PyReprism.languages.kotlin'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify Kotlin boolean literals.

This function generates a regular expression that matches the Kotlin boolean literals true, false, and the special constant null.

Returns:

A compiled regex pattern to match Kotlin boolean literals and null.

Return type:

re.Pattern

static comment_regex() Pattern
static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify Kotlin language delimiters.

This function generates a regular expression that matches Kotlin language delimiters, which include parentheses (), brackets [], braces {}, commas ,, colons :, periods ., semicolons ;, angle brackets <, >, and the question mark ?.

Returns:

A compiled regex pattern to match Kotlin delimiters.

Return type:

re.Pattern

static file_extension() str
static keywords() list
static keywords_regex() Pattern
static number_regex() Pattern
static operator_regex() Pattern
static remove_comments(source_code: str, isList: bool = False) str

Remove comments from the provided Kotlin source code string.

Parameters:

source_code (str) – The Kotlin source code from which to remove comments.

Returns:

The source code with all comments removed.

Return type:

str

static remove_keywords(source: str) str

Swift

class PyReprism.languages.swift.Swift

Bases: object

__init__()
__module__ = 'PyReprism.languages.swift'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify Swift boolean literals.

This function generates a regular expression that matches the Swift boolean literals true, false, and the special constant nil.

Returns:

A compiled regex pattern to match Swift boolean literals and nil.

Return type:

re.Pattern

static comment_regex() Pattern
static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify Swift language delimiters.

This function generates a regular expression that matches Swift language delimiters, which include parentheses (), brackets [], braces {}, commas ,, colons :, periods ., semicolons ;, angle brackets <, >, the question mark ?, and the exclamation mark !.

Returns:

A compiled regex pattern to match Swift delimiters.

Return type:

re.Pattern

static file_extension() str
static keywords() list
static keywords_regex() Pattern
static number_regex() Pattern
static operator_regex() Pattern
static remove_comments(source_code: str, isList: bool = False) str

Remove comments from the provided Rust source code string.

Parameters:

source_code (str) – The Rust source code from which to remove comments.

Returns:

The source code with all comments removed.

Return type:

str

static remove_keywords(source: str) str

JavaScript

class PyReprism.languages.javascript.JavaScript

Bases: object

__init__()
__module__ = 'PyReprism.languages.javascript'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify JavaScript boolean literals.

Returns:

A compiled regex pattern to match JavaScript boolean literals.

Return type:

re.Pattern

static comment_regex() Pattern

Compile and return a regular expression pattern to identify different types of comments and non-comment code in JavaScript source files.

Returns:

A compiled regex pattern with named groups to match single-line comments, multiline comments, and non-comment code elements.

Return type:

re.Pattern

static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify JavaScript delimiters.

This function generates a regular expression that matches JavaScript delimiters, including parentheses (), brackets [], braces {}, commas ,, colons :, periods ., semicolons ;, at symbols @, as well as angle brackets < and >.

Returns:

A compiled regex pattern to match JavaScript delimiters.

Return type:

re.Pattern

static file_extension() str

Return the file extension used for JavaScript files.

Returns:

The file extension for Java files.

Return type:

str

static keywords() list

Return a list of JavaScript keywords and built-in functions.

Returns:

A list of JavaScript keywords and built-in function names.

Return type:

list

static keywords_regex() Pattern

Compile and return a regular expression pattern to identify JavaScript keywords.

Returns:

A compiled regex pattern to match JavaScript keywords.

Return type:

re.Pattern

static number_regex() Pattern

Compile and return a regular expression pattern to identify numeric literals in JavaScript code.

Returns:

A compiled regex pattern to match JavaScript numeric literals, including integers, floats, and complex numbers.

Return type:

re.Pattern

static operator_regex() Pattern

Compile and return a regular expression pattern to identify JavaScript operators.

Returns:

A compiled regex pattern to match various JavaScript operators and logical keywords.

Return type:

re.Pattern

static remove_comments(source_code: str, isList: bool = False) str

Remove comments from the provided JavaScript source code string.

Parameters:

source_code (str) – The JavaScript source code from which to remove comments.

Returns:

The source code with all comments removed.

Return type:

str

static remove_keywords(source: str) str

Remove all JavaScript keywords from the provided source code string.

Parameters:

source (str) – The source code string from which to remove JavaScript keywords.

Returns:

The source code string with all JavaScript keywords removed.

Return type:

str

JSX

class PyReprism.languages.jsx.Jsx

Bases: object

__init__()
__module__ = 'PyReprism.languages.jsx'
static boolean_regex() Pattern

Compile and return a regular expression pattern to identify JSX boolean literals.

Returns:

A compiled regex pattern to match JSX boolean literals.

Return type:

re.Pattern

static comment_regex() Pattern

Compile and return a regular expression pattern to identify different types of comments and non-comment code in JSX source files.

Returns:

A compiled regex pattern with named groups to match single-line comments, multiline comments, and non-comment code elements.

Return type:

re.Pattern

static delimiters_regex() Pattern

Compile and return a regular expression pattern to identify JSX delimiters.

This function generates a regular expression that matches JSX delimiters, including parentheses (, brackets [], braces {}, commas ,, colons :, periods ., semicolons ;, at symbols @, as well as angle brackets < and >.

Returns:

A compiled regex pattern to match JSX delimiters.

Return type:

re.Pattern

static file_extension() str

Return the file extension used for JSX files.

Returns:

The file extension for JSX files.

Return type:

str

static keywords() list

Return a list of JSX keywords and built-in functions.

Returns:

A list of JSX keywords and built-in function names.

Return type:

list

static keywords_regex()
static number_regex() Pattern

Compile and return a regular expression pattern to identify numeric literals in JSX code.

Returns:

A compiled regex pattern to match JSX numeric literals, including integers, floats, and complex numbers.

Return type:

re.Pattern

static operator_regex() Pattern

Compile and return a regular expression pattern to identify JSX operators.

Returns:

A compiled regex pattern to match various JSX operators and logical keywords.

Return type:

re.Pattern

static remove_comments(source_code: str, isList: bool = False) str

Remove comments from the provided JSX source code string.

Parameters:

source_code (str) – The JSX source code from which to remove comments.

Returns:

The source code with all comments removed.

Return type:

str

static remove_keywords(source: str) str

Remove all JSX keywords from the provided source code string.

Parameters:

source (str) – The source code string from which to remove JSX keywords.

Returns:

The source code string with all JSX keywords removed.

Return type:

str