Package: eth-abi-lite
eth_abi_liteeth_abi_liteis a lite fork ofeth_abi, aiming to support EVM abi encode/decode functionality without external dependencies oneth_utils,eth_typing,toolz, orcytoolz.eth_abi_litecan be used as a drop-in replacement foreth_abi==3.0.0.Install withpip install eth_abi_liteMotivationMany packages in the ethereum ecosystem have conflicting version requirements for dependencies such aseth_utils,eth_typing,toolz, orcytoolz. Removing these dependencies allows a package to be used in more environments.These dependencies are rather heavy if all you want is basic abi encoding/decoding functionality.Doeseth_abi_litework the same aseth_abi?eth_abi_litecan be used as a drop-in replacement foreth_abi==3.0.0. The one functional difference is thateth_abi's low level pad functions are no longer curry-able. In most cases this difference will not be noticed.eth_abi_litepasseseth_abi's standard test suite when runningtox:...
======================== 751 passed, 3 skipped in 18.45s ========================
____________________________________ summary ____________________________________
  py37-core: commands succeeded                                                  
  py38-core: commands succeeded                                                  
  py39-core: commands succeeded                                                  
  py310-core: commands succeeded                                                 
  congratulations :)(tests for linting and docs removed)Iseth_abi_litefaster?According to testing withtunaon a good laptop:eth_abi_litetakes about18 msto importeth_abitakes about180 msto importeth_abi_liteis faster to import because it loads fewer dependencies. This is useful in the context of cli tools where startup times matter.Survey of imported itemseth_abi_liteimports the following items from its dependencies:Items Imported Frometh_utilsbig_endian_to_intcompose_if_tupleint_to_big_endianis_addressis_booleanis_bytesis_integeris_list_likeis_numberis_textto_canonical_addressto_checksum_addressto_normalized_addressto_tupleItems Imported Frometh_typingTypeStrDecodableItems Imported Frometh_utils.toolztoolz.functoolz.curryThe ChangesThe changes frometh_abitoeth_abi_liteconsist mostly of copying portions ofeth_utilsandeth_typing.The basic idea is that every time something is imported frometh_utilsoreth_typing, that thing is instead imported from a lite version of that package.Step 1. Createeth_utils_liteCopy these items frometh_utilstoeth_utils_liteeth_utils/abi.pyeth_utils/address.pyeth_utils/conversions.pyeth_utils/crypto.pyeth_utils/decorators.pyeth_utils/encoding.pyeth_utils/functional.pyeth_utils/hexadecimal.pyeth_utils/types.pyThe only non-mutual dependency in these modules iseth_hash.keccak()ineth_utils/crypto.py. Replace this function withpycryptodome's keccak implementation directly.Also ineth_utils/functional.py, remove the functions that are decorated bytoolz.compose.It is possible to prune these files more aggressively, but leaving the files unchanged minimizes the chances of introducing bugs.Step 2. Createeth_typing_liteCopy these items frometh_typingtoeth_typing_lite:AddressAnyAddressChecksumAddressDecodableHexAddressHexStrPrimitivesTypeStrThese are all of theeth_typingtypes used byeth_abi_liteandeth_utils_lite.Step 3. Createeth_abi_liteCopy all files frometh_abiintoeth_abi_liteReplace all instances ofeth_utilswitheth_utilseth_typingwitheth_typing_liteeth_abiwitheth_abi_liteReplace thetoolz.currydecoration oneth_abi.zpadandeth_abi.fpadwithfunctools.partialdecoration.