Saravanan666/pypi-org huggingface dataset:
Package: pymindergas
pymindergasA module to post meter readings toMinderGas.nl.Installation$pip3installpymindergasUsageIn order to be able to post readings, you first need to obtain anAPItoken.ThepostReading()method requires an authentication token (String) and the meter reading (Float). The reading date can be any valid date (String), but is optional.ParameterRequiredDescriptiontokenyesStringreadingyesFloatdatenoAny date string that can beparsed. If not passed, uses today.Code sample:fromdatetimeimportdatefromdatetimeimporttimedeltafrompymindergasimportMindergastoken="supersecretstring"reading=1234.567yesterday=date.today()-timedelta(days=1)# Post reading as yesterday'ssuccess=Mindergas().postReading(token,reading,yesterday.strftime('%y-%m-%d'))print(success)# Post reading as today'ssuccess=Mindergas().postReading(token,reading)print(success)DisclaimerThis is an open source project and does not have any affiliation withMinderGas.nl.All product names, trademarks and registered trademarks in this repository are property of their respective owners. All images in this repository are used by the project for identification purposes only.
Package: pymindmap
## 简介
pymindmap是一个由python控制的脑图编辑工具首先感谢百度开源的百度脑图https://github.com/fex-team/kityminder-editor
个人针对其做了python后端代码和一部分自己需要的功能## 安装并执行
安装` pip install pymindmap `安装成功后` pymindmap `## 额外功能
- 通过修改css代码实现了移动端浏览和放大缩小的手势操作
- 通过websocket推送实现了协同编辑和同步浏览功能
- 增加文件夹侧边栏，从而可以在单页面中创建切换导图以及文件夹，提供了脑图的导出功能，并将导出的脑图的js地址替换为github保障导出脑图无需客户端支持，用户可将导出脑图直接放入静态服务器从而对他人分享
- 增加python代码执行功能，导图中额外提供python控制导图页面的接口，从而让导图更加可交互；并对此提供了执行，停止，全部执行，全部停止等操作，用户可以自行探索
- 增加命令行模式，具体可以通过pymindmap –help查看，并提供pymindmap ps 和 pymindmap kill 命令查看删除导图唤醒的python 进程### 开发使用
该项目使用前后端分离的方式开发，使用nginx端口转发达成协调`bashdocker-composeup-d--build`To shut down:`bashdocker-composedown `### 本地测试运行
clone到本地后
python -m pymindmap### 构建
python setup.py sdist### 联系作者
问题和建议反馈：
邮件组：lfz163453@163.com或者在issue下反馈### 文档docs查看
clone到本地后执行` python-mpymindmap--mindmappath=docs/minders--picturepath=docs/pictures`
Package: pymine
Welcome to pyMine!Classis Mine game in python!pyMine is an open-source module for Python, helps you to create or play old classic Windows Mine game in Python Terminal enviorment.How to install?pippip install pymineHow to play?After installing module, you need to import it.from pyMine.engine import mine_enginepyMine module includesmine_engineclass,clear_terminalfunction andCOLORclass.
create amine_engineobject.game = mine_engine(row=10,col=10,mines_count=20)if you wish to define row,col and number of mines later, feel free to leave inputs empty, lator you can set or edit values by:num_mines -> intmap_size(row,col) -> functionAfter defining mine attributes, first we need to create game board and build cells, then we have to generate mines into board cell.game.create_map() #this will build up game map.
game.generate_mines() #this will generate mines and put them into game board.It's better not to change any of the attributes while playing to prevent any errors.After all these, you can now print out the game board.game.print_map()so now you can start playing, use flag(row,col) to flag a cell, use click(row,col) to choose and click on a cell, it will reveale number of mines around or it will explode!Have fun!contact me if you needed help or anything else:soroushmpour@gmail.com© @soroushamdg made it.
Package: pyminer
pyminer开源、友好、跨平台的数据分析解决方案pyminer 是一款基于Python的开源、跨平台数据分析环境。它以方便Python初学者为己任，在Python的知识理论和工作实践之间搭建桥梁，竭诚为初学者服务。它开箱即用，大大减少配置解释器环境的繁琐性。不仅提供了编程运行的功能，还能够以交互式的形式进行常见的数据分析操作，减少代码编写和文档查阅的时间。同时，pyminer将提供面向新手的快速入门教程，教程正由开发团队编写中。同时，我们诚挚希望与Python培训机构合作，让我们的产品帮助到更多学习Python的人。pyminer通过加载各种插件实现不同的需求，开发者可以通过编写插件，将pyminer扩展的更强大、更趁手，甚至创建一番自己的商用程序。🔈 声明pyminer 遵循LGPL协议，是一个开放、包容的开源项目，项目中的工具方法来源也非常广泛，因此允许并鼓励任何人在遵循LGPL协议的基础上：将pyminer用于商业、培训等任何合法场景；复制、修改 pyminer中的任意代码且无需声明；复制修改 pyminer官方文档；鼓励自行写作 pyminer 相关的书籍、博客、文档等内容（收费也可）；鼓励播主、培训机构培训 pyminer工具的任何内容（收费也可）；对于商业应用的技术咨询，pyminer团队保留服务的收费权。
pyminer希望成为一个伟大的开源项目，也希望得到大家的认可和赞美，仅此而已。🎉 技术说明项目开发环境支持跨平台，windows,linux,mac 都支持。Python版本：支持Python3.5及以上，但建议使用Python3.8及以上版本，性能更好。Qt的Python接口：使用PySide2，版本为5.15.2。项目开发环境使用PyCharm注意：pyminer 的官方发行版本为Python3.8+PySide2-5.15.2。开发者可自行使用其他版本的Python解释器配置相关环境。pyminer 曾经由PyQt5开发。但考虑到官方支持以及许可证的类型，我们已经迁移到了PySide2并改变许可证为LGPL。请勿使用PyQt5安装。当使用Python3.8配置环境时，不支持3.8.0等低版本的Python3.8解释器。当使用Python3.8时，请使用3.8.5或者更高版本的解释器。如果使用出现问题，欢迎提issue。🎁 文档地址项目文档：https://gitee.com/py2cn/pyminer/wikisAPI文档：http://py2cn.gitee.io/pyminerMATLAB与Numpy对比：http://mathesaurus.sourceforge.net/matlab-numpy.html⏳ 当前进度https://gitee.com/py2cn/pyminer/board🚄 开源地址Gitee：https://gitee.com/py2cn/pyminerGitHub：https://github.com/aboutlong/pyminer🥂 安装体验发行版下载（仅Windows系统）我们为Windows系统的用户提供了发行版的下载链接，你可以在我们的官网中下载发行版即刻体验。对于Mac OS和Linux系统的用户，暂时不提供发行版，可以参阅“开发者自行安装”一节。官网链接：请点击这里打开开发者自行安装（适合Windows、Mac OS以及各大Linux发行版）安装前准备：确认你的Python解释器版本。pyminer支持3.5~3.9。当使用Python3.8.x时，建议x>=5,也就是使用Python3.8.5及以上版本，否则安装PySide2可能遇到问题3.5.x/3.6.x/3.7.x/3.9.x下，由于开发人员不足，未进行充分测试。为稳定起见，建议解释器版本x>=5。建议新建全新的虚拟环境，尤其是当旧的虚拟环境中存在其他依赖于PyQt/PySide2的程序时。pyminer与这些程序可能发生依赖冲突。Windows安装#第一步：下载源代码gitclonehttps://gitee.com/py2cn/pyminer.git#安装依赖 (如果下载太慢，请复制源码目录下的 pip.ini 文件到python安装目录下)pipinstallpyminer#第三步：运行主程序pythonapp2.py开发重点（2021年4月修订）pyminer项目现在的开发目标是，打造初学者友好的Python编程环境，方便更多的人与Python这位踏实可靠（也有点笨呆呆）的自动化助手相知、相熟。因此pyminer的开发重点为：1、计算、统计方面低代码化功能性开发。需求详见：低代码化功能性开发2、编写适用于Python入门的pyminer官方教程。需求详见：编写教程。在教程编写方面，
我们深知开发团队力量有限，因此诚挚希望可以和各位开发者或培训机构合作。3、插件商店的开发。插件商店可以让pyminer如虎添翼。这一部分的开发需求详见：插件商店为了减少开发负担，样式表只使用浅色样式表（Fusion），不对深色样式表做优化，且不再进行界面语言翻译工作。
界面语言直接使用中文。📱 加入我们作者：pyminer Development Team邮箱：team@py2cn.com欢迎各位开发者大佬加入📱 支持我们🚥 许可说明本项目遵循LGPL许可证。许可解释权归属 pyminer Development Team。📸 预览截图基本界面代码提示绘图
Package: pyminer-algorithms-document-server
PyMiner Documentation ServerThis is a simple documentation server, mainly for PyMiner.PyMiner文档服务器这是一个简单的文档服务器，使用传统的后端渲染技术，主要采用了以下框架：WSGI服务器：waitress后端服务器：flaskMarkdown：markdown样式预处理器：sass目前非常不完善，只是一个临时的小服务器，欢迎各位一起完善。接口目前主要考虑两个接口：创建服务器：server = Server(base_path)启动服务器：server.run()打开特定页面：server.show(path: str)。
这将直接调用webbrowser.open打开一个网页。这个特定页面的路径应该是基于服务器的根路径base_path的相对路径，例如：importosfrompyminer_algorithms_document_server.serverimportServerif__name__=='__main__':server=Server(os.path.join(os.path.dirname(__file__),'base'))server.run()server.show('lib1/func1.md')fromtimeimportsleepsleep(10)应当注意的是，服务器跑在dameon线程中，当主程序退出时，子线程也会随之退出。致谢感谢nwljy提供的初版代码！
Package: pyminesweeper
Solvable-Minesweeper黑猫扫雷v2.2.5——包含8种模式的扫雷项目及高性能算法工具箱黑猫扫雷v2.2.5是由真正擅长扫雷的玩家开发的扫雷游戏，为高级玩家量身定制。内部集成了三大判雷引擎，具有全部6种无猜扫雷模式+标准+win7。采用Python/PyQt5及Rust编写，具有很高的内存安全性及速度。不同于Arbiter的专业、Minesweeper X的小巧，黑猫扫雷的开发人员希望制作出一款高度智能的扫雷。外观上它只是一款普通的标准扫雷，但它能任意调大小，能调整窗口的透明度。在游戏性方面，弱可猜、强可猜的模式都是独一无二的，也是唯一自带新手教程的扫雷。对于高玩来说，它又是专业的，能够计算3BV/s、STNB、RQP指标并展示。此外，它不会打扰玩家，当玩家不去主动打开时，就不会弹出任何窗口，且任何窗口都可以按下空格键快速关闭。目前还在开发过程中，欢迎提意见。Black Cat Minesweeper v2.2.5, which integrates three major internal mine detection engines, with all six kinds of no-guess minesweeper mode + standard + Win7. Using Python/PyQt5 and Rust, has high safety in memory and speed is different from the Arbiter of professional Minesweeper X of small, black cats demining developers hope to create a cool mine clearance Appearance, it is only a common standard mine, but it can adjust the size at will, can adjust the transparency of the window In terms of gameplay, weak can guess the strong can guess the mode is unique, and the only one of mine own tutorials For high play, it is professional, can calculate 3 bv/s STNBIn addition, it doesn't bother the player, no window pops up when the player doesn't open it, and any window can be quickly closed by pressing the space bar.使用教程：https://mp.weixin.qq.com/s/gh9Oxtv9eHaPTUMTDwX-fg安装建议在Windows 10下运行本游戏，其它操作系统未经测试，可能出现意想不到的问题。通过网盘安装(推荐)在下面的下载链接中找到最新的版本，然后下载，解压，直接运行main.exe文件，开箱即用。通过Github Actions安装在Github Actions找到构建成功的最近一次提交，点击更新内容，在Artifacts页面可以找到打包好的文件，后面步骤同上。这个方法可以体验最新功能，但不保证稳定性。从源码安装(不推荐)在编译之前，请确保自己拥有：Python 3.7/Python 3.8（Python 3.9会找不到ms_toollib.pyd，原因不明）Rust会用Powershell或者其它命令行工具的能力以下为安装步骤：克隆这个仓库到本地gitclonehttps://github.com/eee555/Solvable-Minesweeper.git安装Python依赖pipinstall-rrequirements.txt# Windowspip3install-rrequirements.txt# *nix用Rust编译扫雷核心引擎cdtoollibcargobuild--releasecd..cptoollib/target/release/ms_toollib.dllsrc/ms_toollib.pyd运行程序，大功告成了~py-3src/main.py# Windowspython3src/main.py# *nix实现原理（还没写，计划弄出3.5以后回头来写）同类项目kaboom：弱无猜扫雷。Simon Tatham's Mines：竞速无猜扫雷。带有局面调整算法，雷数很多时也能埋雷成功。FairMinesweeper：无猜扫雷。不一定能跑通。minegauler：标准扫雷。采用PyQt5实现，有一种在一个格子中埋多个雷的模式。LibreMines：标准扫雷。采用Qt实现。与同类项目相比，本项目更优秀。下载链接正式版v2.2：算法优化：埋雷速度达到37525局/秒，相当于Arbiter的三倍左右，无猜局面埋雷速度15.7局/秒。游戏结束按空格可以显示实力指标的极坐标图。删去了一些无用的功能。链接：https://wws.lanzous.com/iq9Ocm8zdtc正式版v2.2.5：算法优化：无猜局面埋雷速度达到约252局/秒。修复了上一个版本的严重bug。链接：https://wws.lanzous.com/iS3wImv2y5e测试版v2.2.6-alpha：测试版v2.2.6-alpha：修复了若干bug。算法优化：(16,16,72)无猜局面埋雷速度提高200%。新功能：快捷键4、5、6可以快速设置三种不同的自定义的自定义模式。对自定义模式的优化，提高了稳定性。对局面刷新的优化。链接：https://wwe.lanzous.com/igPFFo7mwxi
Package: pyminflux
pyMINFLUXReader, analyzer, and viewer of MINFLUX raw data.InstallationAppsCompiled executables (apps) for Linux, macOS and Windows can be downloaded from therelease page.Please note: since pyMINFLUX on macOS comes from anunidentified developer, you might need to make an exception in the macOS security settings when launching it for the first time. To do this, right-click on the application icon and selectOpen. After this initial setup, you can simply double-click the icon to launch pyMINFLUX normally.pipThe latest version of pyMINFLUX can also be installed frompypi.org. pyMINFLUX is compatible with and tested on Python 3.10 and 3.11. It is recommended to install pyMINFLUX in a conda environment as follows:$condacreate-npyminflux-envpython=3.10# or 3.11$condaactivatepyminflux-env
$pipinstall--upgradepyminfluxpyMINFLUX can then easily be run from the command line:$pyminfluxFor developers and tinkererspyMINFLUX is compatible with and tested on Python 3.10 and 3.11. For development, it is recommended to install pyMINFLUX in editable mode in acondaenvironment as follows:$condacreate-npyminflux-envpython=3.10# or 3.11$condaactivatepyminflux-env
$gitclonehttps://github.com/bsse-scf/pyMINFLUX/path/to/pyminflux
$cd/path/to/pyminflux
$python-mpipinstall-e.Running pyMINFLUX from console$cd/path/to/pyminflux
$pythonpyminflux/main.py# As a Python script, or$pyminflux# as a standalone toolUsing the pyMINFLUX API from Python scripts or Jupyter NotebooksThe graphical user interface is not the only way to use pyMINFLUX. Indeed, the pyMINFLUX core library can be integrated in Python scripts or Jupyter Notebooks. The documentation for the pyMIMFLUX core API can be found onhttps://pyminflux.ethz.ch/api/pyminflux/; an example Jupyter Notebook isbundled with the code.User manualThe user manual is hosted in theproject wiki.Official websiteThe official pyMINFLUX website is onhttps://pyminflux.ethz.ch.pyMINFLUX mailing listJoin thepyMINFLUX mailing listfor release announcements and further discussions.Citing pyMINFLUXIf you use pyMINFLUX in your research, please cite this repository as follows:Aaron Ponti, Javier Casares Arias, & Thomas Horn. (2023). pyMINFLUX. Zenodo.
Package: pyminhaufop
pyMinhaUFOPWrapper não-oficial para a API mobile da MinhaUFOPVeja mais detalhes noGithubO que é?Este wrapper expõe a API Mobile do AplicativoMinha UFOP.InstalaçãoAutomático (recomendado)$ pip install pyminhaufop --upgradeManualClone este repositório$ python setup.py installLembre-se de manter a biblioteca sempre atuaizada.Uso e ExemplosDocumentaçãoVocê pode acessar a documentação adicional por meio do parâmetro__doc__.>>frompyminhaufopimportMinhaUFOP>>print(MinhaUFOP.cardapio_do_ru.__doc__)Login e InicializaçãoSimplesfrompyminhaufopimportMinhaUFOP# inicializa a classeapi=MinhaUFOP()# Logue e gere o tokenapi.login('123.456.789-10','sua_senha')# acesse as funções da APIsaldo=api.saldo_do_ru()print(saldo['saldo'])Com senha hasheadafrompyminhaufopimportMinhaUFOP# inicializa a classeapi=MinhaUFOP()# Logue usando uma senha hasheada em MD5api.login('123.456.789-10','sua_senha_em_MD5',encode=False)# acesse as funções da APIsaldo=api.saldo_do_ru()print(saldo['saldo'])Utilizando conta com mais de um perfil# Você pode passar os dados de forma direta# identificacao = matrícula com pontos# perfil =#        - "G" - Alunos de Graduaçãoapi.login('123.456.789-10','sua_senha',identificacao="20.1.0000",perfil="G")ouIndique o index do perfil. O mais recente é o index 0.api.login('123.456.789-10','sua_senha',perfil_num=0)Atualizando o tokenSe o seu token estiver expirado você pode atualizá-lo sem precisar de repetir o processo de login.api.atualizar_token()RUSaldosaldo=api.saldo_do_ru()CardápioAcessar cardápio da semanacardapio=api.cardapio_do_ru()ouAcessar cardápio de um dia específico na semanacardapio=api.cardapio_do_ru(dia_da_semana=0)# 0 (segunda) a 4 (sexta)Extratoextrato=api.extrato_ru(inicio='2020-01-01',fim='2020-08-01')print(extrato)Salvar foto de um CPF# Retorna a foto em bytesfoto=api.foto('123.456.789-10')# Salvar a foto em um arquivo .pngwithopen('ex.png','wb')asfile:file.write(foto)Atestado de Matrículaprint(api.atestado())BoletoListagemprint(api.listar_boletos())GerarfrompyminhaufopimportMinhaUFOPfrompyminhaufop.exceptionsimportMinhaUFOPHTTPErrorapi=MinhaUFOP()a=api.login("123.456.789-10","hunter2")try:boleto=api.gerar_boleto(valor=12.0,matricula="20.1.1234",perfil="G")exceptMinhaUFOPHTTPErroraserr:iferr.status_code==500:print("Já existe um boleto com pagamento pendente.")
Package: pyminhook
pyminhook此库是对minhook的python包装，仅支持windows。用法如下importctypesfromctypesimportwintypesfromminhookimport*if__name__=="__main__":classTestHook(Hook):prototype=ctypes.WINFUNCTYPE(wintypes.HANDLE,wintypes.LPCWSTR)modname='kernel32'apiname='GetModuleHandleW'defdetour(self,lpModuleName):print('before hook param',lpModuleName)ret=self.fp_orginal(lpModuleName)print('after hook ret =%08X'%ret)returnreth=TestHook()print('-'*32)print('call 1 ret =%08X'%h.fp_target('kernel32'))print('-'*32)h.disable()print('call 2 ret =%08X'%h.fp_target('ntdll'))print('-'*32)h.enable()print('call 3 ret =%08X'%h.fp_target('user32'))输出如下:--------------------------------
before hook param kernel32
after hook ret = 7FF970430000
call 1 ret = 7FF970430000
--------------------------------
call 2 ret = 7FF9718E0000
--------------------------------
before hook param user32
after hook ret = 7FF970120000
call 3 ret = 7FF970120000
Package: pymini
pyminiPython minifier. Built to operate on entire libraries, persisting and supporting minification across files.Installationpip install pyminiUsagepymini [options] <file>To uglify a library, use the following options to preserve
your ability to import and use the library's publicly-facing
utilities.pymini --keep-module-names --keep-global-variables <file>ComparisonWe run comparisons against the following:pyminify -https://github.com/dflook/python-minifierpyminifier -https://github.com/liftoff/pyminifiermnfy -https://github.com/brettcannon/mnfy(does not work on Python >3.4)To repeat our results, run the following to setup.pip install python-minifier
pip install setuptools==57.5.0 && pip install pyminifier  # hack to get pyminifer to install
pip install mnfy  # if you're running python3.4
pip install pymini  # oursThen, run the following to get mini'd versions of the sample filesample/test.py, which comes frompyminifer's repository.mkdir -p out
pyminify --rename-globals --remove-literal-statements sample/test.py > out/pyminify.py
pyminifier --obfuscate sample/test.py > out/pyminifier.py
python -m mnfy sample/test.py > out/mnfy.py
uglipy sample/test.py > out/pyminiest.pyThen, runls -lh out. You should see the following.total 24
-rw-r--r--  1 alvinwan  staff   414B Nov 25 01:22 pyminiest.py
-rw-r--r--  1 alvinwan  staff   602B Nov 25 01:19 pyminifier.py
-rw-r--r--  1 alvinwan  staff   490B Nov 25 01:18 pyminify.pyBy comparison, the original file size was 1355B;uglipyachieves the smallest file size, 16% smaller thanpyminifyand 30% smaller thanpyminifier, improving the best possible obfuscated file size reduction from 64% to 71%. We can also test againsttest2.py, which comes frompyminify's repository.-rw-r--r--  1 alvinwan  staff   914B Nov 25 02:09 pyminiest.py
-rw-r--r--  1 alvinwan  staff   1.4K Nov 25 01:32 pyminifier.py
-rw-r--r--  1 alvinwan  staff   977B Nov 25 01:32 pyminify.pyBy comparison, the original file size was 1990B.uglipy's file size is 6% smaller thanpyminifyand 34% smaller thanpyminifier, improving the best possible obfuscated file size reduction from 51% to 54%.DevelopRun tests using the following, from the root directorypy.test --doctest-modules
Package: pyminiCLI
pyminiCLIthe quickest and simplest way to specify command-line interfaces for python scripts and apps.how it workssimply call minicli.command on a function in your script, and its positional
arguments will be interpereted as command-line positionals, its keywords as
command-line options, and its docstring used to supplement the usage in
--helpIf you provide type-hints for any of the arguments, the command-line inputs will
be converted to this type for you.in example.py:from minicli import command

