- add AUTO_CAST to
morebuiltins.utils.Validatorfor automatic type conversion - add --dry-run/--test to cmd.systemd
- fix
morebuiltins.utils.Validatorwhile type is Union / Optional
- add
morebuiltins.funcs.async_callto automatically call a function asynchronously, whether it's sync or async. - add
morebuiltins.funcs.countdownto print a countdown timer inline in the console. - update
morebuiltins.utils.code_inlineusing zlib instead of gzip. - add
morebuiltins.utils.Validatorstring alias for bool typeValidatornow supports string values like "true", "false", "1", "0", "yes", "no", "on", "off" for boolean fields.
- fix writer.wait_closed() ConnectionResetError in ipc.py, proxy_checker.py, log_server.py
- add
morebuiltins.funcs.debouncedecorator to debounce function calls. - add
separg tomorebuiltins.utils.gen_idto customize the separator between date and time. - add
LoggerStreamtomorebuiltins.logsto redirect sys.stdout/sys.stderr with prefix.- Use
sys.stdout = LoggerStream()to redirect all stdout to LoggerStream, which sends logs to the logging system / file / custom writer. LoggerStream.replace_print_ctx: A context manager to temporarily replace the print function within a block of code.- add time prefix to each print line.
- Use
- add
nofmtextra field support tomorebuiltins.cmd.log_serverto skip formatting for high-frequency/thinking logs. - add
scriptsentry topyproject.tomlformorebuiltinscommand line tool.- now you can run
uvx morebuiltins morebuiltins.cmd.log_serverto start log server with uvx.
- now you can run
- fix
morebuiltins.utils.gen_idwrong length issue. - fix
morebuiltins.funcs.LineProfilerto handle nested function calls correctly. - update
morebuiltins.cmd.log_serverto support close idle file handlers after 300 seconds. - add
get_loggertomorebuiltins.cmd.log_serverto get a singleton logger withSocketHandlerto send logs toLogServer. - [Compatibility Warnings] Refactor of
morebuiltins.cmd.log_server:- use
LogSettingstruct instead of untyped dict, client send dict withLogSettingstructure. - add
level_specsfilter to specify log levels of files, like[logging.ERROR, logging.CRITICAL]. - add cache file for log settings, readable by both server and human.
- THIS IS A BREAKING CHANGE, old clients may not work with new server.
- use
- add
morebuiltins.logs.LogHelper.handle_crashto log uncaught exceptions. - fix
morebuiltins.logs.LogHelper.bind_handlerto avoid adding duplicate queue handlers. - update default format of
morebuiltins.logs.LogHelperto"%(asctime)s | %(levelname)-5s | %(filename)+8s:%(lineno)+3s - %(message)s".
- fix typing-hint for
morebuiltins.funcs.threadsdecorator, now it returnsCallable[..., Future]. - add force kill methods to
morebuiltins.shared_memory.PLock:- add
force_signumtomorebuiltins.shared_memory.PLock, to specify the signal number to force kill the process if it exists. - add
is_freetomorebuiltins.shared_memory.PLock, to check if the lock is free. - add
kill_with_nametomorebuiltins.shared_memory.PLock, to kill the process with the given name and signal number.
- add
- add
morebuiltins.logs.LogHelperto quickly bind a logging handler to a logger, with a StreamHandler or SizedTimedRotatingFileHandler. - Compatibility Warnings:
- move
async_logger,AsyncQueueListener,LogHelper,RotatingFileWriter, andSizedTimedRotatingFileHandlerfrommorebuiltins.funcstomorebuiltins.logs.
- move
- add
ContextFilterfor logging, to add context variables to log records. - add
queuearg tomorebuiltins.logs.LogHelper.bind_handler, to enable async logging withAsyncQueueListener. (like loguru's queue=True)
- add
check_recursiontomorebuiltins.funcs, to check if a function is recursive. - add
SharedBytestomorebuiltins.shared_memory, a shared memory for bytes, similar tomultiprocessing.shared_memory.SharedMemorywith a header for size. - add
line_profilerdecorator tomorebuiltins.funcs, to profile function execution time line by line.
- Compatibility Warning. rename
morebuiltins.functoolstomorebuiltins.funcsto avoid conflict withfunctoolsin python standard library. - add
key_typearg tosqlite.KV, to supportintkey. - add
utils.cut_fileto cut file witha+bmode to limit the file size - add recheck for
utils.set_pid_file - add
shared_memory.PLockfor singleton process withmultiprocessing.shared_memory, support linux and windows. - add
--StandardOutputand--StandardErrortomorebuiltins.cmd.systemd.service, and update--Environmentto list type. - add
is_port_freetomorebuiltins.ipc.
- add
sqlite.KV: A key-value store using sqlite3, lightweightsqlitedict.
- Change the default alphabet in
utils.base_encodeto "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", which follows the order of ASCII characters. - add
utils.SnowFlakefor id generator
- add
utils.get_sizeto get size of objects recursively. - add
base_encode, base_decode, gen_id, timetitoutils - add alias for AsyncQueueListener:
functools.async_logger
- add
snippets.sql.SqliteSQLas Sqlite SQL generator - add
cmd.parse_depsto parse dependencies of a project directory, and find circular dependencies. - add
cmd.os.linux.systemd.serviceandcmd.os.linux.systemd.timer - add
functools.to_thread, same asasyncio.to_threadin python 3.9+. - add
functools.AsyncQueueListenerfor asyncio non-block logging. - fix systemd.timer typing hint error
- add
utils.i2bandutils.b2i, integer and fixed-length byte strings conversion. - add
--compresstocmd.log_server - add
snippets.event.EventTemplate
- fix
utils.code_inlinegzip compressmtimeto 1, to ensure the same compressed data - fix
utils.FileDict.save - add
ipc.QueueManagerbased on BaseManager, add JSON listener - add
compress,ensure_dirarg tofuntools.SizedTimedRotatingFileHandler - add
compressarg tofuntools.RotatingFileWriter - update
utils.format_errordefault filter skip from "site-packages" to "-packages"
- add filename_filter to utils.format_error
- add
functools.get_functionto find function from entrypoint- set the type default to str while strict=False and no default/annotation
- add
defaultbutton_texttoTKit.ask_text - add
morebuiltins.cmd.uiwith--cli/--gui,--web- try
python -m morebuiltins.cmd.ui -e re:findall --cli - try
python -m morebuiltins.cmd.ui -e re:findall --gui1 - try
python -m morebuiltins.cmd.ui -e re:findall --gui2 - try
python -m morebuiltins.cmd.ui -e test_func_web --web --web-open --web-timeout=30
- try
- add default doc for
morebuiltins.cmd.ui--gui morebuiltins.functools.FuncSchemachangedparsewill see arg type asstrwhile strict=False and no default/annotation- add
to_stringto FuncSchema
- add
utils.get_hash_int
- modify default args for
cmd.proxy_checker
- add
morebuiltins.cmd.proxy_checker--max-result for quick return - fix
morebultins.cmd.log_serverlost log in high frequency writing
- add
cmd.proxy_checkerpython -m morebuiltins.cmd.proxy_checker -cto check proxy, input from clipboard and output to clipboard
- add utils.Clipboard as same api as pyperclip
- add
cmd.log_server - add start_callback end_callback to
ipc.SocketServer- ipc: self.handler(self, item) -> self.handler(item)
- add
RotatingFileWriter.flush, and default flush=False - fix
StreamWriter.__del__fails if event loop is already closed
- update 2024.08.07 zipapps https://github.com/ClericPy/zipapps/releases/tag/2024.08.07
- add
functools.RotatingFileWriter- prepare for
log_serverwithasyncio+ipc.SocketLogHandlerEncoder
- prepare for
- fix default_dict type-hint
- fix read num zero div
- add build_opener_handlers+proxy to request.req
- add
utils.PathLock
- add
functools.file_import
- fix
utils.Validatortyping-hint class
- add
add py.typed - update
utils.Validatordefault toSTRICT=True
- fix
functools.func_cmdmulti-line docstring - add
utils.FileDict
- add
functools.get_type_default - add
functools.func_cmd - add
emails.SimpleEmail
- update
utils.unix_rlimitdefault to None - add
utils.weight_dict - add
utils.SimpleFilter
functools.FuncSchema.parsedefault strict=True
- add
tk.TextWindow - add
utils.unix_rlimit - release as the first stable version
- add
tk.TKit.ask_text - focus_force for
tk.TKit
- update default format of
utils.format_error - add
functools.SizedTimedRotatingFileHandler - add
utils.switch_flush_print - add
tk.TKit
- add
utils.is_running_linux,utils.is_running_win32 - add
functools.InlinePB - add
date.ScheduleTimer,date.Crontab
- add
utils.xor_encode_decode - add
utils.is_running,utils.lock_pid_file - add
request.make_response - add
utils.get_paste(tk),utils.set_clip(win32) - add
utils.custom_dns - update
utils.format_errorsupport slice index