Saravanan666/pypi-org huggingface dataset:
Package: blepy
BlepyA class-based wrapper for the peripheral functionalities provided by the librarypython-bluezero.AboutThe primary goal of this library is to make it easier and more clearer about how to implement Bluetooth low energyPeripherals,
including the associatedServices,CharacteristicsandDescriptors. This is done by using a class-based wrapper for theBlueZbasedpython-bluezerolibrary.As seen in the figure below, aServicehas one to manyCharacteristicsand aCharacteristichas (often) one to manyDescriptors, which is what this library is built to follow.UsageImportblepyTo useblepyin your project, simply import the whole package:importblepyServiceCreate unique BLE services by inheritingblepy.Service, including associatedcharacteristics:classExampleService(blepy.Service):def__init__(self,primary):super().__init__(self,"UUID",primary)self.characteristics=[ExampleCharacteristic()]CharacteristicCreate unique BLE characteristics by inheritingblepy.Characteristic, including associateddescriptors:classExampleCharacteristic(blepy.Characteristic):def__init__(self):super().__init__(self,"UUID")self.descriptors=[ExampleDescriptor()]DescriptorCreate unique BLE descriptors by inheritingblepy.Descriptor:classExampleDescriptor(blepy.Descriptor):def__init__(self):super().__init__(self,"UUID")PeripheralCreate a new peripheral with included services by either using theblepy.Peripheralas it is:# Initialize and publish the peripheralperipheral=blepy.Peripheral([ExampleService(True)],adapter_address,local_name='Peripheral',appearance=0)peripheral.publish()... or by inherit from theblepy.Peripheraland create an uniqueperipheral:classExamplePeripheral(blepy.Peripheral):def__init__(self,adapter_address):services=[ExampleService(True)]super().__init__(services,adapter_address,local_name='Peripheral',appearance=0)# Initialize and publish the peripheralperipheral=ExamplePeripheral(adapter_address)peripheral.publish()Examples(GATT Server)cpu-temperature.pyThis example transmits (randomly generated) temperature values of the CPU over a single characteristic.
Values are only updated when notification are switched on.(UART)ble_uart.pyThis example simulates a basic UART connection over two lines, TXD and RXD.It is based on a proprietary UART service specification by Nordic Semiconductors.
Data sent to and from this service can be viewed using the nRF UART apps from Nordic Semiconductors for Android and iOS.
Package: ble-scanner
BLE Scanner LibraryDescriptionThis is a Python library for scanning BLE beacon devices. It is built on top of the Bleak library and provides an easy-to-use API for BLE scanning.InstallationYou can install the package directly from the source code:python setup.py installOr, you can use pip for installation:pip install ble_scannerUsageHere's a quick example:import asyncio
from ble_scanner.BLEScanner import BLEScanner

def main():
   # Create a BLEScanner instance
    scanner = BLEScanner(target_mac="E2:15")  # Replace the MAC
    scanner.initialize()

if __name__ == "__main__":
    main()For more advanced usage, refer to the documentation.RequirementsPython 3.7+BleakLicenseMIT LicenseContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Package: bless
