jz_python_chest package

Submodules

jz_python_chest.aiofiles_example module

async jz_python_chest.aiofiles_example.main()[source]
async jz_python_chest.aiofiles_example.read_file(filepath)[source]

Asynchronous read a file

jz_python_chest.aiofiles_yield module

async jz_python_chest.aiofiles_yield.main()[source]

Example usage of the read_file_lines function. Reads and prints each line from the specified file.

async jz_python_chest.aiofiles_yield.read_file_lines(filepath)[source]

Asynchronous generator function to read a file line by line.

Parameters:

filepath (str) – The path to the file to read.

Yields:

str – Each line of the file stripped of leading/trailing whitespace.

jz_python_chest.aiohttp_example module

async jz_python_chest.aiohttp_example.fetch_url(session, url)[source]

Asynchronously fetch data from a URL.

Parameters:
  • session (aiohttp.ClientSession) – The active session used for making requests.

  • url (str) – The URL to fetch data from.

Returns:

The content retrieved from the URL.

Return type:

str

async jz_python_chest.aiohttp_example.main()[source]

Main function to concurrently fetch data from multiple URLs using aiohttp and asyncio.

jz_python_chest.cachetools_example module

jz_python_chest.callback_example module

class jz_python_chest.callback_example.Callback[source]

Bases: object

on_epoch_begin(epoch, logs=None)[source]
on_train_begin(logs=None)[source]
on_train_end(logs=None)[source]
on_train_epoch_end(epoch, logs=None)[source]
on_train_step_end(step, logs=None)[source]
class jz_python_chest.callback_example.Model[source]

Bases: object

train_step()[source]
class jz_python_chest.callback_example.PrintEpochCallback[source]

Bases: Callback

on_train_epoch_end(epoch, logs=None)[source]
class jz_python_chest.callback_example.PrintStepCallback[source]

Bases: Callback

on_train_step_end(step, logs=None)[source]
class jz_python_chest.callback_example.PrintTrainBeginCallback[source]

Bases: Callback

on_train_begin(logs=None)[source]
class jz_python_chest.callback_example.PrintTrainEndCallback[source]

Bases: Callback

on_train_end(logs=None)[source]
class jz_python_chest.callback_example.Trainer(model, callbacks=None)[source]

Bases: object

train(epochs, steps_per_epoch)[source]

jz_python_chest.jsonpath_ng_example module

jz_python_chest.redis_example module

jz_python_chest.remove_empty_lines_example module

jz_python_chest.remove_empty_lines_example.get_args()[source]

Parse and return command-line arguments.

Returns:

Parsed command-line arguments containing input_file and output_file paths.

Return type:

argparse.Namespace

jz_python_chest.remove_empty_lines_example.remove_empty_lines(input_file, output_file)[source]

Remove empty lines from the input file and write the non-empty lines to the output file.

Parameters:
  • input_file (str) – Path to the input file.

  • output_file (str) – Path to the output file.

jz_python_chest.tqdm_example module

jz_python_chest.transformers_example module

jz_python_chest.write_parquet module