Saravanan666/pypi-org huggingface dataset:
Package: pure
PurePretty, minimal and fast promptfor various shell.Original design bysindresorhus/pure.GoalSupport various shells as possible with only one codebase.❤️ I'm familiar with some of them (bash,zsh,fish) but would love to have help support the other (elvish,ksh,powershell,tcsh).FeaturesFeaturebashelvishfishkshpowershelltcshzshExcellent prompt character❯✔✔✔Display current directory tail✔✔✔Displaygitbranch name✔✔✔Display*whengitrepository isdirty✔✔✔Display⇡when branch isahead(commits to push)Display⇣when branch isbeing(commits to pull)Change❯to redwhen previous command has failed✔✖✔✔Update terminal titlewithcurrent folderandcommandDisplayusernameandhostnamewhen in anSSHsessionDisplaydurationwhen command run more that5secondsDisplayPythonvirtualenvwhen activated✔✔✔Fine control over colorsRight prompt controlDisplayVImode and custom symbolfor non-insert modeInstall⚠️ Under heavy development, use at your own risk! 💀requirements:gitandpip.git clone git@github.com:edouard-lopez/pure.git $HOME/.pure
pip install pure --userFishfish $HOME/.pure/install/configure.fishZshzsh $HOME/.pure/install/configure.zshBashbash $HOME/.pure/install/configure.bashElvishelvish $HOME/.pure/install/configure.elvLicenseMIT © Édouard Lopez.
Package: pure-array
Pure Python array (pure_array)A pure python implementation of thearraydata structure ofnumpy. This work is not intended to
be a replacement for numpy, but rather a possible alternative when numpy is not allowed. This implementation has the
same syntax as numpy, but not all functions are implemented.Installationpipinstallpure_arrayYou can also install the development version from GitHub:gitclonehttps://github.com/ferranSanchezLlado/pure_array.gitcdpure_array
pipinstall-e.Usageimportpure_arrayasnpa=np.array([1,2,3])b=np.array([4,5,6])asserta+b==np.array([5,7,9])asserta*b==np.array([4,10,18])asserta.max()==3RequirementsAs can be seen from therequirements.txtthere are no requirements for the package itself, but the tests
(requirements_dev.txt) requirepytestandflake8can be used for linting.LicenseMITFuture workImplement boolean indexingDocumentationBetter static typingMore testsMore functions
Package: pure-attention
介绍attention 在 cv 和 nlp 领域都有很多的应用，比如在 cv 中，可以使用 detr 进行目标检测任务，使用 vit / mae 进行图片预训练任务。在 nlp 领域中的作用更不用提， bert 以及后续的更多工作将 attention 彻底的发扬光大。cv 和 nlp 中的很多方法和技巧也在相互影响，比如大规模的预训练、mask 的设计(mae 、vilbert)、自监督学习的设计(从 imageNet 做有监督的预训练到纯粹的自监督预训练)。这些方面都非常的有趣，我希望可以设计一个 backbone 结构，让其可以在 cv 任务和 nlp 任务上均取到 sota 的效果。从而为之后的任务提供一个 baseline。目标提供一套完整的的基础算法服务1、python 训练任务，包含 NLP 和 CV 任务。2、java 环境下使用 onnx 的在线推理部署。todo第一阶段：实现 NLP 和 CV 的典型任务，并评估下游效果。Pytorch 实现 Transformer 的 encode 阶段，并实现 bert ;参考transformers的设计，但只保留与关键 encode 相关的代码，简化代码量。
保持与原始 huggingface encode 的结果一致, 使用方法和一致性校验可以参考backbone_bert。提供transformers中bert-base-chinese、chinese-roberta-wwm-ext、chinese-roberta-wwm-ext-large、ernie 1.0的国内下载镜像,  下载方式具体可参考transformers国内下载镜像。Pytorch 实现 Transformer 的 decode 阶段，并实现 seq2seq 任务。todoNLP 下游任务 序列标注、分类 的实现，并在公开数据集上进行评估，这里主要是想证明实现的 backbone 效果是符合预期的；todo实现 Vit，并在下游任务上验证实现 Vit 的效果是否符合预期；todo第二阶段：增加 NLP 和 CV 的其余常见任务，扩增项目的能力范围。UNILM；MAE；GPT系列；seq2seq，搞一个翻译任务；实现模型的 onnx export；实现 java 下的 onnx 推理过程；
Package: pure-data
Pure DataDeveloped by students of theSimulator ML (Karpov.Courses)Pure Data is a tool designed to help organize data quality checks in your projects.
You simply define the data you want to test, the list of test metrics and success criteria, run the test, and get a report with the results.The Pure Data includes:a list of different metrics that you can use to check the accuracy of the data;Report class, with which you can iterate through a list of metrics and get some summary information about which metrics pass, fail, or drop with errors.How to installpipinstallpure-dataKey FunctionalityThere are plenty of metrics that you can use to control your data's accuracy and reliability.You can either just apply the metrics you need to your data or use theReportclass to create a checklist with metrics you'd like to check and get summary information about the metrics results.UsageBelow is a brief example of how you can use Pure to verify your data.ImportReportclass and metrics from which you can use any metrics you need.frompure.reportimportReportimportpure.metricsasmFirstly, initialize tables with names and data you want to work with, and create a checklist with metrics.Metricreturns a dict with some meta fields. In the checklist, you can specify which metric result fields you want to control within certain limits.
In this example, we will determine limits for the "total" field in the first case and the "delta" field in the second one.tables={"simple_table":data}checklist=[("simple_table",m.CountTotal(),{"total":(1,1e6)}),("simple_table",m.CountZeros("column_1"),{"delta":(0,0.3)})]Then you can useReportjust as followsreport=Report(tables=tables,checklist=checklist,engine='pandas')Example of the report resulting dataframe:There is a more detailed example where the key functionality of the package is presented:https://github.com/uberkinder/Pure-Data/blob/usage_example/examples/simple_example.ipynb
Package: puredata-compiler
PureData CompilerThis package allows you to write patches forPureDatain Python.Installpython-mpipinstallpuredata-compiler# requires Python >=3.5UsageThe compiler gives youcreator functionsto compose a patch. These functions
add elements to the patch, using the content and connections you provide.frompuredata_compilerimportPatch,write_filedefexample():"""Patch that increments a counter"""patch=Patch()obj,msg,floatatom,connect=patch.get_creators('obj, msg, floatatom, connect')bang=msg('bang')delay_params=msg('500',new_row=0,new_col=1)delay_trig=obj('t b f',delay_params[0])delay=obj('delay',delay_trig[0],delay_trig[1])start_val=obj('f',(bang[0],delay[0]),x_pos=25,y_pos=125)increment=floatatom(new_row=0)current_val=obj('+',start_val[0],increment[0])# connect is different - it takes an existing element and adds connections,# so you can create circular structuresconnect(start_val,(),current_val[0])current_val_display=floatatom(current_val[0])returnpatchif__name__=="__main__":pd_example=example()write_file('pd_example.pd',str(pd_example))Result
Package: pure-datastructures
Pure Data StructuresData structures package for python, written in pure python code, not dependent on any other libraries or built-in function.List of Data StructuresStackStack + Linked ListQueueListList + Ordered ListInstallationYou can install this package with command :pip install pure-datastructuresUsageA quick introduction usingpure-datastructures. UsingOrderedList()built-in method :importdsscenario=ds.OrderedList()# basic insertionscenario.procedure_push(70)scenario.procedure_push(13)scenario.procedure_push(-3)# calculate size of array with `size()`# return length of arrayprint(scenario.procedure_expand_size())# searching value through array with `search_obj()`# return False if value is not foundsprint(scenario.procedure_search_obj(5))DocumentationFor documentation read inpure-datastructures.
Package: pure-di
Pure DISource Code:https://github.com/lionsoon/pure_diFeatures:Lightweight - no external dependencies (onlytyping_extensions)Based on type hints - no configuration required, less boilerplatePytest integration - writing unit tests was never so easy!yeildpowered - justyeildyour component and then write closing stepsAsync support - sometimes we needawaitsomething in build processInstallpip install pure-diExampleLet's assume we have followingservices.pyfile, witch contains components we want to construct.For example to be more "real-world" we will usehttpxandsqlalchemypackages:# services.pyimport...@dataclassclassSettings:db_uri:str@dataclassclassDatabase:engine:AsyncEngine@dataclassclassApplication:client:httpx.AsyncClientdatabase:Databaseasyncdefrun(self):...The main concept ofpure_diisProvider(andAsyncProviderif we need async).Providers consist of factories - callables that build components. Factories are included to the provider usingprovider.include_factorymethod.All factory arguments should be annotated. And return type should be specified either by return annotation, or byservice_typeargument (see example below).Let's create anAsyncProviderfor our services inprovider.pyfile:# provider.pyimporthttpxfrompure_diimportAsyncProviderfromsqlalchemy.ext.asyncioimportcreate_async_engine,AsyncEnginefromservicesimportSettings,Database,Applicationprovider=AsyncProvider()@provider.include_factorydefprovide_settings()->Settings:returnSettings(db_uri="sqlite://...")@provider.include_factory(service_type=AsyncEngine)asyncdefprovide_engine(settings:Settings):engine=create_async_engine(settings.db_uri)yieldengineawaitengine.dispose()provider.include_factory(Database,service_type=Database)provider.include_factory(Application,service_type=Application)Now inmain.pywe can useprovider.build_asyncmethod to constructContainer.Containeris similar to dict, where keys are services types, and values are services.
It also containscontainer.partial_solvemethod that works similar tofunctools.partialand solves those arguments whose types it contains.# main.pyfromproviderimportproviderfromservicesimportDatabase,Applicationasyncdefdo_some_work(database:Database,some_data):...asyncdefmain():asyncwithprovider.build_async()ascontainer:partial_solved_do_some_work=container.partial_solve(do_some_work)awaitpartial_solved_do_some_work(some_data="some_data")application=container[Application]awaitapplication.run()TestLet's write some tests using same example andpytestfrompure_di.pytestimportpytest_provide_asyncfromproviderimportproviderfromservicesimportDatabasefrommainimportdo_some_work@Provider.from_factory(service_type=Database)defmock_database():return...@pytest_provide_async(provider|mock_database)@pytest.mark.asyncioasyncdeftest_do_some_work(mocked_database:Database,any_usual_fixture):awaitdo_some_work(mocked_database,some_data="some_data")assertmocked_database.something_to_assert()
Package: puregym
# PyPureGymPython module for interacting with PureGym.## Installation`bash $ pip install puregym `## Usage`python >>> from puregym import PureGym >>> puregym = PureGym() >>> gym = puregym.gyms[0] >>> gym Gym(id=69,url='https://www.puregym.com/gyms/aberdeen-kittybrewster/',slug='aberdeen-kittybrewster',name='AberdeenKittybrewster', location=GymLocation(latitude=57.1614,longitude=-2.1123,address='KittybrewsterRetail Park, Bedford Road',postcode='AB243LJ'),price=GymPrice(per_month=16.99, joining_fee=15, pay_as_you_go=7.99),status=<GymStatus.ready:2>) `
Package: purehash
PureHashPure Python implementations of common hashing algorithms.Installationpip install purehashUsageUsage is similar to that ofhashlib, for example:importpurehashm=purehash.md5(b"The quick brown fox ")m.update(b"jumps over the lazy dog.")m.digest()# b"\xe4\xd9\t\xc2\x90\xd0\xfb\x1c\xa0h\xff\xad\xdf"\xcb\xd0"m.hexdigest()# "e4d909c290d0fb1ca068ffaddf22cbd0"Supported Hash AlgorithmsMD5 (md5)SHA-1 (sha1)SHA-256 (sha256)SHA-512 (sha512)
Package: purehg
Mercurial is a fast, easy to use, distributed revision control tool
for software developers.Basic install:$ make            # see install targets
$ make install    # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg              # see helpRunning without installing:$ make local      # build for inplace usage
$ ./hg –version  # should show the latest versionSeehttp://mercurial.selenic.com/for detailed installation
instructions, platform-specific notes, and Mercurial user information.
Package: purehle
PureHLEPure Python hash length extension.Installationpip install purehleUsageInformation used in the examples:Hash of key +DE:2ecdde3959051d913f61b14579ea136dLength of key: 3Data to append:FCLI> purehle -d 2ecdde3959051d913f61b14579ea136d -o DE -l 3 -a F

