Saravanan666/pypi-org huggingface dataset:
Package: pysimgame
PySimGameA simple pygame interface that allows to run, visualize and interact
with simulation models.It has been developped for running pysd models, but the plan is
to make it compatible with other simulation packages.Current developpementThe package is still under developpement so nothing is guaranted
to work yet, but if you are interested you are welcome to contact
us to see whether we can improve something or implement your ideas.PrinciplesThe goal is to be able to play with a simulation. A player can select some options that will modify some components of the simulation such that every game can be a different story made on the simulation.If you want to play with World models that simulate the future of humanity, want to play the role of a governement fighting a pandemic or simply mess around with a basic predator-pray model,
you are at the right place !Our goal is to make it as easy as possible to create interaction capabilities with simulations.pysimgame has been developped with the idea of making modding as easy
as possible, such that one can implement new models, but also
ways to interact with the models during the game and control
of the graphics.All the code is written in python and uses python libraries for
running the games.The pygame model can run multiple models in parallel in the simulation.
We callregionsthe different models running in parallel.Regions can communicate between each other using Links which
It is possible to change parameters of the model using Actions which
are usable by the players.LicenseThe licence is called a Do What the Fuck You Want to Public Licence.
So you can Do What the Fuck You Want with the code.
Package: pysimhash
simhashsimhash cpp module for python, a cpp implement ofsimhash, support for large
dimesion such as 128bitinstallpipinstallpysimhashor install from github.comgitclonehttps://github.com/skiloop/simhashcdsimhash
pythonsetup.pyinstallrequirementsboost-pythonhow to useexample:importpysimhashimporthashlibdocument="google.com hybridtheory.com youtube.com reddit.com"tokens=[hashlib.md5(s.encode('utf-8')).hexdigest()forsindocument.split(" ")]s2=pysimhash.SimHash(128,16)# f=128, hash_bit=16s2.build(tokens,base=16)print(s2.hex())benchmarkWith 10000 creating and 100,000 comparing(usingbenchmark.py) on the same linux, results
go as followimplementbuild timecomparison timepure python1.73s222.99spysimhash0.14s49.89s
Package: pysimilar
pysimilarA python library for computing the similarity between two string(text) based on cosine similarity made bykalebuHow does it work ?It uses Tfidf Vectorizer to transform the text into vectors and then obtained vectors are converted into arrays of numbers and then finally cosine similary computation is employed resulting to output indicating how similar they are.Example of usagePysimilar allows you to either specify the string you want to compare directly or specify path to files containing string you want to compare.compare() stringsHere an example on how to compare strings directly;>>>frompysimilarimportcompare>>>compare('very light indeed','how fast is light')0.17077611319011649compare () filesHere how to compare files with textual documents;>>>compare('README.md','LICENSE',isfile=True)0.25545580376557886You can also compare documents with particularextensionin a given directory, for instance let's say I want to compare all the documents with.txtin adocumentsdirectory here is what I will do;Directory for documents used by the example below look like thisdocuments/
├──anomalie.zeta
├──hello.txt
├──hi.txt
└──welcome.txtcompare_documents ()Here how to compare files of a particular extension>>>importpysimilar>>>frompprintimportpprint>>>pysimilar.extensions='.txt'>>>comparison_result=pysimilar.compare_documents('documents')>>>[['welcome.txt vs hi.txt',0.6053485081062917],['welcome.txt vs hello.txt',0.0],['hi.txt vs hello.txt',0.0]]sorting the outputsYou can also sort the comparison score based on their score by changing theascendingparameter, just as shown below;>>>comparison_result=pysimilar.compare_documents('documents',ascending=True)>>>pprint(comparison_result)[['welcome.txt vs hello.txt',0.0],['hi.txt vs hello.txt',0.0],['welcome.txt vs hi.txt',0.6053485081062917]]multiple extensionsYou can also set pysimilar to include files with multiple extensions>>>importpysimilar>>>frompprintimportpprint>>>pysimilar.extensions=['.txt','.zeta']>>>comparison_result=pysimilar.compare_documents('documents',ascending=True)>>>pprint(comparison_result)[['welcome.txt vs hello.txt',0.0],['hi.txt vs hello.txt',0.0],['anomalie.zeta vs hi.txt',0.4968161174826459],['welcome.txt vs hi.txt',0.6292275146695526],['welcome.txt vs anomalie.zeta',0.7895651507603823]]ContributionsIf you have anything valuable to add to thelib, whether its a documentation, typo error, source code, please don't hesitate to contribute just fork it and submit your pull request and I will try to be as friendly as I can to assist you making the contributions.All the CreditsAll the Credits tokalebuand other future contributors
Package: pysimilarity
pysimilarityPysimilarity is a library that contains several methods for determining similarities between groups. Currently, it supports calculating similarities using distances, and a classifier.Installpip install pysimilarityUsagefrom sklearn.datasets import load_iris
from pysimilarity import DistanceSimilarity
import pandas as pd