BlessBless is an acronym for Bluetooth Low Energy (BLE) Server Supplement.Bless provides an OS-independent python package for creating a BLE Generic
Attribute Profile (GATT) server to broadcast user-defined services and
characteristics. This is particularly useful when prototyping and testing
servers on different devices with the goal of ensuring that expected behavior
matches across all systems.Bless's code roughly follows a similar style toBleakin order to ease development of client
and server programs.InstallationpipinstallblessFeaturesBless enables reading, writing, and notifying of BLE characteristic values.
Developers can provide callback functions to manipulate data that is sent out
for reading or delivered for writing prior to processing the underlying
commands.ExamplesSee example code for setting up a BLE server where read and write
characteristic can be be probed by BLE clients (central devices)Basic Server
ExampleGATT Tree Server
Example
Package: blessable
BlessableBlessable is a simple library powered by the Blessed library. Blessable adds a simple markup language that has a similar syntax to HTML.SupportThrough Blessed, Blessable supports almost all platforms:WindowsNEWmacOSLinuxBSDPlease refer to the Blessed documentation for more information.UsageFirst, install the package:pipinstallblessable# or python -m pip install blessableThen, import theblessablemodule:fromblessableimportBlessableThen, useblessablelike this:blessable=Blessable()print(blessable.bless('<green>Success</green> - <blue_on_white>Blessable has been installed!</blue_on_white>'))Try it out!Blessable Markup LanguageMoved to ourWiki.Supported ColorsSupported colors have been moved to our Wiki.To DoSupport nested stylingSupport escaping tagsFAQsPlease see theWikifor FAQs, comparisons, and more.
Package: blessedtable
blessedtablePython module for creating colorful formatted ASCII tables.DependenciesThis package combines thetexttableand theblessedpackage; and thus,blessedtable.Installing the packagepip install blessedtableGetting startedInializing the table with default parameters will print the a table without any formatting. To know more about structuring the ascii table follow thislinkfromblessedtableimportBlessedtabletable=Blessedtable()table.set_deco(15)table.set_cols_align(["l","r","c"])table.set_cols_valign(["t","m","b"])table.add_rows([["Name","Age","Nickname"],["Mr\nXavier\nHuon",32,"Xav'"],["Mr\nBaptiste\nClement",1,"Baby"],["Mme\nLouise\nBourgeau",28,"Lou\n\nLoue"]])print(table.draw())For styleingblessedtableuses three parameters overtextable. These areborder_format, header_format, and column_format.border_formatneeds to be eitherNone, or of typestrheader_formatneeds to be eitherNone, or of typestr, or alistof stringscolumn_formatneeds to be eitherNone, or of typestr, or alistof stringsNote:The strings should be formatting strings. Examples are given below.'normal_on_norma'# text and background both have default color'red'# text color is red, background has default color'red_on_white'# text color is red, background is white'italic_red_on_blue'# text italic and red, and background is whiteAll the color options can be foundhere. To know more aboutblessed's formatting, follow thislinkThe three parameters can be set either while initializing or using setters.table=Blessedtable(header_format='green_on_blue',border_format='blue',column_format='blue_on_rosybrown2')#ortable=Blessedtable()table.set_deco(15)table.set_cols_align(["l","r","c"])table.set_cols_valign(["t","m","b"])table.add_rows([["Name","Age","Nickname"],["Mr\nXavier\nHuon",32,"Xav'"],["Mr\nBaptiste\nClement",1,"Baby"],["Mme\nLouise\nBourgeau",28,"Lou\n\nLoue"]])table.header_format='green_on_blue'table.border_format='blue'table.column_format='blue_on_rosybrown2'print(table.draw())To achieve different colors for the columns for both header and the rows, pass a list having format string for each of the columns.Note:The number of elements in the list should be equal to the number of columns in a row; each element (format string) correspomds to successive columns. Ifheader_formatisNonethen it inherits thecolumn_formatand vice versa. If you don't want it to inherit the styles, set theheader_formatorcolumn_formatto"normal_on_normal"hf=['green','italic_blue','purple']cf=['white_on_green','italic_orange_on_blue','teal']table.header_format=hftable.border_format='yellow'table.column_format=cfprint(table.draw())
Package: blest
BLEST PythonThe Python reference implementation of BLEST (Batch-able, Lightweight, Encrypted State Transfer), an improved communication protocol for web APIs which leverages JSON, supports request batching and selective returns, and provides a modern alternative to REST. It includes examples for Django, FastAPI, and Flask.To learn more about BLEST, please visit the website:https://blest.jhunt.devFor a front-end implementation in React, please visithttps://github.com/jhuntdev/blest-reactFeaturesBuilt on JSON - Reduce parsing time and overheadRequest Batching - Save bandwidth and reduce load timesCompact Payloads - Save more bandwidthSelective Returns - Save even more bandwidthSingle Endpoint - Reduce complexity and improve data privacyFully Encrypted - Improve data privacyInstallationInstall BLEST Python from PyPI.python3-mpipinstallblestUsageThis core class of this library has an interface similar to Flask or FastAPI. It also provides aRouterclass with ahandlemethod for use in an existing Python API and anHttpClientclass with arequestmethod for making BLEST HTTP requests.fromblestimportBlestapp=Blest({'timeout':1000,'url':'/','host':'localhost','port':8080,'cors':'http://localhost:3000'})@app.before_requestasyncdefauth_middleware(params,context):ifparams.get('name'):context['user']={'name':params['name']}else:raiseException('Unauthorized')@app.route('greet')asyncdefgreet_controller(params,context):return{'greeting':f"Hi,{context['user']['name']}!"}if__name__=='__main__':app.listen(8080)RouterThe following example uses Flask, but you can find examples with other frameworkshere.fromflaskimportFlask,make_response,requestfromblestimportRouter# Instantiate the Routerrouter=Router({'timeout':1000})# Create some middleware (optional)@router.before_requestasyncdefauth_middleware(params,context):ifparams.get('name'):context['user']={'name':params['name']}else:raiseException('Unauthorized')# Create a route controller@router.route('greet')asyncdefgreet_controller(params,context):return{'greeting':f"Hi,{context['user']['name']}!"}# Instantiate a Flask applicationapp=Flask(__name__)# Handle BLEST requests@app.post('/')asyncdefindex():result,error=awaitrouter.handle(request.json,{'headers':request.headers})iferror:resp=make_response(error,error.statusor500)resp.headers['Content-Type']='application/json'else:resp=make_response(result,200)resp.headers['Content-Type']='application/json'returnrespHttpClientfromblestimportHttpClientasyncdefmain():# Create a clientclient=HttpClient('http://localhost:8080',{'max_batch_size':25,'buffer_delay':10,'headers':{'Authorization':'Bearer token'}})# Send a requesttry:result=awaitclient.request('greet',{'name':'Steve'},['greeting'])# Do something with the resultexceptExceptionaserror:# Do something in case of errorLicenseThis project is licensed under theMIT License.
Package: bletchley
Aboutbletchley is a purePythoncryptographic tool suite. It provides historical ciphers. In the future it will also provide cryptographic attacks (cryptanalysis) to use against these ciphers.If you find an bug or have a feature you'd like to see, please raise anissue.You can get in touch with us via thislink.The latest version of Bletchley is available via ourGitLab repo,PyPiorConda-forge.CiphersSupported ciphers can be found on ourwiki.Simple ExampleCiphers can be accessed by adding bletchley to your Python path:export PYTHONPATH=$PYTHONPATH:/path/to/bletchleyThen importing bletchley into your Python script:from bletchley.ciphers.rot13_cipher import ROT13CipherAnd creating an instance of the cipher:my_cipher = ROT13Cipher()From here, you can encrypt and decrypt messages using the cipher:my_message = "Hello World!"
cipher_text = my_cipher.encrypt(my_message)
plain_text = my_cipher.decrypt(cipher_text)Advanced ExampleAll ciphers implement the abstract class: Cipher. This means that all ciphers have encrypt and decrypt functions you can use. Note that some more complex ciphers (such as theVIC Cipher) may have additional arguments when called. Where possible, these will be included with the cipher.Taking the VIC cipher as an example, another argument is needed to encrypt/decrypt messages. This is called a 'checkerboard'. We can create our cipher in the same way as we did for the Caeser cipher before:from bletchley.ciphers.vic_cipher import VICCipher
my_cipher = VICCipher()Before we can encrypt/decrypt any message, a checkerboard is needed. We now have two options:Create our own checkerboardLet the VIC cipher generate a random checkerboard for usFor now we will choose the easier of the two, and let the VIC cipher generate a checkerboard for us:my_checkerboard = my_cipher.generate_checkerboard()
my_message = "Hello World!"
cipher_text = my_cipher.encrypt(my_message, my_checkerboard)
plain_text = my_cipher.decrypt(cipher_text, my_checkerboard)The checkerboard, in this example, could be exported and saved for future use.CryptanalysisSupported cryptanalysis tools can be found on ourwiki.ContributingTo help Bletchley's continued development, please consider contributing to the project (you can find our contribution guidehere).
Package: bletl
Installationbletlis available throughPyPI:pip install bletlFor DevelopersYou can usebletlby installing it in your Python environment.clone itgit clone https://github.com/JuBiotech/bletlcd bletlpip install -e .to install it into your (activated!) Python environment in "editable mode"ContributingThe easiest way to contribute is to report bugs by openingIssues.If you want to contribute, you should...ClonebletlCreate a new branchMake changes on your feature-branchOpen aPull RequestUsage and Citingbletlis licensed under theGNU Affero General Public License v3.0.When usingbletlin your work, please cite theOsthege & Tenhaef et al. (2022) paperandthecorresponding software version.Note that the paper is a shared first co-authorship, which can be indicated by1in the bibliography.@article{bletlPaper,author={Osthege$^1$, Michael andTenhaef$^1$, Niklas andZyla, Rebecca andMüller, Carolin andHemmerich, Johannes andWiechert, Wolfgang andNoack, Stephan andOldiges, Marco},title={bletl - A Python package for integrating {B}io{L}ector microcultivation devices in the {D}esign-{B}uild-{T}est-{L}earn cycle},journal={Engineering in Life Sciences},volume={22},number={3-4},pages={242-259},keywords={BioLector, feature extraction, growth rate, microbial phenotyping, uncertainty quantification},doi={https://doi.org/10.1002/elsc.202100108},url={https://onlinelibrary.wiley.com/doi/abs/10.1002/elsc.202100108},eprint={https://onlinelibrary.wiley.com/doi/pdf/10.1002/elsc.202100108},year={2022}}@software{bletl,author={Michael Osthege andNiklas Tenhaef andLaura Helleckes andCarolin Müller},title={JuBiotech/bletl: v1.1.0},month=feb,year=2022,publisher={Zenodo},version={v1.1.0},doi={10.5281/zenodo.6284777},url={https://doi.org/10.5281/zenodo.6284777}}Head over to Zenodo togenerate a BibTeX citationfor the latest release.
Package: bleu-api
BleuAPIClientOverviewBleuAPIClient is a Python client for interacting with the Bleu API. It provides a convenient way to access various endpoints for tasks such as KYC verification, face matching, and more.InstallationYou can install this package usingpip:pipinstallbleu-apiUsageTo use the BleuAPIClient in your Python project, you need to create an instance of theBleuAPIClientclass, providing your client ID and client secret. Once initialized, you can call methods to interact with the Bleu API.Here's an example of how to get started:frombleu_api.clientimport*# Initialize the client with your client ID and client secretclient=BleuAPIClient(client_id='your_client_id',client_secret='your_client_secret')# Get an access tokenclient.get_access_token()# Perform a single KYC verificationresponse=client.single_kyc_verification(selfie_image_path='path/to/selfie_image.jpg',doc_front_path='path/to/doc_front.jpg',doc_back_path='path/to/doc_back.jpg')# Check the responseifresponse:ifresponse['responseCode']==BleuAPIClient.RESPONSE_CODES["SUCCESS"]:print("Verification successful.")else:print(f"Verification failed with code{response['responseCode']}")# Continue using other methods as neededAPI EndpointsTheBleuAPIClientprovides methods for interacting with various API endpoints. Refer to theAPI_ENDPOINTSclass variable for the available endpoints.Response CodesTheBleuAPIClientincludes a set of predefined response codes to help you interpret the results of your API requests. These codes are available as a dictionary under theRESPONSE_CODESclass variable.ConfigurationYou can configure the client by modifying its class variables, such asBASE_URLor adding new API endpoints and response codes as needed.LicenseThis project is licensed under the MIT License. See theLICENSEfile for details.ContributionsContributions to this project are welcome. Please refer to theCONTRIBUTINGguidelines for more information on how to contribute.Make sure to replace 'your_client_id' and 'your_client_secret' with your actual credentials. You can also add more detailed information and examples to the README if necessary.
Package: bleumi-pay
The Bleumi Pay SDK helps you integrate Algo, Algorand Standard Asset, Ethereum, ERC-20, RSK, RSK ERC-20 & xDai payments and payouts into your business or application. The SDK bundlesBleumi Pay APIinto one SDK to ease implementation and support.bleumi-pay-sdk-python is a Python library that provides an interface between your Python application andBleumi Pay API. This tutorial covers the basics, including examples, needed to use the SDK.
Package: bleu-mp
bleu-mpMulti-process BLEU evaluation tool.多进程BLEU评估工具。Modified from the bleu scoring tool of huggingface evaluation.改自 huggingface evaluate 的 bleu 评分工具。https://github.com/huggingface/evaluate/blob/main/metrics/bleu/bleu.pyInstall / 安装pippip install -U bleu-mpdevgit clone https://github.com/One-sixth/bleu-mp
cd bleu-mp
pip install -e .New Features / 新特性Faster!The built-in multi-process implementation of python is not used. I use my own multi-process implementation, which is very friendly to the compatibility of Windows and Linux. The memory occupied by each calculation subprocess is very low.更快！不使用python内置的多进程实现。使用我自己的多进程实现，从而对windows和linux的兼容性非常友好，每个计算子进程占用的内存非常低。Features / 特性Both string and integer sequences are supported for bleu calculation.同时支持 字符串和整数序列 进行bleu计算。Speed test / 速度测试Test code is in unittest/test.py.测试代码位于 unittest/test.py。CPU：i7-8750H# short str / 短字符串
score (1.0, [1.0, 1.0, 1.0, 1.0], 1.0, 1.0, 2200000, 2200000) (1.0, [1.0, 1.0, 1.0, 1.0], 1.0, 1.0, 2200000, 2200000)
1  process cost time 16.979528665542603
10 process cost time 3.5354034900665283