Using hash type MD5.
Hash (hex): d542ef0939e3c366f3eca18d4fa0bc77
Hash (bytes): b'\xd5B\xef\t9\xe3\xc3f\xf3\xec\xa1\x8dO\xa0\xbcw'
Data (hex): 4445800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000280000000000000046
Data (bytes): b'DE\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00(\x00\x00\x00\x00\x00\x00\x00F'Moduleimportpurehlehle=purehle.MD5(bytes.fromhex("2ecdde3959051d913f61b14579ea136d"),b"DE")padding,m=hle.with_length(3)m.update(b"F")data=hle.original+padding+b"F"data# b"DE\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00(\x00\x00\x00\x00\x00\x00\x00F"m.hexdigest()# d542ef0939e3c366f3eca18d4fa0bc77Supported Hash AlgorithmsMD5 (MD%)SHA-1 (SHA1)SHA-256 (SHA256)SHA-512 (SHA512)
Package: pure-nrng
Pure_NRNGGenerate multi-precision non-deterministic random Numbers package in python.According to the calculation of the minimum entropy value of the raw entropy, the adaptive absorption of the appropriate entropy bit.InstallationInstallation can be done through pip. You must have python version >= 3.8pip install pure-nrngUsageThe statement to import the package:from pure_nrng_package import pure_nrng
or
from pure_nrng_package import *Example:>>> nrng_instance = pure_nrng()
>>> true_rand_bits = nrng_instance.true_rand_bits(256)
>>> next(true_rand_bits)
>>> true_rand_float = nrng_instance.true_rand_float(256)
>>> next(true_rand_float)
>>> true_rand_int = nrng_instance.true_rand_int(100, 1)
>>> next(true_rand_int)
Package: pure-ocean-breeze
pure_ocean_breeze众人的因子框架我们的口号是：量价因子才是最牛的！全新大版本📢v4.0.0 — 2023.06.28因子框架4.0版本来啦！逐笔数据&任意秒级数据&全新的因子成果数据库来啦！v3.0.0 — 2022.08.16回测框架3.0版本来啦！ 模块拆分&说明文档来啦！pure_ocean_breeze说明文档v2.0.0 — 2022.07.12回测框架2.0版本来啦！数据库&自动更新&最终因子库功能上线啦！安装&使用指南🎯安装使用pip install pure_ocean_breeze命令进行安装初始化在初次安装框架时，请进行初始化，以将路径设置到自己的文件里使用如下语句进行初始化importpure_ocean_breezeaspp.ini()然后根据提示进行操作即可请注意路径不要写反斜杠\，而要写成/经过初始化后，以后就可以直接使用，不论重启电脑或者版本升级，都不用再初始化如果更换了数据库路径，请重新初始化日常调用导入框架importpure_ocean_breezeasp一键回测shen=p.pure_moonnight(fac)fac为因子矩阵因子合成运算其他用法详见说明文档其余内容敬请期待作者😉量价选股因子黄金矿工💁‍♂️挖因子兼新技术爱好者💁‍♂️感谢每一个教我写代码和教我挖因子的人💐欢迎交流技术优化&因子灵感&工作信息：winterwinter999@163.com相关链接🔗PyPipure_ocean_breeze说明文档Github同步到Pypi操作手册更新日志
Package: purephotonicscontrol
purephotonicscontrolA python package to easily communicate with PurePhotonics lasers through python.
Most purephotonics features are implemented, so the user can create their own computer controlled laser sequence.
The package has been developed for the PPCL560 laser, but should generalise.The code assume that the PPCL560 laser is interfaced with a Teensy 3.6 as outlined in(TO DO!). This interface is useful for creating trigger-able signals from the laser.
When the laser to connected to a PC directly, do this (TO DO!)Getting StartedRun the examples on the git
TO DO: Add details on connecting PC to laserPrerequisitesPython3, a laserInstallingpip install purephotonicscontrolTO DO: End with an example of getting some data out of the system or using it for a little demoContributingTO DOAuthorsMatthew Berrington-bitbucket profileLicenseThe MIT LicenseAcknowledgmentsThanks to PurePhotonics for provided a python example which seeded this project
Package: purepng
PurePNG allows PNG image files to be read and written using pure Python.
PurePNG can read and write all PNG formats.
PNG supports a generous variety of image formats: RGB or greyscale, with or
without an alpha channel; and a choice of bit depths from 1, 2 or 4
(as long as you want greyscale or a pallete),
8, and 16 (but 16 bits is not allowed for palettes).
A pixel can vary in size from 1 to 64 bits: 1/2/4/8/16/24/32/48/64.
In addition a PNG file can be interlaced or not.
An interlaced file allows an incrementally refined display of images being
downloaded over slow links (yet it`s not implemented in PurePNG for now).PurePNG is written in pure Python(that`s why it`s called Pure).
Package: pureport-client
Pureport Python ClientA thin Python 3 client for the Pureport ReST API, backed byrequests.Installpipinstallpureport-clientFor Python2, you can use any version prior to 1.0.0.pipinstallpureport-client<1Usagefrompureport.api.clientimportClientfrompureport.exception.apiimportClientHttpException,NotFoundException### Create the Client and login with your API Keyclient=Client()client.login("MY_API_KEY","MY_API_SECRET")### List Accountsaccounts=client.accounts.list()first_account=accounts[0]### List all Networks for the first Accountnetworks=client.accounts.networks(first_account['id']).list()### Create a Network for the Accountnew_network=client.accounts.networks(first_account['id']).create({'name':'My First Network'})### Obtain a Pureport location link for a new Connectionlocation=client.locations.list()[0]location_link=Client.to_link(location,location['name'])### Create an AWS Connectionnew_connection_data={'name':'My First AWS Connection','type':'AWS_DIRECT_CONNECT','speed':50,'highAvailability':True,'peering':{'type':'PRIVATE'},'location':location_link,'billingTerm':'HOURLY','awsAccountId':'YOUR_AWS_ACCOUNT_ID','awsRegion':'YOUR_AWS_REGION'# e.g. 'us-west-2'}new_connection=Nonetry:new_connection=client.networks.connections(new_network['id']).create(new_connection_data)exceptClientHttpExceptionase:print(e.response.text)### Retrieve the new AWS Connection by the returned objectclient.connections.get(new_connection['id'])### Delete the new AWS Connectionclient.connections.delete(new_connection['id'])### Expect a 404 error for the deleted connectiontry:client.connections.get(new_connection['id'])exceptNotFoundExceptionase:print(e.response.text)### Delete the Networkclient.networks.delete(new_network['id'])CLI UsageThis usesjqto help parse the JSON output from the Pureport client.exportPUREPORT_API_KEY="MY_API_KEY"exportPUREPORT_API_SECRET="MY_API_SECRET"### List accountspureportaccountslist|jq### List all networks for the first accountfirst_account_id=$(pureportaccountslist--nametraynham|jq-r'.[0].id')pureportaccountsnetworks-a$first_account_idlist### Create a Network for the Account and persist it's idnew_network_id=$(pureportaccountsnetworks-a$first_account_idcreate'{"name": "My First Network"}'|jq-r'.id')### List all pureport locationspureportlocationslist|jq### Create a link object with the first locationlocation_link=$(pureportlocationslist|jq-r'.[0] | {id: .id, href: .href, title: .name}')### Create an AWS Connectionnew_connection_id=$(pureportnetworksconnections-n$new_network_idcreate--wait_until_active'{"name": "My First AWS Connection","type": "AWS_DIRECT_CONNECT","speed": 50,"highAvailability": true,"peering": {"type": "PRIVATE"},"location": '$location_link',"billingTerm": "HOURLY","awsAccountId": "YOUR_AWS_ACCOUNT_ID","awsRegion": "YOUR_AWS_REGION"}'|jq-r'.id')### Retrieve the new AWS Connection with the returned idpureportconnectionsget$new_connection_id|jq### Delete the new AWS Connectionpureportconnectionsdelete--wait_until_deleted$new_connection_id### Delete the Networkpureportnetworksdelete$new_network_id
Package: purepress
PurePressPurePressis a very simple static blog generator.Usagepipinstallpurepress

mkdirmy-blogcdmy-blog

purepressinit# init the bloggitclonehttps://github.com/verilab/purepress-theme-default.gittheme# install a themepurepresspreview# preview the blogpurepressbuild# build the blogSeerichardchien/blogfor more.Minimality❯clocpurepress3textfiles.3uniquefiles.3filesignored.

github.com/AlDanial/clocv1.94T=0.01s(346.3files/s,74444.9lines/s)-------------------------------------------------------------------------------
Languagefilesblankcommentcode
-------------------------------------------------------------------------------
Python39151503-------------------------------------------------------------------------------
SUM:39151503-------------------------------------------------------------------------------
Package: pure-prng
Pure_PRNGGenerate professional pseudo-random number package in python.Only the pseudo-random number algorithm with good statistical properties is implemented.There are "methods" that specify the period of a multi-precision pseudo-random sequence.Realized pseudo-random number generation algorithmPRNG algorithmsPeriodQuadratic Congruential Generator(QCG)2^256Cubic Congruential Generator(CCG)2^256Inversive Congruential Generator(ICG)102*2^256PCG64_XSL_RR2^128PCG64_DXSM2^128LCG64_32_ext2^128LCG128Mix_XSL_RR2^128LCG128Mix_DXSM2^128LCG128Mix_MURMUR32^128PhiloxCounter4*2^(4*64)ThreeFryCounter4*2^(4*64)AESCounter2^128ChaChaCounter2^128SPECKCounter2^129XSM642^128EFIIX642^64SplitMix642^64Ran642^64Please inform me if any PRNG fails to pass the new statistical test.InstallationInstallation can be done through pip. You must have python version >= 3.8pip install pure-prngUsageThe statement to import the package:from pure_prng_package import pure_prngExample:>>> seed = 170141183460469231731687303715884105727
>>> period = 115792089237316195423570985008687907853269984665640564039457584007913129639747

>>> prng_instance = pure_prng(seed)
>>> source_random_number = prng_instance.source_random_number()
>>> next(source_random_number)
65852230656997158461166665751696465914198450243194923777324019418213544382100

>>> prng_instance = pure_prng(seed, new_prng_period = 2 ** 512)
>>> source_random_number = prng_instance.source_random_number()
>>> next(source_random_number)
8375486648769878807557228126183349922765245383564825377649864304632902242469125910865615742661048315918259479944116325466004411700005484642554244082978452

>>> prng_instance = pure_prng(seed)
>>> rand_bits = prng_instance.rand_bits(512)
>>> next(rand_bits)
mpz(6144768950704661248519702670268583753928668607451020183407159490385670202458730311510261255705698403097105657582435836672179668357656056427608305574891156)
>>> rand_bits = prng_instance.rand_bits(512, period)
>>> next(rand_bits)
mpz(2954964798889411590155032615694646383408546750268072607273800792672971321854983100133610686738061114434885994588970398525439724215184541467422573311905001)

>>> prng_instance = pure_prng(seed)
>>> rand_float = prng_instance.rand_float(100)
>>> next(rand_float)
mpfr('0.56576176351048513846261940831522',100)

>>> prng_instance = pure_prng(seed)
>>> rand_int = prng_instance.rand_int(100, 1)
>>> next(rand_int)
mpz(21)

>>> prng_instance = pure_prng(seed)
>>> get_randint_set = prng_instance.get_randint_set(100, 1, 6)
>>> next(get_randint_set)
{mpz(34), mpz(99), mpz(37), mpz(45), mpz(19), mpz(21)}

>>> prng_instance = pure_prng(seed)
>>> rand_with_period = prng_instance.rand_with_period(period)
>>> next(rand_with_period)
mpz(65852230656997158461166665751696465914198450243194923777324019418213544381986)
>>> rand_with_period = prng_instance.rand_with_period(period, 'raw_binary_number')
>>> next(rand_with_period)
mpz(53067260390396280968027884646874354062063398901623645439544105836818444733296)Future workThe following algorithm is intended to be implemented:NLFSRCellular automate period pseudo randomGPU Philox
Package: pure-protobuf
pure-protobufWow! Such annotated! Very buffers!DocumentationQuick examples.protodefinitionIt's not needed forpure-protobuf, but for the sake of an example, let's consider the following definition:syntax="proto3";messageSearchRequest{stringquery=1;int32page_number=2;int32result_per_page=3;}And here's the same viapure-protobuf:WithdataclassesfromdataclassesimportdataclassfromioimportBytesIOfrompure_protobuf.annotationsimportFieldfrompure_protobuf.messageimportBaseMessagefromtyping_extensionsimportAnnotated@dataclassclassSearchRequest(BaseMessage):query:Annotated[str,Field(1)]=""page_number:Annotated[int,Field(2)]=0result_per_page:Annotated[int,Field(3)]=0request=SearchRequest(query="hello",page_number=1,result_per_page=10)buffer=bytes(request)assertbuffer==b"\x0A\x05hello\x10\x01\x18\x0A"assertSearchRequest.read_from(BytesIO(buffer))==requestWithpydanticfromioimportBytesIOfrompure_protobuf.annotationsimportFieldfrompure_protobuf.messageimportBaseMessagefrompydanticimportBaseModelfromtyping_extensionsimportAnnotatedclassSearchRequest(BaseMessage,BaseModel):query:Annotated[str,Field(1)]=""page_number:Annotated[int,Field(2)]=0result_per_page:Annotated[int,Field(3)]=0request=SearchRequest(query="hello",page_number=1,result_per_page=10)buffer=bytes(request)assertbuffer==b"\x0A\x05hello\x10\x01\x18\x0A"assertSearchRequest.read_from(BytesIO(buffer))==request