def a_function(positional1, a_float: float, *args, keyword_only, kwarg='blarg'):
    """
    A description of the command

    Arguments:
      positional1 (integer): the first positional argument
      a_float (float): e.g. 1.5
      *args: any number of other arguments
      keyword_only: non-optional -- argument (a number)
      kwarg: an option
    """
    print("Hello!")
    print('I recieved positional: ', positional1)
    print("I converted this for you:", a_float, type(a_float))
    print('required keyword: ', keyword_only)
    print('other positionals: ', *args)
    print('my options are: ', kwarg)
    return

command(a_function)
# should have usage, followed by docstring as help
# all positionals should be passed in order
# all options as keywordsthe result:$ python example.py a 1.43 b c d e --keyword_only b --kwarg z
Hello!
I recieved positional:  a
I converted this for you: 1.43 <class 'float'>
required keyword:  b
other positionals:  b c d e
my options are:  z
$ python example.py --help
usage:  positional1  a_float <args... > [--keyword_only <value> (required)]  [--kwarg <value>] 

    A description of the command

    Arguments:
      positional1 (integer): the first positional argument
      a_float (float): e.g. 1.5
      *args: any number of other arguments
      keyword_only: non-optional -- argument (a number)
      kwarg: an optionContributingIf you would like to add to pyminiCLI:make an issue explaining what improvment you would like to makecreate a pull requestsee below for ideas for what to improveTo doboolean optionserror incorrectly lists varargs as requiredone-letter flagsmultiple named commands in the same python appinclude type hints in --helpautomatically include defaults in docstill work if options provided before positionals