iris_dataset = load_iris()
iris_df = pd.DataFrame(iris_dataset['data'],columns=iris_dataset['feature_names']
                      )
iris_df['species'] = pd.Series(iris_dataset['target']).replace({0:'setosa', 1:'versicolor', 2:'virginica'})


dist_similarity = DistanceSimilarity()
setosa_data = iris_df.loc[iris_df.species == 'setosa']
setosa_similarity = dist_similarity.fit_transform(setosa_data.drop('species',axis=1)
                                                  ,iris_df.drop('species',axis=1))
print(setosa_similarity) # Array of shape n_rows of iris_df.
Package: pysiml
SiML: A Simulation ML librarySiML is a machine learning library focusing on geometrical and simulation data.
It facilitates machine learning processes, including preprocessing, learning,
and prediction.
In particular, SiML has handy functionalities to handle geometrical data,
which are in graph or point cloud formats in general.Documentationhttps://ricosjp.github.io/simlLicenseApache License 2.0.
Package: pysimlink
PySimlinkis a python package that automatically compiles Simulink codegen files
into a simple interface that you can interact with in Python!With this package, you can:Interact with the internals of your Simulink modelRun the model in "accelerator mode"Send and receive data in the form of numpy arraysRun multiple instances of the same modelAll without requiring a MATLAB runtime on the target machine! No C/C++ programming required!To get started, you either need a copy of the generated model you want to simulate or, to generate
the code yourself, you need the Simulink Coder. There are some limitations, namely that your modelmustuse a fixed step solver
(a requirement of the grt target).DemoRead Signal ValuesfrompysimlinkimportModelmodel=Model("my_awesome_model","model.zip")model.reset()foriinrange(len(model)):model.step()signal_val=model.get_signal(block_path="Constant1",sig_name="Signal1")print(signal_val)Change Block ParametersfrompysimlinkimportModelimportnumpyasnpmodel=Model("my_awesome_model","model.zip")model.reset()new_param=np.eye(3)model.set_block_param(block="Constant1",param="Value",value=new_param)Change a Model's Final Time StepfrompysimlinkimportModelmodel=Model("my_awesome_model","model.zip")model.reset()model.set_tFinal(500)print(model.tFinal)And more...Check out thedocsto get started!
Package: pysimmmulator
PySiMMMulatorPySiMMMulator is an open source Python adaption of the R-packagesiMMMulator, which allows users to generate simulated data to use in testing Marketing Mix Models (MMMs).
While this package cointains a full pipeline for data generation (configurable via .conf file) it can also be utilized in parts to generate select portions of MMM input data (ie campaign/channel spend)InstallationAccessable via PyPIpipinstallpysimmmulatorUsagePySiMMMulator's simulator can either be run on a step-by-step basis, or can be run single-shot by passing a config file.Run via configRun using this method, you'll be returned both a dataframe of for MMM input as well as the "True ROI" values for each of your channels. These true values are critical to validating your MMM model.cfg=load_config(config_path="./my_config.yaml")sim=simmm()mmm_input_df,channel_roi=sim.run_with_config(config=cfg)Run by stagesAlternatively you may run each of the stages independently, which allows for easier debugging and in-run adjustments based on the results of each stage. The order of the stages is reflected below(without their inputs). Once you've run through every stage, results are available by calling thesim.final_dfobject (channel ROI results are stored assim.channel_roi).sim=simmm()sim.simulate_baseline()sim.simulate_ad_spend()sim.simulate_media()sim.simulate_cvr()sim.simulate_decay_returns()sim.calculate_conversions()sim.consolidate_dataframe()sim.calculate_channel_roi()sim.finalize_output()Run via CLIA configuration file is required as input for this and should be passed as seen below. An output path can also be passed via-o, however when not passed the current working directory will be used.pysimmm-iexample_config.yaml-o.DevelopmentSetting up a dev environmentcondacreate--prefix=./envpython=3.11
condaactivate./env
pipinstall-e'.[dev]'
Package: pysimmods
PysimmodsThis projects contains a collection of (python) simulation models for a variety of energy generation and consumption units. Most of the models were originally developed in the context of the research project iHEM (intelligent Home Energy Management) or other projects at OFFIS. Other models were developed during a student project group at the University of Oldenburg. The models are intended to be used with the co-simulation framework mosaik (https://mosaik.offis.de), but are also usable without mosaik.Version: 0.10License: LGPLInstallationPysimmods requires Python >= 3.6 and is available onhttps://pypi.org.
It can be installed, preferably into a virtualenv,  with>>> pip install pysimmodsAlternatively, you can clone this repository with>>> git clone https://gitlab.com/midas-mosaik/pysimmods.gitthen switch into the pysimmods folder and type>>> pip install -e .DocumentationYou will find a still growing documentation athttps://midas-mosaik.gitlab.io/pysimmods.
Please create an issue if you find any errors or if you think that something should be explained more explicitly.
Package: pysimpirc
pysimpircis a barebones IRC bot library meant to be simple to use. It does
not attempt to catch the replies to messages, but has all the features
necessary to build a relatively advanced bot, including:Queuing messages so as to not flood the IRC server,interpretation of theMODEcommand,parsing of theRPL_ISUPPORTline and adherance to many options,uncluttered interface - no zope.interfaces nor anything like it, only
a base class and a subclass with more functionality,not hard-wired to TCP - could theoretically use UNIX sockets or
anything you choose to implement,IPv6 compatible.It is the aim of this library to not be in the way of the programmer and
avoid introducing new, foreign concepts.For a basic example, see theexample.pyfile provided in the distribution.
Package: pysimplebase
SimpleBase is a lightweight JSON based serverless database with improved performance on key operationsThe strength of document-oriented NoSQL database is their natural simplicity, but they are usually not very fast (unless they are serious server databases like MongoDB). SimpleBase solves performance issues in critical areasInstant additionof new records to collections, regardless of the size of the collection due to a special storage architectureFaster work with operations, due to the fact that it isnot required to encode / decode the entire collection(which can be very large)Collections are alwaysstored in RAMwith concurrency change tracking: data is re-read from disk only if it has been changed by another processACID for multi-user and multi-threadingTwo types of indexes for key types of queries - ahash indexand aspecial B-treefor full-text searchSupport fortransactions(sessions)MongoDB-like syntax, incl. 100% similar query languageWritten inpure python, only about 1800 linesWhy SimpleBase?It was written for situations where you need to organize a local database without a server with a JSON-oriented interface. But at the same time, increased performance requirements: for large collections (1000000+ documents in the collection), fast, almost instantaneous execution of some operations is required:Add a new document to the collection with 1000000 documents - 0.007 seconds, with 2000000 documents - also 0.0007 seconds - ie. operation time does not depend on the size of the tableFind an element by equality in a collection with 1000000+ entries in 1-2 microsecondsOrganize real-time search by occurrence of a string across a large collection without friezesfrompysimplebaseimportSimpleBase,DBSession#creatig databasedb=SimpleBase("samples_db")#inserting documents into collectionid=db['goods'].insert({"name":"coffee","price":15})#insert one documentprint(db['goods'].get(id))inserted=db['goods'].insert([{"name":"apple","price":2},{"name":"apple","price":3}])#insert dataset#insert or update (upsert)db['goods'].insert({"name":"coffee","price":16,"_id":id},upsert=True)print(db['goods'].get(id))#transactionwithDBSession(db)ass:inserted=db['income'].insert({"product_id":id},session=s)inserted=db['outgoing'].insert({"product_id":id},session=s)#updatingdb['goods'].update(inserted,{"updated":True})print(db['goods'].all())#simple search without indexresult=db['goods'].find({"name":"apple"})#building complex queriesresult=db['goods'].find({"$and":[{"price":{"$gt":1}},{"price":{"$lte":10}}]})print(result)#hash indexes for unique valuesdb['goods'].register_hash_index("hash_dynamic","name",dynamic=True)#there are dynamic and stored indexesdb['goods'].reindex_hash("hash_dynamic")r=db['goods'].get_by_index(db["hash_dynamic"],"apple")#text indexesdb['goods'].register_text_index("fts","name",dynamic=True)#there are dynamic and stored indexesdb['goods'].reindex_text("fts")r=db['goods'].search_text_index("appl")#deletedb['goods'].delete(id)db['goods'].delete(inserted)#cleardb['goods'].clear()
Package: pysimplecache
Simple Caching Library for PythonSummarySimple caching library for supported providers.  Pass method call to caching provider along with
generated key to populate memcached with the result.  The results will be returned with a boolean value
if there was a cache miss to assist in any metrics generation.Versions0.0.1 - Support for memcached and json conversionGetting StartedInstantiate the provider:fromsimplecache.common.json_conversionimportJsonConversionfromsimplecache.providers.memcachedimportMemcachedProvidermemcached=MemcachedProvider(JsonConversion(),servers='127.0.0.1')PUT data into Memcached:data={'test1':'value1','test2':'value2'}memcached.put('testkey1',60,data)GET data by key from provider.  Optionally: Pass a method for a cache miss to load
data into provider from the result.classTestClass(object):deftest_method(self,param1,param2):data={'test1':'value1','test2':'value2'}ifparam1!='p1'orparam2!='p2':raiseException('Unexpected error.')returndatat=TestClass()# test local instance of memcached with cache missresponse,miss=memcached.get('testkey2',60,t.test_method,param1='p1',param2='p2')DELETE data by key from provider.memcached.delete('testkey1')
Package: pysimplecalc
What is simplecalc?A simple calculator, able to parse quite complex expressions:>>> from simplecalc import calc
>>> calc("2 + 3.5")
'5.5'
>>> calc("2 * log(100)")
'4'
>>> calc("sin(pi / 2)")
'1'
>>> calc("3 * 5!")
'360'
>>> calc("3 * 5! + ceil(sqrt(123) / ln(10))")
'368'
>>> calc("3**e  * 5! + ceil(sqrt(123) * ln(10))")
'2394.55888943'Note that these expressions are NOT evaluated by eval() or anything like that,
so it should be safe to get the expressions from untrusted sources. Use at
your own risk, of course.It can also be used as a script:$ simplecalc "3 * cos(pi)"
-3Project’s historyCode here comes from other internal Canonical’s project, this part was
opensourced in 2018:https://launchpad.net/simple-calcI forked that to bring it to GitHub, migrate it to Python 3, shape it more
like a project (have asetup.py, etc.), and do some releases.
Package: pySimpleCalculator
PySimpleCalculatorThis is a python package hosted on PYPI and can be used to perform basic functions on calculator such as;ADDITIONSUBTRACTIONDIVISIONMULTIPLICATIONFINDING THE  ROOT OF A NUMBERFINDING THE POWER OF A NUMBERGetting StartedInstallationpypi_calculator requires python3 and can be installed via PYPI$pipinstallgit+https://github.com/Sherlocked-Blaire/PySimpleCalculator.gitUsageThe calculator can be used for basic operations.he calculator has a memory that caches the last result until it is reset. The cached result is used in the next computation if not reset.Examples will be shown belowSample CodefromSimpleCalculatorimportCalculatorcalculator=Calculator()Addition>>>calculator.add(200)200Subtractionsubtract>>>my_cal.subtract(54)146because the memory was not reset,54was subtracted from previous value200Division>>>calculator.divide(2)73because the memory was not reset,146was divided by2Reset Memory>>>calculator.reset()>>>calculator.current_value()0
Package: pysimpledmx
pySimpleDMX===========### c0z3n 2012, GPL v3 ###pySimpleDMX is a simple python module designed to make basic DMX control in python easy.pySimpleDMX is designed for and requires an [Enttec USB DMX Pro](http://www.enttec.com/index.php?main_menu=Products&pn=70304&show=description&name=dmxusbpro) or compatible hardware for communication over a DMX network.#### Installation ####```# stablepip install pysimpledmx# headpip install git+https://github.com/c0z3n/pySimpleDMX.git```#### Initialization ####To initialize pySimpleDMX, initialize a `pysimpledmx.DMXConnection()` object, using the com port number of your enttec DMX USB Pro as an argument. For example, if our DMX USB Pro is on com port 3, we would initialize our dmx connection using `dmx = pysimpledmx.DMXConnection(3)`If for any reason the dmx connection fails to initialize on the provided com port, pysimpledmx will let you know via the console and close.# exampleimport pysimpledmxmydmx = pysimpledmx.DMXConnection(3)...#### Usage ####DMX output through pySimpleDMX is managed using a local list of size 512 in the `DMXConnection()` object, which represents the values for all 512 dmx channels in a single universe. When initialized, the default value for each channel is zero. to push the current list of values out over the dmx network, or 'update' the network, you must call the `.render()` method on your `DMXConnection()` object.to change the value for a channel, use the `setChannel()` method on your `DMXConnection()` object. `setChannel()` requires `chan` (channel) and `val` (value) arguments, as well as an optional `autorender` argument, which should be set to `True` if you wish to have PySimpleDMX automatically update the dmx output immediately upon changing the specified channel value.the `chan` and `val` arguments should be between 1 and 512 and between 0 and 255, respectively.unless the `autorender` argument is specified `True`, the `.render()` method must be called to update the dmx output. because of the serial communication with the DMX USB Pro, this is a relatively slow operation, and thus rendering should be done sparingly to avoid bottlenecking and setting `autorender` is not reccomended.# exampleimport pysimpledmxmydmx = pysimpledmx.DMXConnection(3)mydmx.setChannel(1, 255) # set DMX channel 1 to fullmydmx.setChannel(2, 128) # set DMX channel 2 to 128mydmx.setChannel(3, 0)   # set DMX channel 3 to 0mydmx.render() render    # render all of the above changes onto the DMX networkmydmx.setChannel(4, 255, autorender=True) # set channel 4 to full and render to the network#### Development ########## Bumping Version #####1. Change version in `./setup.py`2. `python setup.py sdist bdist_wheel upload` (requires `pip install wheel`)3. `git commit -am 'bump version to x.x.x'`3. `git tag x.x.x`4. `git push --tags`5. Add release to github tag, with changes and releasion name.
Package: py-simple-email
Python Simple Email Sender (using Threads)Python Simple Fast Email Sending Without External Library [Implemented with Multi-Threading]GitHub Repo:https://github.com/sannjayy/py-simple-emailInstallaionDo the following in your virtualenv:pip install py-simple-emailImport:from py_simple_email import EmailMinimal Code Example:frompy_simple_emailimportEmail# SMTP Configuration:email=Email(EMAIL_HOST='email-smtp.ap-south-1.amazonaws.com',EMAIL_HOST_USER='XXXXXXXXXXXXXX',EMAIL_HOST_PASSWORD='XXXXXXXXXXXXXXXXXXX',DEFAULT_FROM_EMAIL='Sanjay Sikdar <hello@sanjaysikdar.dev>',EMAIL_PORT=587,EMAIL_USE_TLS=True,)# Sending Email:email.send(to_email=['hello@sanjaysikdar.dev','hello@znassolutions.com'],subject='Test Mail',msg='Hello from Simple Email.',)Sending Fancy Emails:html="""\<html><body><p>Hi,<br>How are you?<br><a href="http://read.sanjaysikdar.dev">Sanjay Sikdar</a>has many great tutorials.</p></body></html>"""email.send(from_email='host@sanjaysikdar.dev',to_email='me@sanjaysikdar.dev',subject='HTML Test E-email',msg=html,is_html=True)Developed bySanjay Sikdar.📫me@sanjaysikdar.dev
Package: py-simple-flow
Python Simple FlowSimple framework with a defined structure for data processing with support for multi-processData processing flow is split into four phases:Source: Fetch the data from a sourceIngress: Register the data received, log or in DB for trace-abilityTransform: Business logic of transforming the data to your business needsEgress: Push the data to downstream or your storageProcessing can be done in one process, like running it in-process or in multi processing modeMode to be chosen depends on the task you are doingEasy setting up logger even in multi processing mode
Package: pysimplegui-exemaker
PySimpleGUI-exemakerIntroductionThis package contains a GUI front-end to PyInstaller.  Use this tool to create EXE files from your python programsInstallingWhen you install PySimpleGUI-exemaker, it will install the other components that it requires. To install, on windows, type this into a command prompt:pip install pysimplegui-exemakerPySimpleGUI ProjectThis program was built as a sample application of the PySimpleGUI GUI Framework.Running the programAfter your pip install, type this into your command prompt:python -m pysimplegui-exemaker.pysimplegui-exemaker