Package: python-fspacker
Fusion Solutions message packerIntroductionMessage packer for socket communications.
Pure-Python implementation and it isslightly sloweraspickle,marshalor evenjson, but much safer for production.
The following types are supported for packing and unpacking:NoneBooleans:TrueandFalseintFloats:float,infand-infstrbytearray(during unpacking it will be converted tobytes)byteslist(during unpacking it will be converted totuple)tupledict(dict key type can be any from this list)setInstallationRequires python version 3.8 or later.To install the latest release onPyPI,
simply run:pip3installpython-fspackerOr to install the latest version, run:gitclonehttps://github.com/FusionSolutions/python-fspacker.gitcdpython-fspacker
python3setup.pyinstallPython libraryUsageUse likepicklewithdump,dumps,loadandloadsfunctions.importfsPackerdata=fsPacker.dumps(["test"]*5)print(fsPacker.loads(data))BenchmarkEnvironment: Intel(R) Xeon(R) CPU E5-1650 v4 @ 3.60GHz, DIMM DDR4 Synchronous Registered (Buffered) 2133 MHz$/python-fspacker:python3-mbenchmark
Batch1# startedpicklepackeddatasize:369436bytedump:best:0.00097681<-medianavg:0.00097981-average:0.00098675->worst:0.00115466loads:best:0.00116250<-medianavg:0.00116567-average:0.00116768->worst:0.00123618marshalpackeddatasize:474624bytedump:best:0.00060849<-medianavg:0.00060978-average:0.00061214->worst:0.00066010loads:best:0.00093875<-medianavg:0.00094239-average:0.00094469->worst:0.00099110FSPackerversion1packeddatasize:348332bytedump:best:0.00140599<-medianavg:0.00142470-average:0.00143550->worst:0.00179069loads:best:0.00092720<-medianavg:0.00108024-average:0.00107529->worst:0.00113729FSPackerPUREPYTHONversion1packeddatasize:329293bytedump:best:0.02668814<-medianavg:0.02687568-average:0.02691436->worst:0.02727839loads:best:0.02563514<-medianavg:0.02585654-average:0.02623195->worst:0.02991657FSPackerversion2packeddatasize:324346bytedump:best:0.00133745<-medianavg:0.00135156-average:0.00136461->worst:0.00155367loads:best:0.00094138<-medianavg:0.00107694-average:0.00107477->worst:0.00114164FSPackerPUREPYTHONversion2packeddatasize:314318bytedump:best:0.02291694<-medianavg:0.02304409-average:0.02304181->worst:0.02318106loads:best:0.02749131<-medianavg:0.02768044-average:0.02768100->worst:0.02799873

Batch2# startedpicklepackeddatasize:274491bytedump:best:0.00084737<-medianavg:0.00085283-average:0.00085566->worst:0.00091460loads:best:0.00100438<-medianavg:0.00101581-average:0.00101901->worst:0.00110241marshalpackeddatasize:360242bytedump:best:0.00051488<-medianavg:0.00051733-average:0.00051980->worst:0.00054507loads:best:0.00083179<-medianavg:0.00083660-average:0.00084212->worst:0.00090665FSPackerversion1packeddatasize:271694bytedump:best:0.00146050<-medianavg:0.00147431-average:0.00147690->worst:0.00153197loads:best:0.00092286<-medianavg:0.00100156-average:0.00099671->worst:0.00102327FSPackerPUREPYTHONversion1packeddatasize:238499bytedump:best:0.02538159<-medianavg:0.02551851-average:0.02557210->worst:0.02591332loads:best:0.02445310<-medianavg:0.02459201-average:0.02464271->worst:0.02524533FSPackerversion2packeddatasize:238735bytedump:best:0.00135346<-medianavg:0.00136909-average:0.00137037->worst:0.00141406loads:best:0.00090187<-medianavg:0.00100334-average:0.00101569->worst:0.00130636FSPackerPUREPYTHONversion2packeddatasize:221546bytedump:best:0.02124800<-medianavg:0.02136108-average:0.02141090->worst:0.02174148loads:best:0.02539373<-medianavg:0.02556542-average:0.02576320->worst:0.02921140

Batch3# startedpicklepackeddatasize:274511bytedump:best:0.00087786<-medianavg:0.00088081-average:0.00088287->worst:0.00093917loads:best:0.00098829<-medianavg:0.00099558-average:0.00099822->worst:0.00105612marshalpackeddatasize:360267bytedump:best:0.00051608<-medianavg:0.00051854-average:0.00051974->worst:0.00054176loads:best:0.00082532<-medianavg:0.00082907-average:0.00083079->worst:0.00085855FSPackerversion1packeddatasize:414729bytedump:best:0.00300953<-medianavg:0.00304670-average:0.00307232->worst:0.00353145loads:best:0.00209713<-medianavg:0.00237827-average:0.00240026->worst:0.00317319FSPackerPUREPYTHONversion1packeddatasize:365886bytedump:best:0.06813255<-medianavg:0.06852698-average:0.06859602->worst:0.06918136loads:best:0.06472549<-medianavg:0.06544865-average:0.06549210->worst:0.06638827FSPackerversion2packeddatasize:381787bytedump:best:0.00308844<-medianavg:0.00310415-average:0.00311051->worst:0.00318295loads:best:0.00206454<-medianavg:0.00235557-average:0.00234600->worst:0.00239830FSPackerPUREPYTHONversion2packeddatasize:348954bytedump:best:0.06123471<-medianavg:0.06176491-average:0.06173875->worst:0.06195223loads:best:0.07077837<-medianavg:0.07135906-average:0.07146089->worst:0.07298397

Batch4# startedpicklepackeddatasize:97bytedump:best:0.00055353<-medianavg:0.00056210-average:0.00056276->worst:0.00057487loads:best:0.00064643<-medianavg:0.00065715-average:0.00065725->worst:0.00066493marshalpackeddatasize:79bytedump:best:0.00047902<-medianavg:0.00048745-average:0.00048688->worst:0.00049302loads:best:0.00058795<-medianavg:0.00059175-average:0.00059234->worst:0.00060103FSPackerversion1packeddatasize:85bytedump:best:0.00077319<-medianavg:0.00078550-average:0.00078805->worst:0.00080470loads:best:0.00068854<-medianavg:0.00076246-average:0.00075894->worst:0.00078787FSPackerPUREPYTHONversion1packeddatasize:85bytedump:best:0.01360374<-medianavg:0.01369004-average:0.01373398->worst:0.01407292loads:best:0.01672420<-medianavg:0.01689699-average:0.01688315->worst:0.01702459FSPackerversion2packeddatasize:74bytedump:best:0.00075289<-medianavg:0.00076416-average:0.00076328->worst:0.00077514loads:best:0.00053710<-medianavg:0.00055360-average:0.00055652->worst:0.00058802FSPackerPUREPYTHONversion2packeddatasize:74bytedump:best:0.00831298<-medianavg:0.00834915-average:0.00835809->worst:0.00851608loads:best:0.01466914<-medianavg:0.01474124-average:0.01477603->worst:0.01507150ContributionBug reports, constructive criticism and suggestions are welcome. If you have some create an issue ongithub.CopyrightAll of the code in this distribution is Copyright (c) 2021 Fusion Solutions Kft.The utility is made available under the GNU General Public license. The included LICENSE file describes this in detail.WarrantyTHIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE USE OF THIS SOFTWARE IS WITH YOU.IN NO EVENT WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY, BE LIABLE TO YOU FOR ANY DAMAGES, EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.Again, see the included LICENSE file for specific legal details.