fastutils
Collection of simple utils.
Install
pip install fastutils
Tested With Python
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
Installed utils
- fastutils.aesutils
- AES_BLOCK_SIZE
- decrypt
- decrypt_and_base64decode
- decrypt_and_safeb64decode
- decrypt_and_unhexlify
- encrypt
- encrypt_and_base64encode
- encrypt_and_hexlify
- encrypt_and_safeb64encode
- get_aes_mode
- get_md5_key
- get_mysql_aes_key
- get_padding_remove_method
- get_raw_aes_key
- get_sha1prng_key
- padding_ansix923
- padding_iso10126
- padding_pkcs5
- remove_padding_ansix923
- remove_padding_iso10126
- remove_padding_pkcs5
- fastutils.cacheutils
- ReqIdCache
- cache
- get_cached_value
- simple_cache
- fastutils.cipherutils
- AesCipher
- AesCtrCipher
- AesGcmCipher
- Base64Encoder
- CipherBase
- DecryptFailed
- EncoderBase
- HexlifyEncoder
- IvCipher
- IvfCipher
- MappingCipher
- MysqlAesCipher
- RawDataEncoder
- RawKeyAesCipher
- RsaCipher
- S12Cipher
- S1Cipher
- S2Cipher
- SafeBase64Encoder
- Utf8Encoder
- aes_padding_ansix923
- aes_padding_iso10126
- aes_padding_pkcs5
- get_aes_mode
- md5_key
- mysql_aes_key
- sha1prng_key
- fastutils.dictutils
- HttpHeadersDict
- Object
- attrgetorset
- attrset
- change
- changes
- deep_merge
- diff
- fix_object
- ignore_none_item
- prefix_key
- select
- to_object
- touch
- update
- fastutils.fsutils
- TemporaryFile
- copy
- expand
- file_content_replace
- filecopy
- first_exists_file
- get_application_config_filepath
- get_application_config_paths
- get_safe_filename
- get_size_deviation
- get_size_display
- get_swap_filename
- get_temp_workspace
- get_unit_size
- info
- load_application_config
- mkdir
- move
- pathjoin
- readfile
- rename
- rm
- safe_write
- size_unit_names
- size_unit_upper_limit
- touch
- treecopy
- write
- fastutils.funcutils
- BunchCallable
- ChainableProxy
- call_with_inject
- chain
- classproperty
- get_all_builtin_exceptions
- get_builtins_dict
- get_class_name
- get_default_values
- get_inject_params
- get_method_help
- get_method_signature
- inspect
- is_a_class
- isclass
- mcall_with_inject
- signature
- try_again_on_error
- fastutils.hashutils
- Base64ResultEncoder
- Blake2BHexlifyPasswordHash
- Blake2BPbkdf2PasswordHash
- Blake2BPbkdf2PasswordHashColon
- Blake2BSimplePasswordHash
- Blake2BSimpleSaltPasswordHash
- Blake2SHexlifyPasswordHash
- Blake2SPbkdf2PasswordHash
- Blake2SPbkdf2PasswordHashColon
- Blake2SSimplePasswordHash
- Blake2SSimpleSaltPasswordHash
- DigestResultEncoder
- HexlifyPasswordHashBase
- HexlifyResultEncoder
- Md5HexlifyPasswordHash
- Md5Pbkdf2PasswordHash
- Md5Pbkdf2PasswordHashColon
- Md5SimplePasswordHash
- Md5SimpleSaltPasswordHash
- PasswordHashMethodBase
- PasswordHashMethodNotSupportError
- Pbkdf2PasswordHashBase
- ResultEncoderBase
- Sha1HexlifyPasswordHash
- Sha1Pbkdf2PasswordHash
- Sha1Pbkdf2PasswordHashColon
- Sha1SimplePasswordHash
- Sha1SimpleSaltPasswordHash
- Sha224HexlifyPasswordHash
- Sha224Pbkdf2PasswordHash
- Sha224Pbkdf2PasswordHashColon
- Sha224SimplePasswordHash
- Sha224SimpleSaltPasswordHash
- Sha256HexlifyPasswordHash
- Sha256Pbkdf2PasswordHash
- Sha256Pbkdf2PasswordHashColon
- Sha256SimplePasswordHash
- Sha256SimpleSaltPasswordHash
- Sha384HexlifyPasswordHash
- Sha384Pbkdf2PasswordHash
- Sha384Pbkdf2PasswordHashColon
- Sha384SimplePasswordHash
- Sha384SimpleSaltPasswordHash
- Sha3_224HexlifyPasswordHash
- Sha3_224Pbkdf2PasswordHash
- Sha3_224Pbkdf2PasswordHashColon
- Sha3_224SimplePasswordHash
- Sha3_224SimpleSaltPasswordHash
- Sha3_256HexlifyPasswordHash
- Sha3_256Pbkdf2PasswordHash
- Sha3_256Pbkdf2PasswordHashColon
- Sha3_256SimplePasswordHash
- Sha3_256SimpleSaltPasswordHash
- Sha3_384HexlifyPasswordHash
- Sha3_384Pbkdf2PasswordHash
- Sha3_384Pbkdf2PasswordHashColon
- Sha3_384SimplePasswordHash
- Sha3_384SimpleSaltPasswordHash
- Sha3_512HexlifyPasswordHash
- Sha3_512Pbkdf2PasswordHash
- Sha3_512Pbkdf2PasswordHashColon
- Sha3_512SimplePasswordHash
- Sha3_512SimpleSaltPasswordHash
- Sha512HexlifyPasswordHash
- Sha512Pbkdf2PasswordHash
- Sha512Pbkdf2PasswordHashColon
- Sha512SimplePasswordHash
- Sha512SimpleSaltPasswordHash
- ShaHexlifyPasswordHash
- ShaPbkdf2PasswordHash
- ShaPbkdf2PasswordHashColon
- ShaSimplePasswordHash
- ShaSimpleSaltPasswordHash
- SimplePasswordHashBase
- SimpleSaltPasswordHashBase
- Sm3HexlifyPasswordHash
- Sm3Pbkdf2PasswordHash
- Sm3Pbkdf2PasswordHashColon
- Sm3SimplePasswordHash
- Sm3SimpleSaltPasswordHash
- Xxh128HexlifyPasswordHash
- Xxh128Pbkdf2PasswordHash
- Xxh128Pbkdf2PasswordHashColon
- Xxh128SimplePasswordHash
- Xxh128SimpleSaltPasswordHash
- Xxh32HexlifyPasswordHash
- Xxh32Pbkdf2PasswordHash
- Xxh32Pbkdf2PasswordHashColon
- Xxh32SimplePasswordHash
- Xxh32SimpleSaltPasswordHash
- Xxh64HexlifyPasswordHash
- Xxh64Pbkdf2PasswordHash
- Xxh64Pbkdf2PasswordHashColon
- Xxh64SimplePasswordHash
- Xxh64SimpleSaltPasswordHash
- algorithms_available
- get_blake2b
- get_blake2b_base64
- get_blake2b_digest
- get_blake2b_hexdigest
- get_blake2s
- get_blake2s_base64
- get_blake2s_digest
- get_blake2s_hexdigest
- get_file_blake2b
- get_file_blake2b_base64
- get_file_blake2b_digest
- get_file_blake2b_hexdigest
- get_file_blake2s
- get_file_blake2s_base64
- get_file_blake2s_digest
- get_file_blake2s_hexdigest
- get_file_hash
- get_file_hash_base64
- get_file_hash_hexdigest
- get_file_hash_result
- get_file_md5
- get_file_md5_base64
- get_file_md5_digest
- get_file_md5_hexdigest
- get_file_sha
- get_file_sha1
- get_file_sha1_base64
- get_file_sha1_digest
- get_file_sha1_hexdigest
- get_file_sha224
- get_file_sha224_base64
- get_file_sha224_digest
- get_file_sha224_hexdigest
- get_file_sha256
- get_file_sha256_base64
- get_file_sha256_digest
- get_file_sha256_hexdigest
- get_file_sha384
- get_file_sha384_base64
- get_file_sha384_digest
- get_file_sha384_hexdigest
- get_file_sha3_224
- get_file_sha3_224_base64
- get_file_sha3_224_digest
- get_file_sha3_224_hexdigest
- get_file_sha3_256
- get_file_sha3_256_base64
- get_file_sha3_256_digest
- get_file_sha3_256_hexdigest
- get_file_sha3_384
- get_file_sha3_384_base64
- get_file_sha3_384_digest
- get_file_sha3_384_hexdigest
- get_file_sha3_512
- get_file_sha3_512_base64
- get_file_sha3_512_digest
- get_file_sha3_512_hexdigest
- get_file_sha512
- get_file_sha512_base64
- get_file_sha512_digest
- get_file_sha512_hexdigest
- get_file_sha_base64
- get_file_sha_digest
- get_file_sha_hexdigest
- get_file_sm3
- get_file_sm3_base64
- get_file_sm3_digest
- get_file_sm3_hexdigest
- get_file_xxh128
- get_file_xxh128_base64
- get_file_xxh128_digest
- get_file_xxh128_hexdigest
- get_file_xxh32
- get_file_xxh32_base64
- get_file_xxh32_digest
- get_file_xxh32_hexdigest
- get_file_xxh64
- get_file_xxh64_base64
- get_file_xxh64_digest
- get_file_xxh64_hexdigest
- get_hash
- get_hash_base64
- get_hash_hexdigest
- get_hash_result
- get_md5
- get_md5_base64
- get_md5_digest
- get_md5_hexdigest
- get_password_hash
- get_password_hash_methods
- get_pbkdf2_blake2b
- get_pbkdf2_blake2s
- get_pbkdf2_hmac
- get_pbkdf2_md5
- get_pbkdf2_sha
- get_pbkdf2_sha1
- get_pbkdf2_sha224
- get_pbkdf2_sha256
- get_pbkdf2_sha384
- get_pbkdf2_sha3_224
- get_pbkdf2_sha3_256
- get_pbkdf2_sha3_384
- get_pbkdf2_sha3_512
- get_pbkdf2_sha512
- get_pbkdf2_sm3
- get_pbkdf2_xxh128
- get_pbkdf2_xxh32
- get_pbkdf2_xxh64
- get_salted_hash_base64
- get_sha
- get_sha1
- get_sha1_base64
- get_sha1_digest
- get_sha1_hexdigest
- get_sha224
- get_sha224_base64
- get_sha224_digest
- get_sha224_hexdigest
- get_sha256
- get_sha256_base64
- get_sha256_digest
- get_sha256_hexdigest
- get_sha384
- get_sha384_base64
- get_sha384_digest
- get_sha384_hexdigest
- get_sha3_224
- get_sha3_224_base64
- get_sha3_224_digest
- get_sha3_224_hexdigest
- get_sha3_256
- get_sha3_256_base64
- get_sha3_256_digest
- get_sha3_256_hexdigest
- get_sha3_384
- get_sha3_384_base64
- get_sha3_384_digest
- get_sha3_384_hexdigest
- get_sha3_512
- get_sha3_512_base64
- get_sha3_512_digest
- get_sha3_512_hexdigest
- get_sha512
- get_sha512_base64
- get_sha512_digest
- get_sha512_hexdigest
- get_sha_base64
- get_sha_digest
- get_sha_hexdigest
- get_sm3
- get_sm3_base64
- get_sm3_digest
- get_sm3_hexdigest
- get_xxh128
- get_xxh128_base64
- get_xxh128_digest
- get_xxh128_hexdigest
- get_xxh32
- get_xxh32_base64
- get_xxh32_digest
- get_xxh32_hexdigest
- get_xxh64
- get_xxh64_base64
- get_xxh64_digest
- get_xxh64_hexdigest
- is_the_same_hash_method
- method_load
- new
- pbkdf2_hmac
- register_hexlify_password_hash
- register_password_hash_method
- register_pbkdf2_password_hash
- register_simple_password_hash
- register_simple_salt_password_hash
- setup_hash_method_loader
- validate_password_hash
- validate_pbkdf2_blake2b
- validate_pbkdf2_blake2s
- validate_pbkdf2_hmac
- validate_pbkdf2_md5
- validate_pbkdf2_sha
- validate_pbkdf2_sha1
- validate_pbkdf2_sha224
- validate_pbkdf2_sha256
- validate_pbkdf2_sha384
- validate_pbkdf2_sha3_224
- validate_pbkdf2_sha3_256
- validate_pbkdf2_sha3_384
- validate_pbkdf2_sha3_512
- validate_pbkdf2_sha512
- validate_pbkdf2_sm3
- validate_pbkdf2_xxh128
- validate_pbkdf2_xxh32
- validate_pbkdf2_xxh64
- fastutils.httputils
- download
- get_sitename
- get_url_filename
- get_url_save_path
- get_urlinfo
- urlparse
- fastutils.imageutils
- get_base64image
- get_image_bytes
- parse_base64image
- resize
- resize_to_fixed_height
- resize_to_fixed_width
- fastutils.jsonutils
- SimpleJsonEncoder
- make_simple_json_encoder
- register_global_encoder
- simple_json_dumps
- fastutils.listutils
- append_new
- chunk
- clean_none
- compare
- compare_execute
- first
- group
- ignore_none_element
- int_list_to_bytes
- is_ordered
- list2dict
- pad
- replace
- topological_sort
- topological_test
- unique
- fastutils.logutils
- get_console_handler
- get_file_handler
- get_simple_config
- setup
- fastutils.msgpackutils
- EmptyMsgData
- Msg
- MsgDecryptFailed
- WrongMsgType
- dumps
- loads
- fastutils.nameutils
- get_last_names
- get_random_name
- get_suggest_first_names
- guess_lastname
- guess_surname
- fastutils.numericutils
- _infinity
- binary_decompose
- bytes2ints
- decimal_change_base
- float_split
- from_bytes
- get_float_part
- infinity
- int2bytes
- ints2bytes
- is_infinity
- ninfinity
- pinfinity
- fastutils.pinyinutils
- to_pinyin
- fastutils.randomutils
- Lcg31Random
- Random
- UuidGenerator
- choices
- get_password_seed32
- uuid1
- uuid3
- uuid4
- uuid5
- fastutils.rsautils
- decrypt
- encrypt
- export_key
- get_hash_method
- load_private_key
- load_public_key
- load_public_key_from_private_key
- newkeys
- sign
- verify
- fastutils.strutils
- BAI
- BASE64_CHARS
- HEXLIFY_CHARS
- QIAN
- SHI
- StrUtils
- URLSAFEB64_CHARS
- WAN
- YI
- binarify
- bytes2ints
- camel
- captital_number
- char_force_to_int
- chunk
- clean
- combinations
- combinations2
- decodable
- default_cn_digits
- default_cn_float_places
- default_cn_negative
- default_cn_places
- default_cn_yuan
- default_encoding
- default_encodings
- default_quotes
- default_random_string_choices
- do_clean
- encodable
- force_float
- force_int
- force_numberic
- force_type_to
- format_with_mapping
- get_all_substrings
- get_base64image
- get_image_bytes
- html_element_css_append
- int2bytes
- ints2bytes
- is_base64_decodable
- is_chinese_character
- is_hex_digits
- is_str_composed_by_the_choices
- is_unhexlifiable
- is_urlsafeb64_decodable
- is_uuid
- join_lines
- no_mapping
- none_to_empty_string
- parse_base64image
- random_string
- remove_prefix
- remove_suffix
- reverse
- simple_cn_yuan
- simplesplit
- smart_get_binary_data
- split
- split2
- str_composed_by
- stringlist_append
- strip_string
- substrings
- text_display_length
- text_display_shorten
- unbinarify
- unquote
- wholestrip
- fastutils.sysutils
- default_timeout_kill
- execute_script
- get_current_thread_id
- get_daemon_application_pid
- get_node_ip
- get_random_script_name
- get_worker_id
- get_worker_info
- psutil_timeout_kill
- fastutils.threadutils
- ConcurrentLimitJobQueue
- Counter
- Future
- JobExecuteTimeout
- JobQueue
- JobResultNotSet
- LoopIdle
- Service
- ServiceStop
- ServiceTerminate
- SimpleConsumer
- SimpleProducer
- SimpleProducerConsumerServer
- SimpleServer
- StartOnTerminatedService
- fastutils.treeutils
- SimpleRouterTree
- build_tree
- print_tree
- print_tree_callback
- tree_walk
- fastutils.typingutils
- Number
- STRING_ENCODINGS
- register_global_caster
- smart_cast
Help
See pydoc for help.
python3 -m pydoc -b # start pydoc
Usage Examples
fastutils.strutils.chunk
from fastutils import strutils
In [33]: strutils.chunk('hello', 3)
Out[33]: ['hel', 'lo']
In [34]: strutils.chunk('hello', 6)
Out[34]: ['hello']
In [35]: strutils.chunk('hello', 5)
Out[35]: ['hello']
fastutils.strutils.get_all_substrings
from fastutils import strutils
In [4]: strutils.get_all_substrings('a')
Out[4]: {'a'}
In [5]: strutils.get_all_substrings('ab')
Out[5]: {'a', 'ab', 'b'}
In [6]: strutils.get_all_substrings('abc')
Out[6]: {'a', 'ab', 'abc', 'b', 'bc', 'c'}
In [7]: strutils.get_all_substrings('abcd')
Out[7]: {'a', 'ab', 'abc', 'abcd', 'b', 'bc', 'bcd', 'c', 'cd', 'd'}
fastutils.listutils.list2dict
In [1]: from fastutils import listutils
In [2]: listutils.list2dict([1,2,3], ['a', 'b'])
Out[2]: {'a': 1, 'b': 2}
In [3]: listutils.list2dict([1,2,3], ['a', 'b', 'c'])
Out[3]: {'a': 1, 'b': 2, 'c': 3}
In [4]: listutils.list2dict([1,2,3], ['a', 'b', 'c', 'd'])
Out[4]: {'a': 1, 'b': 2, 'c': 3, 'd': None}
fastutils.listutils.compare_execute
Example 1
from fastutils import listutils
old_list = [1,2,3]
new_list = [2,3,4]
created, deleted, changed = listutils.compare_execute(
old_data=old_list,
new_data=new_list,
create_callback=lambda key, data: data,
delete_callback=lambda key, instance: instance,
change_callback=lambda key, instance, data: instance,
old_key=lambda x: x
)
assert created == [4]
assert deleted == [1]
assert changed == [2, 3]
Example 2
from fastutils import listutils
old_list = [1,2,3]
new_list = [3,4,5]
def do_create(key, data):
if data > 4:
return data
else:
return None
def do_delete(key, instance):
if instance > 1:
return instance
else:
return None
def do_change(key, instance, data):
return None
created, deleted, changed = listutils.compare_execute(
old_data=old_list,
new_data=new_list,
create_callback=do_create,
delete_callback=do_delete,
change_callback=do_change,
old_key=lambda x: x
)
assert created == [5]
assert deleted == [2]
assert changed == []
Releases
v0.43.4
- Fix rsautils.load_public_key in py2.7.
- Add log_to_console and log_to_file option in logutils.get_simple_config.
v0.43.3
- Improve rsautils.load_public_key to load NON-PEM public key.
v0.43.2
- Improve rsautils.load_private_key to load NON-PEM private key.
v0.43.1
- Unit test problems fix.
- Add cipherutils.AesCtrCipher.
- Add cipherutils.AesGcmCipher.
v0.43.0
- Doc Update.
- Add python_requires in setup.
- Fix sysutils.get_worker_info problem in docker env.
v0.42.14
- Add fastutils.listutils.compare_execute.
- Add fastutils.dictutils.Object.fix to fix the Object instance if you added a dict thing to the Objects' list/dict item.
v0.42.13
- Add fastutils.strutils.get_all_substrings.
- Add fastutils.listutils.list2dict.
v0.42.11
- Fix fastutils.cipherutils.CipherBase incompatibility problem.
v0.43.9
v0.42.8
- Fix threadutils.Counter incr/decr result value duplicate problem.
v0.42.7
- Fix logutils formatter missing problem.
v0.42.6
- Add filelike-methods for fsutils.TemporaryFile.
v0.42.5
- Add TemporaryFile.open and TemporaryFile.close methods.
v0.42.4
- Change rsautils.encrypt default envelope method to PKCS1_OAEP, and rsautils.decrypt support both PKCS1_OAEP and PKCS1_v1_5 methods.
- Add rsautils.sign and resautils.verify methods.
v0.42.3
- Add console_handler_class and file_handler_class parameters for function logutils.get_simple_config.
- Add simple and simple_json formatter in logutils.get_simple_config.
v0.42.2
- Add sysutils.get_worker_info.
- Fix logutils' implicit imports problem.
- Fix funcutils.classproperty.
v0.42.1
v0.42.0
- Add msgpackutils.
- Fix problem in nameutils.
v0.41.1
- Fix numericutils.get_float_part problem.
v0.41.0
- cipherutils changes.
- Fix license_files missing problem.
v0.40.2
- Add cipherutils.raw_aes_key.
- Add cipherutils.get_aes_mode.
v0.40.0
- Add listutils.chunk.
- New threadutils.
- Fix dictutils.Object.
v0.39.8
- fsutils.TemporaryFile add auto delete.
- dictutils.changes can return changed keys.
- dictutils.change can control do update or not.
- dictutils.change add ignore_empty_value support.
v0.39.7
- Fix strutils.force_byte, strutils.force_text.
v0.39.6
- Fix encode_datetime problem.
v0.39.5
- Add field name while failed to do typing cast.
v0.39.4
- Add more default jsonutils encoders.
v0.39.1
- Fix logutils.setup default config for windows.
v0.39.0
- Change logutils.setup parameter name.
- Fix bizerror.BizError encoding problem in jsonutils.
v0.38.2
- Add timeutils.TimeService.
v0.37.11
v0.37.10
- fsutils.readfile add default params. The default value will be returned if the target file is not exists.
- Add dictutils.diff function.
- Force folder create in fsutils.write.
- Make sure log folder exists in logutils.setup.
- Add sysutils.execute_script.
v0.37.3
- Add PyYAML deps in requirements.txt.
v0.37.2
- SimpleProducerConsumerServerBase.on_consume_error function add new parameter: task.
- Fix threadutils problems. Many changes are made.
v0.37.0
- Add fsutils.load_application_config.
v0.36.2
- Add fsutils.TemporaryFile
- Add threadutils.SimpleProducerConsumerServer and fix problems in ServiceCore.
v0.35.0
- strutils.is_uuid add allow_bad_characters parameter, default to False. For some old bad application using '815f5ecb-eg07-43af-8de2-87d3898093b5' as UUID.
- Add nameutils.guess_surname.
- Add fsutils.get_size_deviation, fsutils.get_unit_size and fsutils.get_size_display.
v0.34.0
- Add sysutils.get_daemon_application_pid.
- Add httputils.
v0.33.0
- Add fsutils.info
- Add strutils.encodable and strutils.decodable
v0.32.0
- Add funcutils.try_again_on_error.
v0.31.0
- Add fsutils.expands.
- Add fsutils.get_application_config_filepath.
v0.30.1
- Add cipherutils result_encoders' typing tips.
v0.30.0
- Add strutils.stringlist_append.
- Add strutils.html_element_css_append.
- Add strutils.split2.
- Add strutils.remove_prefix.
- Add strutils.remove_suffix.
- Change strutils.split("", [","]) returns [] instead of [""].
- Add cipherutils.MysqlAesCipher.
- Add listutils.topological_sort.
- Add nameutils.
v0.29.0
- Use pypinyin module instead of dragonmapper.
- Replace the result lve to lue.
v0.28.2
- Fix dictutils.update, so that it can works on anything.
v0.28.1
- Add default parameter to fsutils.first_exists_file.
v0.28.0
- Add fsutils.first_exists_file.
- Add fsutils.expand.
- Add listutils.first.
v0.27.0
- Add lower_first parameter for strutils.camel.
- Add dictutils.prefix_key.
- Add sysutils.get_worker_id.
v0.26.0
- Add treeutils.build_tree from list.
- Add treeutils.walk_tree.
- Add treeutils.print_tree.
- Add fsutils.touch.
v0.25.0
- Add strutils.is_uuid.
- Add typingutils.cast_uuid.
v0.24.2
- fsutils.file_content_replace add ignore_errors parameter.
v0.24.1
- typingutils.cast_xxx treat empty string as None.
- randomutils.UuidGenerator.next add parameter n, so that it can generate n uuids. If n==1, returns a UUID instance, and if n>1, returns a list of UUIDs.
v0.24.0
v0.23.0
- Add funcutils.get_default_values.
- Add funcutils.chain.
v0.22.0
- Add none-dict support in dictutils.change and dictutils.changes.
- Add strutils.format_with_mapping.
v0.21.0
- Add listutils.compare(old_set, new_set).
- Add dictutils.change(object_instance, data_dict, object_key, dict_key=None) -> bool.
- Add dictutils.changes(object_instance, data_dict, keys) -> bool:
- Change listutils.replace, turn the default value of parameter inplace from True to False.
- Fix Object instance problems.
v0.20.0
- Add strutils.clean and change strutils.camel.
- Add dictutils.to_object.
- Add pinyinutils.
v0.19.0
- Add fsutils.filecopy and fsutils.treecopy. Tips: fsutils.copy combines the function of filecopy and treecopy, if the src is a file then use filecopy, and if the src is a folder then use treecopy.
- Fix problem in fsutils.copy.
v0.18.0
v0.17.0
- Add fsutils.file_content_replace.
- Add fsutils.move.
- Change fsutils.rename's behavior.
- Change fsutils.copy's behavior.
v0.16.0
v0.15.2
- Add hostname, seed1, seed4 in domain_template of randomutils.UuidGenerator.
v0.15.1
- Add incr-lock for counter incr in randomutils.UuidGenerator.
v0.15.0
- Add randomutils.UuidGenerator.
v0.14.0
- Add strutils.substrings.
- Add strutils.combinations.
- Add cipherutils.Utf8Encoder.
- Add cipherutils.S1Cipher.
- Add cipherutils.S2Cipher.
- Add funcutils.classproperty
- WARN: Change a cipherutils.CipherBase's parameter name from encoder to result_encoder.
v0.13.4
- Use new algorithm to improve randomutils.shuffle's performance.
v0.13.3
- Add randomutils.shuffle.
- Change randomutils.randint parameters from (max, min=0) to (a, b=None).
v0.13.2
- Add listutils.group.
- Add rsautils.export_key. And rsautils use Crypto.PublicKey.RSA for the base engine.
v0.13.1
- Add strutils.force_float and strutils.force_numeric.
- Add typingutils.cast_numeric support.
v0.13.0
- IvfCihper accept integer value when float_digits=0.
- Fix IvfCihper deviation problem which is caused by wrong module used in decrypt.
- IvfCihper use new algorithm in computing module and max_value, so that result encrypted by version v0.12.0 can not decrypted by version v0.13.0.
v0.12.0
- Add IvfCihper for float number encrypt and decrypt. The output of IvfCipher.encrypt is string.
v0.11.1
- Use class instead of raw api for s12 and iv ciphers. It's can avoid many times in generating seeds.
v0.11.0
- Add cipherutils.
- Add strutils.binarify and strutils.unbinarify.
- Add randomutils.Random.
- Change aesutils functions' return type. Note: use cipherutils instead.
v0.10.1
v0.10.0
- Add strutils.is_chinese_character to test if the character is a chinese character.
- Add cacheutils.get_cached_value to get or set cached value.
v0.9.0
- Add listutils.append_new to append new value and only new value to the list.
v0.8.0
- Add strutils.smart_get_binary_data.
- Add rsautils.
v0.7.0
- Add hashutils.get_file_hash.
- Add extra install requires for python 2.x.
- Add imageutils.parse_base64image and imageutils.get_image_bytes.
- Fix jsonutils.make_simple_json_encoder ignore bases problem.
v0.6.0
- Add imageutils, add imageutils.get_base64image to make base64 image that can be rendered by web browser.
- Add imageutils.resize to scale image size.
- Add Image-Object-Encode support in jsonutils.
- Add threadutils, add threadutils.Service to simplify long-run-service programming.
- Raise bizerror.MissingParameter error in funcutils.get_inject_params while missing required parameter.
v0.5.4
- Fix hashutils.get_hash_hexdigest and hashutils.get_hash_base64 problem.
v0.5.3
- Using typingutils.smart_cast in funcutils.get_inject_params.
v0.5.2
- Add unit test cases for typingutils.
- Fix cast_list, do strip for every element in comma-separated-list.
- Fix base64 import missing in typingutils.
v0.5.1
- Add typingutils.cast_str.
v0.5.0
- Set library property in get_encoder in jsonutils.
- Add typingutils.
v0.4.0
- Add jsonutils, provides simple json encoder register system.
v0.3.2
- Fix problems for python 2.7.
- Fix name error of funcutils.
v0.3.1
- Fix problem casued by str.isascii() which is new from python 3.7.
v0.3.0
- Add listutils.unique to remove duplicated elements from the list.
- Add listutils.replace to replace element value in thelist with new_value in collection of map.
v0.2.0
- Add functuils.get_inject_params to smartly choose parameters from candidates by determine with the function's signature.
- Add functuils.call_with_inject to smartly call the function by smartly choose parameters.
v0.1.1
- Add strutils.wholestrip function, use to remove all white spaces in text.
- Fix strutils.is_urlsafeb64_decodable, strutils.is_base64_decodable and strutils.is_unhexlifiable functions, that have problem to test text contains whitespaces.
v0.1.0
- Add simple utils about operations of aes, dict, hash, list and str.