# long str / 长字符串
score (1.0, [1.0, 1.0, 1.0, 1.0], 1.0, 1.0, 22000000, 22000000) (1.0, [1.0, 1.0, 1.0, 1.0], 1.0, 1.0, 22000000, 22000000)
1  process cost time 103.8217351436615
10 process cost time 22.66322374343872

# short int list / 短整数序列
score (1.0, [1.0, 1.0, 1.0, 1.0], 1.0, 1.0, 800000, 800000) (1.0, [1.0, 1.0, 1.0, 1.0], 1.0, 1.0, 800000, 800000)
1  process cost time 4.874496936798096
10 process cost time 1.1751139163970947

# long int list / 长整数序列
score (1.0, [1.0, 1.0, 1.0, 1.0], 1.0, 1.0, 16000000, 16000000) (1.0, [1.0, 1.0, 1.0, 1.0], 1.0, 1.0, 16000000, 16000000)
1  process cost time 47.34107685089111
10 process cost time 10.046519994735718Warning / 警告Don't input pytorch's tensor type. It will causes unnecessary memory consumption, and a lot of performance loss.Please convert to numpy array or list type first.不要传入 pytorch 的 tensor 类型，这会导致额外的内存消耗和大量的性能损失。请先转换到 numpy数组 或 list类型。Demo / 示例frombleu_mpimportcompute_bleu# strpred_data=['床前明月光，疑是地上霜','举头望明月，低头思故乡']*1000tgt_data=[['床前明月光，疑是地上霜'],['举头望明月，低头思故乡','静夜思']]*1000result=compute_bleu(pred_data,tgt_data)print('bleu score',result[0])# int listpred_data=[[1,2,3,4],[2,3,4,5]]*1000tgt_data=[[[1,2,3,4]],[[2,3,4,5],[4,5,6]]]*1000result=compute_bleu(pred_data,tgt_data)print('bleu score',result[0])Reference / 引用https://github.com/huggingface/evaluate
Package: bleuper
bleuperA simple lightweight library to help you easily compute BLEU scores.UsagefrombleuperimportBLEUref1=['love','can','always','find','a','way']ref2=['love','makes','anything','possible']tran1=['the','love','can','always','do']tran2=['love','can','make','anything','possible']b=BLEU([ref1,ref2],(0.4,0.35,0.25,0,))score1=b.compute_score(tran1)score2=b.compute_score(tran2)
Package: blexy
blexySimpleOpenMetricsexporter for BLE devices.Requirementsdevice with BLE compliant transceiver (e.g. RPi 3+)Python 3.7+Runningpip install blexy
blexy --port 8888 --config-file ~/.blexy.yamlEndpoints/- returns list of connected devices in JSON format./metrics- returns values read from connected BLE devices inOpenMetrics format.ConfigDevice & server configuration is by default expected to be placed in./config.yaml.Custom config file path can be specified via-c / --config-filecommand line option.portandlog_levelcan be either specified in config file or through command line options (seeblexy -hfor exact option names).Example config fileBelow file will make blexy connect to two Xiaomi temperature / humidity sensors and listen on port 8080:port:8080log_level:infoble:devices:-name:living room sensormodel:LYWSD03MMCaddress:xx:xx:xx:xx:xx:xx-name:bedroom sensormodel:LYWSD03MMCaddress:xx:xx:xx:xx:xx:xxExample output$ curl localhost:8080/metrics
# TYPE battery_level_percentage gauge
# UNIT battery_level_percentage percentage
battery_level_percentage_gauge{name="living room sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 77
battery_level_percentage_gauge{name="bedroom sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 88
# TYPE humidity_percentage gauge
# UNIT humidity_percentage percentage
humidity_percentage_gauge{name="living room sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 48
humidity_percentage_gauge{name="bedroom sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 51
# TYPE temperature_celsius gauge
# UNIT temperature_celsius celsius
temperature_celsius_gauge{name="living room sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 22.33
temperature_celsius_gauge{name="bedroom sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 25.11
# TYPE voltage_volts gauge
# UNIT voltage_volts volts
voltage_volts_gauge{name="living room sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 3.11
voltage_volts_gauge{name="bedroom sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 3.03
# EOFSupported devicesLYWSD03MMC(Xiaomi)
Package: bl-hector
Hector — a collection managerInstallHector is available on PyPI under the namebl_hector.
To install, just runpython -m pip install bl_hector.ConfigureHector is configured using environment variables.
Seethesettingsmodulefor
a comprehensive list of configuration variables.All the variable names must be prefixed withHECTOR_. For instance :#Thesecretcanbegeneratedusingthe`secrets.token_hex()`function.$exportHECTOR_SECRET_KEY="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"#AdditionalPythondatabasedriversmightberequireddependingontheDSN.$exportHECTOR_DSN="sqlite:///data.sqlite"AuthenticationTo enable WebAuthn authentication, you must install extra dependencies (bl-hector[webauthn])
and enable it explicitly:$exportHECTOR_WEBAUTHN_ENABLED=1TOTP authentication is provided to be able to login on servers that do not (yet) support
thecryptographymodule. You must install extra dependencies (bl-hector[totp])
and enable it explicitly by setting a base32 random secret:#Thesecretcanbegeneratedusingthe`pyotp.random_base32()`function.$exportHECTOR_TOTP_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXNote that it is a highly insecure way of authenticating, as anyone gaining access to your
OTP generator would be able to login.InitialiseOnce configured, you must initialise Hector's database with the dedicated command:$hectorinit-dbRunHector being a Flask application, it can be run using any WSGI server,
for instance, withGunicorn:$gunicorn--access-logfile="-"-w4-b127.0.0.1:3000"bl_hector.configuration.wsgi:app()"ContributingSeeCONTRIBUTING.mdto set up a development environment.