Releases: oxij/kisstdlib
Release list
v0.0.13
v0.0.12
[v0.0.12] - 2025-12-03
Fixed
-
kisstdlib/fs.py:realdir: Fixedrealdir(".")to work as expected. -
kisstdlib/itertools_ext.py:nth: Fixed a bug.
Added
-
kisstdlib/parsing.py,kisstdlib/io/adapter.py: ImplementedBytesTransformerand its IO-adapter friends. -
test/test_basics.py: Added better tests fornth. -
test/test_parsing.py,test/test_io.py: Added tests forBytesTransformeradapters.
Changed
-
kisstdlib/io/adapter.py:UpdateFinalizeReader: Reordered arguments a bit. -
kisstdlib/sqlite3_ext.py: Improved debug messages.
v0.0.11
[v0.0.11] - 2025-03-30
Added
-
kisstdlib.fs: introducedrealdir. -
kisstdlib.io.adapter: imported fromhoardy-adb/hoardy_adb/__main__.py, improved a bit.
Removed
-
kisstdlib.argparse_ext: Removedstore_mapandappend_map.These can be implemented with mainstream
argparseby simply settingtype=func.
Changed
-
Updated for
mypy v1.14.1. -
kisstdlib.fs:setup_fs: putpidin front ofprog.
v0.0.10
[v0.0.10] - 2025-03-17
Added
-
kisstdlib.signal_ext: IntroducedGentleSignalInterruptsimplifying the API usage a bit. -
kisstdlib.base: Now re-exportspartialandpartialmethod. -
kisstdlib.string_ext: Introducedpath_escaperand related singletons. -
kisstdlib.logging_ext:ANSILogHandler: Simplified the API by mergingrollbackfunctionality intoflush. -
kisstdlib.fs:-
Introduced
atomic_unlink. -
Introduced
setup_fs, making temp file suffixes configurable.Also,
kisstdlib:setup_kisstdlibnow runs this function too.
-
Fixed
-
kisstdlib.signal_ext: From now on,delay_signal_handlerwill flush delayed signals when raisingSignalInterrupt.This prevents
raise_first_delayed_signalandraise_delayed_signalsfrom raising them again, which was a bug. -
kisstdlib.io.stdio: Fixedprintfto count implicit eols properly. -
kisstdlib.fs:-
iter_subtree: Fixed error format. -
atomic_make_file: Addedfsyncbeforerename, which should have been there.
-
-
kisstdlib:run_kisstdlib_main: Now handlesBrokenPipeErrors when finishing up.
Changed
-
devscript/test-cli-lib.sh: Improved a bit. -
kisstdlib.argparse_ext.py:-
Renamed and registered
OptionallyMarkdownHelpActionashelp_omd, similarly to howargparsedoes it. -
Introduced
store_mapandappend_mapactions.Which do the same thing as
storeandappend, but map values with a given function.
-
-
kisstdlib.fs:-
Replace
fsdecode_maybeandfsencode_maybewith imports fromos.Those functions have this functionality too.
-
DeferredSync:-
Renamed
commit->sync,finish->flush. -
Action deference can now be optional, i.e.
DeferredSynccan now be used to only defer thefsyncalone.
-
-
atomic_*:-
Renamed
dsyncarguments ->sync, now allowing them to bebools.I.e., added no-
fsync/async mode to all of those functions. -
Added
progprogram name and itspidto temp file suffixes.Though, it's configurable via
setup_fs.
-
-
-
kisstdlib:setup_kisstdlib: Simplified the API a bit.Users should now call
setup_delay_signalsthemselves if they need non-defaultsignals.
v0.0.9
[v0.0.9] - 2025-03-10
Changed (1)
-
Renamed
kisstdlib.argparse.bettermodule ->kisstdlib.argparse_ext. -
Renamed
kisstdlib.utilmodule ->kisstdlib.base. -
Renamed
kisstdlib.loggingmodule ->kisstdlib.logging_ext. -
kisstdlib.base:- Renamed
(In|Out|Extra)Type->(A|B|E)Type. - Added more placeholder types, similarly named.
- Re-imported
Decimalhere. - Moved
NumericTypehere. - Renamed
NumericType->AnyNumber. - Moved
BytesLikeand byte sizes here. - Renamed
str_Exception->get_traceback, generalized it a bit. - Renamed
map_optionals->map_optional2list. - Generalized
compose_*callsinto a singlecompose_pipe. - Switched to using positional-only parameters where appropriate.
- Renamed
-
kisstdlib.fs:- Renamed
walk_orderly->iter_subtree, improved its type. - Renamed
describe_walk->describe_forest. - Improved and simplified the API of
describe_forest. - Renamed
fsync_path->fsync_file. - Renamed
fsync_many_paths->fsync_many_files. - Renamed
unlink_many_paths->unlink_many - Improved the behaviour of
unlink_manyandfsync_many_files. - Added
makedirsarguments to all relevant functions.
- Renamed
-
kisstdlib.sorted:SortedIndex: -
Generalized it into an
AbstractSortedIndexwith the originalSortedIndexas its implementation. -
Renamed all internal API methods to
internal_*. -
kisstdlib.io.wrapper:TIOWrappedWriter:- From now on, it allows
eolto bestr. - Improved it a bit.
- From now on, it allows
-
kisstdlib.io.stdio:- Edited it to play nicely with
sys.std(in|out|err).
- Edited it to play nicely with
-
kisstdlib.logging_ext:- Renamed
CountHandler->LogCounter. - In
LogCounter:- Switched to inheriting from
Handlerinstead, for thread safety. - From now on, it will count everything below
INFOasdebugs.
- Switched to inheriting from
- Renamed
Added (1)
-
kisstdlib.base:- Introduced
Numbertype with a bunch of operations for it. - Introduced some more constants.
- Introduced
MissingandMISSING. - Introduced
identity_,const,const_. - Introduced
Maybe,maybe,map_maybe,map_maybe2list. - Introduced
Either,either,map_left,map_right. - Introduced
optional,optional2list. - Introduced
fst,snd. - Introduced
singleton,optlist,optslist. - Introduced
first_defandfirst_ok. - Introduced
flat_exceptions.
- Introduced
-
kisstdlib.string_ext:- Introduced the module.
- Introduced
abbrev. - Introduced
StringLexer, which is a simple parser generator for simple string lexing syntaxes. - Introduced
escaper,escape,unescape, which dolex-style string processing. - Introduced
quoter,url_quote,url_unquote, which do what similarurllib.parsefunctions do, but faster, and with more options. - Introduced a bunch of related constants.
-
kisstdlib.fs:- Introduced
same_file_dataandsame_symlink_data. - Added
sepandsepb. - Introduced
hash_fileandsha256_file.
- Introduced
-
kisstdlib.itertools_ext:- Introduced the module with a bunch of commonly useful iteration-related stuff.
- Introduced
diff_sorted.
-
kisstdlib.time:Timestamp- Implemented
__add__and__sub__.
- Implemented
-
kisstdlib.sorted:AbstractSortedIndex,kisstdlib.sorted:SortedIndex: -
In
internal_from_to:- Added support for reverse walking.
- added support for inclusion and exclusion of bounds.
-
Introduced
internal_from_to_stepwhich addsstepping support to anyinternal_from_to. -
Introduced
iter_rangewhich addspredicatesupport tointernal_from_to_step. -
Introduced a bunch of other convenience functions.
-
kisstdlib.sqlite3_ext:- Introduced the module with a bunch of commonly useful
sqlite3-related stuff.
- Introduced the module with a bunch of commonly useful
-
kisstdlib.signal_ext:- Introduced the module with a bunch of stuff useful for signal handling.
-
kisstdlib.getpass_ext:- Introduced the module with a bunch
getpass-related stuff.
- Introduced the module with a bunch
-
kisstdlib.io.wrapper:TIOWrappedWriter:- Implemented ANSI TTY Escape Sequences support, making a pretty nice API for it.
- Added ANSI box and wrapped text drawing.
- Introduced
terminal_sizeAPI.
Also, note that
TIOWrappedWriter, by default, will automatically fallback to non-ANSI plain-text mode when the output is not a TTY of whenNO_COLOR=1environment variable is set.Also, those newly introduced
ansi_*API functions fallback to plain-text output when ANSI mode is disabled in a way that is designed to work pretty well with very little care taken in the code that uses them.I.e. you can just color things, draw boxes, scroll text around, and etc without care, and it will make the output readable in plain-text mode for you for free.
-
kisstdlib.io.stdio:- Introduced
setup_stdio. - Introduced
printfandprintf_errwith ANSI TTY color support.
- Introduced
-
kisstdlib.logging_ext:- Introduced
ANSILogHandler, which useprintfto render the log very prettily on an ANSI TTY. - Introduced
die. - Introduced
setup_logging. - Re-exported common logging things from
logging.
- Introduced
Removed
-
kisstdlib.fs:- Removed
describe_path,describe_forestis simple enough now.
- Removed
-
kisstdlib.base:- Replaced
firstwith a more general version initertools_ext.
- Replaced
Fixed
-
kisstdlib.fs:iter_subtree:-
From now on it will sort directories as if they have
os.path.sepafter their name.Otherwise,
list(map(first, iter_subtree(..., include_directories=False)))won't be sorted.This was broken since 730b142.
Also, added those separators to the outputs of
describe_forest.
-
-
kisstdlib.failure:CatastrophicFailure:- Implemented
__repr__.
- Implemented
-
kisstdlib.sorted:- Fixed a bug in
internal_from_nearestfound by tests.
- Fixed a bug in
-
kisstdlib.argparse_ext:- In
BetterArgumentParser, fixed it to properly format subparser headers to arbitrarydepth.
- In
Changed (2)
-
kisstdlib.argparse_ext:- Switched to using
kisstdlib.io.stdioandkisstdlib.logging_ext. - Improved and simplified Markdown formatting code.
- Simplified
BetterArgumentParser.format_help, make it play better with defaultargparsethings. - Made
MarkdownBetterHelpFormatterproduce proper Markdown headers independent ofwidth. - Improved
BetterArgumentParserdefaults.
- Switched to using
Added (2)
-
kisstdlib.argparse_ext:- Introduced
OptionallyMarkdownHelpAction. - Implemented
--helpand--markdowndirectly inBetterArgumentParser. - Introduced
make_argparser_and_run.
- Introduced
-
kisstdlib:- Introduced
setup_kisstdlibandrun_kisstdlib_main. - Re-exported all the commonly useful things.
- Introduced
-
Examples:
- Added a bunch of new examples.
-
Tests:
- Added a bunch more
./test/*unit tests. - Added
./test-example.shwith fixed-output tests testing that examples produce the same results between versions.
- Added a bunch more
Changed (3)
-
Renamed
describe-dirscript ->describe-forest. -
describe-forest:- Improved
describe-forest--help. - Added
describe-forest --version. - Added more command-line options.
- Improved output format.
- Improved
-
test-cli-lib.sh:- Added a bunch more functions there.
- Generalized and simplified it all.
- Improved logging.
-
*:- Improved documentation and docstrings.