Skip to content

Commit

Permalink
πŸ—“ Jun 9, 2024 8:28:49β€―PM
Browse files Browse the repository at this point in the history
πŸ™ optional encoding flag for load_file
✨ parse_csv
✨ parse_sqlite
πŸ€– types added/updated
  • Loading branch information
securisec committed Jun 10, 2024
1 parent 1dbc03b commit 0f4a236
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chepy/chepy_plugins
Submodule chepy_plugins updated 1 files
+3 βˆ’5 chepy_html.py
5 changes: 3 additions & 2 deletions chepy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,11 +997,12 @@ def load_dir(self, pattern: str = "*"):
return self

@ChepyDecorators.call_stack
def load_file(self, binary_mode: bool = False):
def load_file(self, binary_mode: bool = False, encoding: Union[str, None]=None):
"""If a path is provided, load the file
Args:
binary_mode (bool, optional): Force load in binary mode.
encoding (Union[str, None], optional): Encoding for string.
Returns:
Chepy: The Chepy object.
Expand All @@ -1017,7 +1018,7 @@ def load_file(self, binary_mode: bool = False):
self.states[self._current_index] = bytearray(f.read())
else:
try:
with open(path, "r") as f: # type: ignore
with open(path, "r", encoding=encoding) as f: # type: ignore
self.states[self._current_index] = f.read()
except UnicodeDecodeError:
with open(path, "rb") as f:
Expand Down
2 changes: 1 addition & 1 deletion chepy/core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ChepyCore:
def http_request(self: ChepyCoreT, method: str=..., params: dict=..., json: dict=..., headers: dict=..., cookies: dict=...) -> ChepyCoreT: ...
def load_from_url(self: ChepyCoreT, method: str=..., params: dict=..., json: dict=..., headers: dict=..., cookies: dict=...) -> ChepyCoreT: ...
def load_dir(self: ChepyCoreT, pattern: str=...) -> ChepyCoreT: ...
def load_file(self: ChepyCoreT, binary_mode: bool=...) -> ChepyCoreT: ...
def load_file(self: ChepyCoreT, binary_mode: bool=..., encoding: Union[str, None]=...) -> ChepyCoreT: ...
def write_to_file(self: ChepyCoreT, path: str) -> None: ...
def write_binary(self: ChepyCoreT, path: str) -> None: ...
@property
Expand Down
46 changes: 45 additions & 1 deletion chepy/modules/dataformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
import string
import itertools
import quopri
import io
import csv
import sqlite3
import collections
from random import randint
from .internal.constants import Encoding
from .internal.helpers import (
Expand Down Expand Up @@ -155,7 +159,7 @@ def dict_to_json(self) -> DataFormatT:
return self

@ChepyDecorators.call_stack
def dict_get_items(self, *keys) -> DataFormatT:
def dict_get_items(self, *keys: str) -> DataFormatT:
"""Get items from a dict. If no keys are specified, it will return all items.
Returns:
Expand Down Expand Up @@ -2220,3 +2224,43 @@ def decrement_bytes(self, n: int) -> DataFormatT:
hold.append(d - count)
self.state = bytes(hold)
return self

@ChepyDecorators.call_stack
def parse_csv(self) -> DataFormatT:
"""Parse a csv file. Returns a list of dict objects.
Returns:
Chepy: The Chepy object.
"""
data = io.StringIO(self._convert_to_str())
rows = csv.DictReader(data)
self.state = [x for x in rows]
return self

@ChepyDecorators.call_stack
def parse_sqlite(self, query: str) -> DataFormatT:
"""Parse sqlite db and run queries against it. Returns an array of dict objects with column as key and value
Args:
query (str): SQL Query
Returns:
Chepy: The Chepy object.
"""
data = self._convert_to_bytes()
query = self._bytes_to_str(query)
conn = sqlite3.connect(":memory:")
conn.deserialize(data)
cursor = conn.cursor()

cursor.execute(query)

rows = cursor.fetchall()
hold = []
columns = [col[0] for col in cursor.description]

for r in rows:
hold.append(dict(collections.OrderedDict(zip(columns, r))))

self.state = hold
return self
2 changes: 2 additions & 0 deletions chepy/modules/dataformat.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,5 @@ class DataFormat(ChepyCore):
def to_rison(self: DataFormatT) -> DataFormatT: ...
def increment_bytes(self: DataFormatT, n: int) -> DataFormatT: ...
def decrement_bytes(self: DataFormatT, n: int) -> DataFormatT: ...
def parse_csv(self: DataFormatT) -> DataFormatT: ...
def parse_sqlite(self, query: str) -> DataFormatT: ...
23 changes: 23 additions & 0 deletions tests/test_dataformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,3 +794,26 @@ def test_inc_dec_bytes():
Chepy("flag{bb154bdf002a620db657b8df84a87064}").increment_bytes(1).o
== b"gmbh|cc265ceg113b731ec768c9eg95b98175~"
)


def test_parse_csv():
csv_data = """index,url,title,visit
1,http://example.com,Example,1
2,http://example.org,Example Org,2
3,http://example.net,Example Net,3"""
assert (
Chepy(csv_data).parse_csv().get_by_index(0).get_by_key("title").o == b"Example"
)


def test_parse_sqlite():
data = "U1FMaXRlIGZvcm1hdCAzABAAAQEAQCAgAAAABAAAAAIAAAAAAAAAAAAAAAMAAAAEAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAC5m6A0AAAABD6QAD6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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