Saravanan666/pypi-org huggingface dataset:
Package: bella
bellapyBellaPy - A useful helper for any python programContentsSetupAPIsDev & TestLicenseSetuppipinstallbella# or build from sourcegitclonehttps://github.com/ndaidong/bellapy.gitcdbellapy
python3setup.pyinstallUsagefrombellaimportgenid,md5genid()# --> akrqHX7eQyT3neF6genid(5)# --> xzxNKmd5('hello')# --> 5d41402abc4b2a76b9719d911017c592APIsDatatype detectionis_int(val: Any)is_float(val: Any)is_num(val: Any)is_str(val: Any)is_bool(val: Any)is_list(val: Any)is_dict(val: Any)is_valid_url(val: Any)Encryptionmd5(text:str)md160(text:str)sha256(text:str,salt:str,dkpower:int=3,iterations:int=50000)Examples:md5('hello')# --> 5d41402abc4b2a76b9719d911017c592md160('hello')# --> 108f07b8382412612c048d07d13f814118445acdsha256('1234','v23')# --> 457b01a0f6169725# dkpower relates to length of output, default is 3# output length = 2 ** (dkpower + 1)# for example with dkpower = 4 --> output length = 2 ** 5 = 32sha256('1234','v23',dkpower=4)# --> 457b01a0f61697250083c598f7b8a8fdDate & timePY_DATE_PATTERN# '%Y-%m-%d %H:%M:%S %z'MY_DATE_PATTERN# '%a, %b %d, %Y %H:%M:%S'get_time()format_time(datetime,pattern)get_local_time()get_utc_time()ExamplesfrombellaimportPY_DATE_PATTERN,format_time,get_timenow=get_time()date_str=format_time(now,PY_DATE_PATTERN)print(date_str)Filesystemfrombellaimportfsfs.exists(file_path:str)fs.isdir(file_path:str)fs.isfile(file_path:str)# Get list of child files/folders by specific glob patternfs.get_files(pattern)# Copy file or folder `source` into `dest`:fs.copy(source,dest)# Remove file or folderfs.remove(path)Utilsgenid(count:int=16,prefix:str='')# return a random stringslugify(text:str)# create slug from a stringstrip_accents(text:str)# remove accents stringremove_tags(text:str)# remove HTML tags from a stringtruncate(text:str,maxlen:int)# cut a long string to shorter oneplurialize(word:str=None,count:int=1)# return plural format of wordbyte_to_text(bytesize:int,precision:int=2)write_json_to_file(file_path:str='',data:dict={})read_json_from_file(file_path:str='')jprint(data:Any,sorting=True,identation=2)throttle(seconds:int)# decorator, make a function throttlingtiming(name:str)# decorator, measure time to execute an expressionhas_installed(package)# check if a python package is installedcurry(func)# make `func` become a curry functioncompose(functions)# performs right-to-left function compositionpipe(functions)# performs left-to-right function compositionExamples:print(genid())# --> akrqHX7eQyT3neF6print(genid(5))# --> xzxNKprint(genid(10,'id_'))# --> id_j0fpXAZslugify('BellaPy - A useful helper for any python program')# --> bellapy-a-useful-helper-for-any-python-programslugify('Ngày hội “đám mây” của Amazon')# --> ngay-hoi-dam-may-cua-amazonplurialize('leaf',1)# => leafplurialize('leaf',2)# => leaves@throttle(5)deffn(a):print('No call multi times within 5 seconds')print(a)fn(1)fn(2)fn(3)fn(4)fn(5)fn(6)fn(7)@timing('save_item')defsave_item(data):write_json_to_file('./cache.json',data)save_item(dict(name='Alice'))# => Timing for save_item: 0.00134 sDev & Testgitclonehttps://github.com/ndaidong/bellapy.gitcdbellapy
poetryinstall
./run_test.shLicenseThe MIT License (MIT)
Package: bellande-robot-step
📦 Bellande Step✔️ confirmed versionsThe step function efficiently computes the next step towards a target node within a specified distance limit.Usage 2D SpaceSuppose you have two nodes representing positions in a 2D space:node0at coordinates(0, 0)node1at coordinates(5, 5)You want to compute the next step fromnode0towardsnode1while limiting the maximum distance to 3 units.# Define Importfrombellande_robot_step.bellande_robot_step_2dimportbellande_step_2d,Node2D# Define the nodesnode0=Node2D(0,0)node1=Node2D(5,5)# Compute the next step within a distance limit of 3 unitsnext_step=bellande_step_2d(node0,node1,limit=3)# Output the coordinates of the next stepprint("Next Step Coordinates:",next_step.coord)Usage 3D SpaceSuppose you have two nodes representing positions in a 3D space:node0at coordinates(0, 0, 0)node1at coordinates(5, 5, 5)You want to compute the next step fromnode0towardsnode1while limiting the maximum distance to 3 units.# Define Importfrombellande_robot_step.bellande_robot_step_2dimportbellande_step_2d,Node2D# Define the nodesnode0=Node3D(0,0,0)node1=Node3D(5,5,5)# Compute the next step within a distance limit of 3 unitsnext_step=bellande_step_3d(node0,node1,limit=3)# Output the coordinates of the next stepprint("Next Step Coordinates:",next_step.coord)Avaliable2D Space3D Space4D Space5D Space6D Space7D Space8D Space9D Space10D SpaceWebsitehttps://pypi.org/project/bellande_robot_step/Installation$ pip install bellande_robot_stepUpgrade (if not upgraded)$ pip install --upgrade bellande_robot_stepName: bellande_robot_step
Version: 0.3.0
Summary: Computes the next step towards a target node
Home-page: github.com/RonaldsonBellande/bellande_robot_step
Author: Ronaldson Bellande
Author-email: ronaldsonbellande@gmail.com
License: GNU General Public License v3.0
Requires: numpy
Required-by:LicenseThis Package is distributed under theGNU General Public License v3.0, seeLICENSEandNOTICEfor more information.
Package: bellatrix
Bellatrix is a set of (magic) tools to automate the use of Amazon EC2 services.[Online documentation](http://bellatrix.readthedocs.org/)Quick reference:bellatrix list - List all your EC2 instances.bellatrix start - Start a new EC2 instance.bellatrix provision - Apply a set of commands (through SSH) to any host, not only EC2 instances.bellatrix bewitch - Start a new instance, applies a configuration to it and finally saves it into a new ami.bellatrix burn - Burn a running instance into a new ami.bellatrix copy2s3 - Copy a file or directory to a S3 bucket.bellatrix perm2ami - Give permissions to other accounts to launch your ami.bellatrix stop - Stop a given instance or all of them if you pass the “all” argument. Stopping an instance will shut-down the instance but preserve data on the EBS volume.bellatrix terminate - Terminate a given instance or all of them if you pass the “all” parameter. Terminating an instance will shut it down and delete data on the EBS volume.For more information just executebellatrix -horbellatrix command -hGeneral InformationGetting Started:http://bellatrix.readthedocs.org/en/latest/commands_use_tut.htmlMain documentation:http://bellatrix.readthedocs.orgBugs? Feature request?https://bitbucket.org/deccico/bellatrix/issuesSource code:https://bitbucket.org/deccico/bellatrixConfiguration examples:https://bitbucket.org/deccico/bellatrix_configsNew releases can be found here:http://pypi.python.org/pypi/bellatrixContact information: deccico[at]gmail.com
Package: bellbird
bellbirdLibrary that parses differential equations (PDEs) strings and automates the creation of scripts for PyEFVLib using the element-based finite volume method.Dependencies & InstallationPython 3(3.8.2);meshio(4.0.15);numpy(1.17.4);pandas(1.1.3);scipy(1.5.3);PyEFVLib(1.0.1);Usageimportsys,ossys.path.append(os.path.join(os.path.dirname(__file__),os.pardir))importbellbird# Heat Transfermodel=bellbird.Model(name="Heat Transfer",equationsStr=["k * div( grad(T) ) + q = rho * cp * d/dt(T)"],variables=["T"],properties={"Body":{"k":10000.0,"q":0.0,"rho":1.0,"cp":1.0,},},boundaryConditions=[bellbird.InitialCondition("T",0.0),bellbird.BoundaryCondition("T",bellbird.Dirichlet,"West",0.0),bellbird.BoundaryCondition("T",bellbird.Dirichlet,"East",100.0),bellbird.BoundaryCondition("T",bellbird.Neumann,"South",0.0),bellbird.BoundaryCondition("T",bellbird.Neumann,"North",0.0),],meshPath="mesh.msh",timeStep=0.05,tolerance=1e-4,maxNumberOfIterations=300,sparse=False,)model.run()
Package: bellhop
BellHopBellHop is a simple way to upload files from Django applications. It is inspired by theCarrierWavegem for Ruby. Currently, only AWS is supported.InstallationInstall from PyPIpipinstallbellhopOnce done, add theBELLHOPsettings in yoursettings.pyfile:BELLHOP={"STORAGE":"aws","AWS_ACCESS_KEY_ID":os.environ["AWS_ACCESS_KEY_ID"],"AWS_SECRET_ACCESS_KEY":os.environ["AWS_SECRET_ACCESS_KEY"],"S3_BUCKET":os.environ["S3_BUCKET"],"S3_REGION":os.environ["S3_REGION"],}ExampleDefine a model inmodels.pywhich would store a file. The model should contain oneCharFieldwhich we would use to reference the file.In this example, the file would be stored using the fieldfileof modelDocument.classDocument(models.Model):file=models.CharField(max_length=255)Create a fileuploaders.pyin your app. We would register the model with an uploader, where we define the field which references the file asuploadable, which isfilein our case:fromtestapp.modelsimportDocumentfrombellhopimportbellhop,BaseUploaderclassDocumentUploader(BaseUploader):uploadable="file"bellhop.register(Document,DocumentUploader)Now, you can easily upload a file as:file=open('/path/to/file')document=Document.objects.create(file=file)# Access the url of the filedocument.file_url
Package: bellmanford
This package provides a few small extensions of the Bellman-Ford
routines inNetworkX, primarily for
convenience.Installationbellmanfordis available on PyPI:pipinstallbellmanfordUsagebellman_fordlength,nodes,negative_cycle=bellman_ford(G,source,target,weight='weight')Compute shortest path and shortest path lengths between a source node
and target node in weighted graphs using the Bellman-Ford algorithm.ParametersG: NetworkX graphpred: dict - Keyed by node to predecessor in the pathdist: dict - Keyed by node to the distance from the sourcesource: node label - Source nodetarget: node label - Target nodeweight: string - Edge data key corresponding to the edge weightReturnslength: numeric - Length of a negative cycle if one exists.
Otherwise, length of a shortest path. Length isinfifsourceandtargetare not connected.nodes: list - Nodes in a negative edge cycle (in order) if one
exists. Otherwise nodes in a shortest path. List is empty ifsourceandtargetare not connected.negative_cycle: bool -Trueif a negative edge cycle exists,
otherwiseFalse.Examples>>>importnetworkxasnx>>>G=nx.path_graph(5,create_using=nx.DiGraph())>>>bf.bellman_ford(G,source=0,target=4)(3,[1,2,3,4],False)negative_edge_cyclelength,nodes,negative_cycle=negative_edge_cycle(G,weight='weight')If there is a negative edge cycle anywhere inG, returnsTrue.
Also returns the total weight of the cycle and the nodes in the cycle.ParametersG: NetworkX graphweight: string, optional (default ='weight') - Edge data
key corresponding to the edge weightReturnslength: numeric - Length of a negative edge cycle if one exists,
otherwiseNone.nodes: list - Nodes in a negative edge cycle (in order) if one
exists, otherwiseNone.negative_cycle: bool -Trueif a negative edge cycle exists,
otherwiseFalse.Examples>>>importnetworkxasnx>>>importbellmanfordasbf>>>G=nx.cycle_graph(5,create_using=nx.DiGraph())>>>print(bf.negative_edge_cycle(G))(None,[],False)>>>G[1][2]['weight']=-7>>>print(bf.negative_edge_cycle(G))(-3,[4,0,1,2,3,4],True)
Package: belltower
BellTowerA super-simple Python library for interacting withRinging Room.This library is quite W.I.P., and its development is mostly driven by its potential use inWheatleyand other (as of yet unreleased) projects of mine.
The library seems to be quite stable, but the API could change at any moment whilst I'm developing
it.If you have any queries, then please leavean issue.  Pull requests are very welcome, but if
you are making any large-scale changes then it may be worth suggesting them in an issue first.Get StartedQuickstart and documentation are bothhere, and examples can be found in
theexamples folder.Why use this simple library?Simple libraries are just nicer to use!No knowledge of Ringing Room internals is needed to do cool things with Ringing Room.If the internals of Ringing Room change (which they have done), then fixing those breakages is as
simple as changing to the newest version of BellTower.This library doesn't have to be specific to Ringing Room (though Ringing Room is far and away the
most popular online ringing platform, so for the time being it is the only supported platform).Example: A simple chatbotA chatbot which, whenever anyone saysHelloin the chat, replies withHello, <username>.More examples can be found in theexamples folder, with this example atexamples/chatbot.py:# Import the tower class, and 'time.sleep'fromtimeimportsleepfrombelltowerimportRingingRoomTower# Create a new tower, and tell it to join tower ID 765432918tower=RingingRoomTower(765432918)# Register a function to be called when a chat message is posted@tower.on_chatdefon_chat(user,message):print(f"{user}says '{message}'")# If the message is 'hello' in any capitalisation, send 'Hello <user>'.# The first argument is the name to put next to the chat messageifmessage.lower()=="hello":tower.chat("RR ChatBot",f"Hello,{user}!")# The 'with' block makes sure that 'tower' has a chance to gracefully shut# down the connection if the program crasheswithtower:# Wait until the tower is loadedtower.wait_loaded()# Go into an infinite loop.  It doesn't matter what the main thread does,# but if it leaves the `with` block then the Tower's connection will# close and become unusablewhileTrue:sleep(1000)
Package: bellview
Bell View is an interactive method explorer for church bell ringers
which uses a Graphical User Interface (GUI). It works out the rows of
a plain course or touch, displays it the screen, and audibly rings it
using a set of bell sample files. Bell View makes use of the Change
Ringing Engine (crengine).Installation instructions and a user manual are available on the
Harrogate Bell Ringers' websitehttps://harrogatebellringers.org/bellview/
Package: belogging
Don’t fight with logging …Easy logging configuration based on environment variables.Features:Set logging level using environment variable LOG_LEVEL (defaults to ‘INFO’)Set which loggers to enable using environment variable LOGGERS (defaults to ‘’, everything)Always output to stdoutOptional JSON formatterCompletely disable logging setting LOG_LEVEL=DISABLEDRequirements:Python 3.5 and beyondInstall:pip install beloggingExamples:Simple applications:# my_script.pyimportbeloggingbelogging.load()# ^^ this call is optional, only useful for customization# For example, to enable JSON output: belogging.load(json=True)# belogging.getLogger is just a sugar to logging.getLogger, you can# use logging.getLogger as usual (and recommended).logger=belogging.getLogger('foobar')logger.debug('test 1')logger.info('test 2')Executing:# selecting LOG_LEVEL$LOG_LEVEL=DEBUGpythonmy_script.py# level=DEBUG message=test 1
# level=INFO message=test 2# selecting LOGGERS$LOGGERS=foobarpythonmy_script.py# Both messages# Both$LOGGERS=foobarLOG_LEVEL=INFOmy_script.py# only level=INFO message=test 2Applications should call`belogging.load()`upon initialization.
The first`__init__.py`would be a good candidate, but anything before any call to`logging`module will be fine.Django:In your projects`settings.py`:importbelogging# Disable django logging setupLOGGING_CONFIG=Nonebelogging.load()Inside your code, just use`logging.getLogger()`as usual.$exportLOG_LEVEL=WARNING$./manage.pyrunserver# It will output only logging messages with severity > WARNINGLogging follows a hierarchy, so you easily select or skip some logging messages:$exportLOGGERS=my_app.critical_a,my_app.critical_c,my_lib$./my-app.py# "my_app.critical_b messages" will be skipped
# all messages from my_lib will show upChangelog:0.1.3Fix duplication filter: use formatted log message to detect duplication
(thanks to @rodjjo)0.1.2Add missing tests assertsAdd lock for dealing with OrderedDict self._cache0.1.1Workaround to prevent KeyError exception in LoggerDuplicationFilter0.1.0Add JSON formatterMinor improvements0.0.2Added LoggerDuplicationFilter and enable_duplication_filter optionAdded belogging.getLogger (sugar to logging.getLogger)0.0.1Initial release
Package: belorthography
BelorthographyPython 3 library for converting Belarusian text various orthographies (e.g. lacinka).Installpip install belorthographyUsagefrom belorthography import convert, Orthography