Package: pyminimax
PyMinimaxPyMinimax is a Python implementation of minimax-linkage hierarchical clustering.InstallationpipinstallpyminimaxUsagefrompyminimaximportminimaxfromscipy.spatial.distanceimportpdistfromscipy.cluster.hierarchyimportcompletedata=[[0,0],[0,1],[1,0],[0,4],[0,3],[1,4],[4,0],[3,0],[4,1],[4,4],[3,4],[4,3]]dist=pdist(data)# flattened distance matrix computed by scipyZ_complete=complete(dist)# complete linkage resultZ_minimax=minimax(dist)#  minimax linkage resultThe most important function in PyMinimax ispyminimax.minimax. Its usage is very much similar to the hierarchical clustering methods in SciPy, sayscipy.cluster.hierarchy.complete. See thedocumentationfor more details.
Package: pyminioadmin
MinIO Admin Clientpyminioadminis a Python Wrapper for the MinIO client (mc) that provides admin operations and other functionalities not supported by the official Minio SDK. Please note that this wrapper requires the MinIO client (mc) to be installed on the machine.RequirementsPython and pip installed.MinIO client installed on the machine with the path environment added asmc.Usage ExamplefrompyminioadminimportMinioAdminClient# Initialize the MinIO Admin Clientclient=MinioAdminClient('host:3000','access-key','secret-key')# Example: Create a new userclient.create_user('new-access-key','new-secret-key')Source CodeThe source code for this project is available on GitHub:GitHub Repository
Package: pyminion
PyminionPyminion is a library for executing and analyzing games ofDominion.
At its core, pyminion implements the rules and logic of Dominion and provides
an API to interact with the game engine. In addition, it enables interactive
games through the command line and simulation of games between bots.Table of ContentsInstallationUsageSupportContributingInstallationPyminion requires at least Python 3.8 and can easily be installed through pypipython3-mpipinstallpyminionUsageSetting up a gameTo play an interactive game through the command line against a bot, initialize
a human and a bot and assign them as players. Alternatively, games can be
created between multiple humans or multiple bots.frompyminion.expansions.baseimportbase_setfrompyminion.expansions.intrigueimportintrigue_setfrompyminion.gameimportGamefrompyminion.bots.examplesimportBigMoneyfrompyminion.humanimportHuman# Initialize human and bothuman=Human()bot=BigMoney()# Setup the gamegame=Game(players=[human,bot],expansions=[base_set,intrigue_set])# Play gamegame.play()Creating BotsDefining new bots is relatively straightforward. Inherit from theBotDeciderclass and implement play and buy strategies in theaction_priorityandbuy_prioritymethods respectively.For example, here is a simple big money + smithy bot:frompyminion.bots.botimportBot,BotDeciderfrompyminion.expansions.baseimportgold,province,silver,smithyfrompyminion.playerimportPlayerfrompyminion.gameimportGameclassBigMoneySmithyDecider(BotDecider):"""Big money + smithy"""defaction_priority(self,player:Player,game:Game):yieldsmithydefbuy_priority(self,player:Player,game:Game):money=player.state.moneyifmoney>=8:yieldprovinceifmoney>=6:yieldgoldifmoney==4:yieldsmithyifmoney>=3:yieldsilverclassBigMoneySmithy(Bot):def__init__(self,player_id:str="big_money_smithy",):super().__init__(decider=BigMoneySmithyDecider(),player_id=player_id)To see other bot implementations with more advanced decision trees, see/botsRunning SimulationsSimulating multiple games is good metric for determining bot performance.
To create a simulation, pass a pyminion game instance into theSimulatorclass and set the number of iterations to be run.frompyminion.bots.examplesimportBigMoney,BigMoneySmithyfrompyminion.expansions.baseimportbase_set,smithyfrompyminion.gameimportGamefrompyminion.simulatorimportSimulatorbm=BigMoney()bm_smithy=BigMoneySmithy()game=Game(players=[bm,bm_smithy],expansions=[base_set],kingdom_cards=[smithy],log_stdout=False)sim=Simulator(game,iterations=1000)result=sim.run()print(result)with the following terminal output:~$ python simulation.pySimulation Result: ran 1000 gamesbig_money won 110, lost 676, tied 214big_money_smithy won 676, lost 110, tied 214Please see/examplesto see demo scripts.SupportPleaseopen an issuefor support.ContributingInstall this library, test it out, and report any bugs. A welcome contribution
would be to create new bots, especially an implementation that uses machine
learning to determine optimal play.If you would like to contribute, please create a branch, add commits, andopen a pull request.