convert('Груша цвiла апошнi год.', Orthography.OFFICIAL, Orthography.LATIN)

# returns "Hruša cviła apošni hod."Supported orthographies:OFFICIAL (Narkamaŭka)CLASSICAL (Taraškievica)LATINLATIN_NO_DIACTRICSupported conversionsfrom / toofficialclassicallatinlatin no diactricofficial✓✓✓classical✓✓latin✓DevelopmentCreate Python virtual enviromentEnsure venv is installed:apt-get install python3-venvIn the project folder run:python -m venv ./venv
source ./venv/bin/activateSetup package and run tests:pip install -r requirements.txt
pytestDiff modeDiff mode helps to see if changes to translation algorithms have any effect. it is useful during development, especially while we are working on an existing algorithm that we don't fully understand yet. Steps to use it:Guard changes usingdiff_mode.is_new()condition. For example in order to test whether removal of some conversion affects results:# somewhere in conversion algorithm...# Check if removal of сслі => ślli replacement has any effect.# Control version is replacement is present while new version is replacement removed.ifnotdiff_mode.is_new():res=res.replace('сллі','ślli')Run diff tool:python diff.pyIt will go through a set of Belarusian texts, converting each into Lacinka twice: once withis_new()being set to False (golden) and once with it set to True (test). If there are changes - they will be printed an a html file with nice handy UI.Run tests:DIFF_NEW=true pytestThis will run unit tests withis_new()being set to true. This helps to quickly see if the change affects existing tests. If you change affects a set of sample texts from step 2 but doesn't affect any unit tests - consider adding a new unit test.
Package: belousov-zhabotinsky
Belousov-ZhabotinskyAboutThe python package you never knew you needed!Now you can appreciate all the glory of the Belousov-Zhabotinsky reaction from the comfort of your console window in a state of the artASCII artrendering.Your life will never be the same!This a little python script I made for a class sometime ago. You can play around with the equations coefficients and rendering parameters with command line arguments (see usage). Besides theBZequation there's also theFitzHugh-Nagumo(for Turing patterns),Gray-ScootandCahn-Hilard(simulates phase separation) equations.TheoryThe Belousov-Zhabotinsky reaction is the classical examples of non-linear/oscillatory dynamics in chemical systems. The equations that describe the process are reaction-diffusion equations:BZ Equations:Numerally you iterate the equations in a 2D grid. The Laplace operator in a discrete grid is simply a convolution.You can learn more about the Belousov-Zhabotinsky reaction here:Dynamics and Chaos - Steven H. StrogatzChaotic Dynamics, an introduction - G. L. Baker and J. P. GollubInspired by the following blog posts:InstallationShould work in any python3 versionNeeds numpy and scipySee piplock fileYou can pip install the python module with the following commandpip install --user belousov-zhabotinskyUsage$ belousov-zhabotinskyor$ python -m belousov-zhabotinskyCheck cli options with:$ belousov-zhabotinsky --helpYou can exit the program by pressing any keyGray-Scott mode requires a terminal size bigger than 100x100 to work properlyThere's aplot.pyscript thay can be use to plot the system in matplotlib.$ python -m belousov-zhabotinsky.plotFutureFix Gray-ScottMake it fasterMy First GitHub project; HOORAY!
Package: belql
BELQLInstall the PackageBELQL can be installed from PyPI:pipinstallbelqlUsageCLIOne can use the CLI after installation to directly query the database with your own
pseudo-BEL statementbelqlquery'p(HGNC:"MAPT")'causal?--databasepharmacomeIt is advised to encapsulate string in single quotes to ensure it works.Run the Web ServerUsers can start the server either by running the script directlypythonbelql/run.pyor via the CLIbelqlserve-p5000-h127.0.0.1The web application is created using Flask and once server is started,
users can go tohttp://127.0.0.1:5000/in their browser.
Package: bel-repository
A utility for loading data from repositories of BEL documents with PyBEL[1].Installationbel_repositorycan be installed from PyPI with the following command:$pipinstallbel-repositoryThe latest version can be installed from GitHub with:$pipinstallgit+https://github.com/pybel/bel-repository.gitUsagefromtypingimportMappingfrombel_repositoryimportBELRepositoryfrompybelimportBELGraph# Build a repository by giving a folderbel_repository=BELRepository('/path/to/folder/with/bel/')# Get a mapping from paths to graphsgraphs:Mapping[str,BELGraph]=bel_repository.get_graphs()# Get a combine graphgraph:BELGraph=bel_repository.get_graph()Example BEL RepositoriesEach of these repositories has BEL content that can be pip installed:https://github.com/cthoyt/selventa-knowledge/https://github.com/pharmacome/conibhttps://github.com/hemekg/hemekghttps://github.com/covid19kg/covid19kghttps://github.com/neurommsig-epilepsy/neurommsig-epilepsyMore publicly available BEL content can be found in the listing inthis blog post.References[1]Hoyt, C. T.,et al.(2017).PyBEL: a computational framework for Biological Expression
Language. Bioinformatics (Oxford, England), 34(4), 703–704.
Package: belt
Belt is a simple PyPI proxy. Any packages that exist locally will be
installed direct from disk, non-existent packages will be installed from PyPI
and stored locally for future use.The latest version is always available atgithub.com/rob-b/beltTo install:easy_install beltor:pip install beltCreate a config file settinglocal_packagesto wherever you want to store
your locally cached packages:cat << EOF > production.ini

[app:main]
use = egg:belt

pyramid.reload_templates = false
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
pyramid.includes =

jinja2.directories = belt:templates
jinja2.filters =
    route_url = pyramid_jinja2.filters:route_url_filter

local_packages = /vagrant/pypi

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543

[loggers]
keys = root, belt

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console

[logger_belt]
level = WARN
handlers =
qualname = belt

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
EOFThen run withpserve:pserve production.iniYou can now install packages via your local proxy:pip install -i http://localhost:6543/simple/ zest.releaser0.5 (2013-05-06)Moved from using filesystem lookup to storing package records in db0.4 (2013-04-03)createwheelscommand builds wheel for each local package0.3 (2013-04-01)Set license to 3 clause BSD0.2 (2013-04-01)Nothing changed yet.0.1 (2013-04-01)Initial version