Saravanan666/pypi-org huggingface dataset:
Package: higlass-python
higlass-python 🔎A fresh Python library forhiglassbuilt
on top of:higlass-schema: Pydantic models for HiGlass.higlass-widget: A cross-platformAnyWidgetfor Jupyter environments.Installationpipinstallhiglass-pythonUsageimporthiglassashg# Remote data source (tileset)tileset1=hg.remote(uid="CQMd6V_cRw6iCI_-Unl3PQ",server="https://higlass.io/api/v1/",name="Rao et al. (2014) GM12878 MboI (allreps) 1kb",)# Local tilesettileset2=hg.cooler("../data/dataset.mcool")# Create a `hg.HeatmapTrack` for each tilesettrack1=tileset1.track("heatmap")track2=tileset2.track("heatmap")# Create two independent `hg.View`s, one for each heatmapview1=hg.view(track1,width=6)view2=hg.view(track2,width=6)# Lock zoom & location for each `View`view_lock=hg.lock(view1,view2)# Concatenate views horizontally and apply synchronization lock(view1|view2).locks(view_lock)To learn more about the new API, check out theupdated documentation.Upgrade Guidehiglass-pythonv1.0 is a total rewrite of our prior
implementation, aimed to offer a more ergonomic and flexible API. While this
might present challenges when upgrading existing code, we've prepareddocumentationto guide you through the new API usage.If you find a missing feature, please open an issue – we're committed to
supporting your use cases with the new API.Despite the large changes in v1.0, we will strive to avoid breaking changes
going forward. However, because of the complete rewrite, the v1.0 release
doesn't strictly adhere to semantic versioning. You can think of it as a pre-1.0
release, with breaking changes and new features included in minor releases, and
bug fixes in patch releases.We will aim for strict semantic versioning with the v2.0 release. Your feedback
and understanding are greatly appreciated.Developmenthiglass-pythonusesthe recommendedhatchlingbuild-system, which is convenient to use via thehatchCLI. We recommend installinghatchglobally (e.g., viapipx) and running the various commands defined withinpyproject.toml.hatchwill take care of creating and synchronizing a virtual
environment with all dependencies defined inpyproject.toml.Commands CheatsheetAll commands are run from the root of the project, from a terminal:CommandActionhatch run fixFormat project withblack .and apply linting withruff --fix .hatch run lintLint project withruff ..hatch run testRun unit tests withpytestin latest Python version.hatch run test:testRun unit tests withpytestin all target Python versions.hatch run docs:buildBuild the documentation indocs/_build/html.hatch run docs:serveStart an dev-server for live editing RST files indocs/.Note:hatch buildandhatch publishare available to build and publish
the project to PyPI, but all releases are handled automatically via CI.Alternatively, you can develophiglass-pythonby manually creating a virtual
environment and managing installation and dependencies withpip. For example,
create a virtual environment withconda:condacreate-nhiglasspython=3.11
condaactivatehiglassand installhiglass-pythonineditablemode with all optional
dependencies:pipinstall-e".[dev,fuse,docs]"Our CI checks formatting (black .), linting (ruff .), and tests (pytest).
Package: higlass-schema
higlass-schemaPydantic models for HiGlasspipinstallhiglass-schema🚧 👷Development$pipinstall-e.
$higlass-schemacheck./example.json# [--verbose]$higlass-schemaexport# prints JSON schema to stdoutReleasegittag-av0.0.0-m"v0.0.0"gitpush--follow-tags
Package: higlass-widget
higlass-widgetpip install higlass-widgetDevelopmentThis project useshatch, which installs and sync
all dependencies frompyproject.tomlautomatically.hatchshellAlternatively, you can create and manage your own virtual environments and install
an editable version ofhiglass-widget:pipinstall-e".[dev]"Finally, you can now run the notebooks with:jupyterlabhiglass_widget.HiGlassWidgetis built withanywidget.
You can edit the contents ofhiglass_widget/widget.jsand changes will be reflected automatically
in your active Jupyter notebook.Releasenpm version [major|minor|patch]
git tag -a vX.X.X -m "vX.X.X"
git push --follow-tags
Package: higradpy
This is the Python package for HiGrad (Hierarchical Incremental Gradient Descent), an algorithm for statistical inference for online learning and stochastic approximation.Stochastic gradient descent (SGD) is an immensely popular approach for online learning in settings where data arrives in a stream or data sizes are very large. However, despite an ever-increasing volume of work on SGD, much less is known about the statistical inferential properties of SGD-based predictions. Taking a fully inferential viewpoint, this paper introduces a novel procedure termed HiGrad to conduct statistical inference for online learning, without incurring additional computational cost compared with the vanilla SGD. The HiGrad procedure begins by performing SGD iterations for a while and then split the single thread into a few, and this procedure hierarchically operates in this fashion along each thread. With predictions provided by multiple threads in place, a t-based confidence interval is constructed by decorrelating predictions using covariance structures given by the Ruppert–Polyak averaging scheme. Under certain regularity conditions, the HiGrad confidence interval is shown to attain asymptotically exact coverage probability.Reference: Weijie Su and Yuancheng Zhu. (2018) Statistical Inference for Online Learning and Stochastic Approximation via Hierarchical Incremental Gradient Descent.GitHub:https://github.com/vihan13singh/higradpy
Package: hi-hello
Hi Hello!Just a very nice library that says hello to you.InstallationInstall theHi Hellopackage for Python.pip install hi-helloPrint a new word while starting up your program (or any other time)const learnAWord = require('learn-a-word');

  // Print a new word 
  learnAWord.printWord();Output================== WORD OF THE DAY ==================
  insatiable
  not easily satisfied; unquenchable
  =====================================================
Package: hihunter
HiHunterhihunter是基于Virustotal的命令行工具。一、安装$ pip install hihunter二、使用2.1 命令工具命令行说明使用示例nextb-hihunter-virustotalNextB的Virustotal命令行工具，输出结果参考：3.1 nextb-hihunter-virustotal命令行的输出结果nextb-hihunter-virustotal -c ./nextb-hihunter_config.json配置文件格式见：四、配置文件三、执行结果3.1 nextb-hihunter-virustotal命令行的输出结果# usage 输出结果
nextb-hihunter-virustotal.exe -c "nextb_hihunter_config.json" -f usage
Virustotal使用情况如下:
本日已请求次数: 3148
每日请求次数上限: 30000
本日已使用比例: 0.10493333333333334
本月已请求次数: 257086
每月请求次数上限: 930000
本月已使用比例: 0.27643655913978493
每分钟请求次数: 10000
每小时请求次数: 467

# download 输出结果
nextb-hihunter-virustotal.exe -c "nextb_hihunter_config.json" -f download -hk 0b331b99595a863934c268ab1d1280e2
./downloads\0b331b99595a863934c268ab1d1280e2: 100%|█████████████████████████████████████████████████████████| 13.8k/13.8k [00:00<00:00, 233kiB/s]
下载文件成功，文件保存路径：./downloads\0b331b99595a863934c268ab1d1280e2

# filter 输出结果
nextb-hihunter-virustotal.exe -c "nextb_hihunter_config.json" -f filter -n 4
+----------------------------------+------------------------+----------+--------------------+
|             文件md5              |        威胁标签        | positive |     提交文件名       |
+----------------------------------+------------------------+----------+--------------------+
| d710e95ae12def06be68a4a432ceac48 |     trojan.hidden      |    16    |  SWIFT $140,043.   |
| bc853bdf4fbb7603ec1f23710f167236 |     trojan.hidden      |    13    |  SWIFT $140,043.   |
| 72aca0f5bc8a61384eb9be2a4d2c756e |                        |    0     |  C8F5220D0C2.A01   |
| 0912d2ce810815e9684393af97b70e7f |                        |    0     |  phish_alert_sp2   |
+----------------------------------+------------------------+----------+--------------------+
--------------------2023-01-19 21:02:14--------------------四、配置文件{// virustotal配置参数"virustotal":{"api_key":"",// virustotal的api_key"filter_delay":1,// 起始时间，默认最近1个小时前开始"filter_querys":["p:1+ p:10- tag:email"],// virustotal的筛选条件"filter_number":10,// 每次筛选返回的数量"download_dir":"./downloads",// 样本下载保存目录"download_hash":"",// 样本哈希"download_hash_file":""// 样本哈希列表文件，每行一个哈希值},"database":{"sqlite_db_name":"./NextBHihunter.db"// 保存筛选样本的sqlite数据库名称}}
Package: hijiki
HijikiPython Rabbit wrapper library to simplify to use Exchanges and Queues with decoratorsConfigurationsHijiki uses environment variables to configure connection with BROKER.COMMONBROKER_PWDBROKER_USERNAMEFor single serverBROKER_PORTBROKER_SERVERFor cluster serverBROKER_CLUSTER_SERVERif BROKER_CLUSTER_SERVER is present the priority is generate URI using this list of servers, and not use the sever for single server.
To user multiples server from cluster is necessary this environment variable has a list of server with port separates with comma.Ex:serverA:5672,serverB:5673generating for uri connection string the value aboveamqp://usr:password@server:5672;amqp://usr:password@serverB:5672;The user and password is the same for all servers.If server is not present, even BROKER_CLUSTER_SERVER, the connection url will be a default, and to others configs will be changed for "teste".How to usePublisherThe example demonstrate how to publish a simple message to topic "teste1_event" with a json message:pub=Publisher("localhost","rabbitmq","rabbitmq",5672)pub.publish_message('teste1_event','{"value": "Esta é a mensagem"}')ConsumerConsumer uses a configuration to define QUEUES and Exchanges and the consumer is a decorator for the queue.fromhijiki.broker.hijiki_rabbitimportHijikiQueueExchange,HijikiRabbitqs=[HijikiQueueExchange('teste1','teste1_event'),HijikiQueueExchange('teste2','teste2_event')]gr=HijikiRabbit().with_queues_exchange(qs)\.with_username("rabbitmq")\.with_password("rabbitmq")\.with_host("localhost")\.with_port(5672)\.build()classMyConsumer():@gr.task(queue_name='teste1')defmy_consumer(data):print(f"consumer 1 executed with data :{data}")@gr.task(queue_name='teste2')defmy_consumer2(data):print(f"consumer 2  executed with data :{data}")if__name__=='__main__':MyConsumer()gr.run()
Package: hijri
Hijri Date FetcherA Python package to fetch current hijri date in ArabicUsagefrom hijri import Hijri
h = Hijri()
h.fetch()

# Output is the literal day and date in Arabic: الأربعاء 4 ذو الحجة 1442 ﻫDependenciesYou may download the following dependencies in order for the script to workFor your terminal, you have to have bothwgetandlibxml2-utilsFor python3, you have to install the following packages,arabic_reshaperandpython-bidi
Package: hijri-calendar
Hijriah Date ConverterA package to convert between Hijri and Gregorian calendar date using the Umm al-Qura calendar.Installationpip install hijri-calendarFeatures(Probably) supported ISO and another extendable date formatRepresentation to string with formatted name of the month based on hijriah calendarOffset and limit range for both calendarUsageThe usage itself is quite straightforward, just inputted the gregorian or hijri version of the calendar with something like:fromhijri.coreimportHijriah# convert gregorian calendary day into hijriah>>>gregorian=Hijriah(23,3,2021)>>>print(gregorian.to_hijri())'1455/8/1'# getting hijri based month for both calendar>>>example=Hijriah(21,2,2009).get_hijri_month()>>>print(example)'Safar'# converting into ISO format>>>example=Hijriah.to_representation(21,2,2009,"ISO")>>>print(example)'2009/21/2'For further usage, please refer theexample.pyfileAcknowledgmentFor the calculation formula itself i adopted from several resources and packages, especially with these two,Python Islamic LibraryandHijri.jsCaveatsFor accuracy itself, to be honest i don't really know how accurate it is for calendar conversion. For example, if we inputted the current date (from 2021), the conversion result to the hijri year is 1455 which is actually wrong. After some research, there is a leap day in the Hijri calendar which will increase every 2 or 3 years and there are also 11 leap years in a 30-year cycle. Their distribution varies slightly from one country or Muslim community to another.In addition to the leap days that inserted in solar calendars like the Gregorian calendar or Julien Calendar, the Hijriah leap day is not designed to align the calendar with the solar year, which on average lasts just over 365 days.Furthermore, this makes the calculation of the months in Hijriah calendar is difficult to predict / compute. For example, bad weather conditions may delay the beginning of a new month by one day at short notice.
Package: hijri-converter
hijri-converterA Python package to convert accurately between Hijri and Gregorian dates using
the Umm al-Qura calendar.⚠️Deprecation NoticeThis package has beendeprecatedand will not receive future updates.
Please use thehijridatepackage
instead.For migration tohijridate, install the package:pip install hijridate~=2.3.0Then change the import statement as:fromhijridateimportHijri,GregorianFeaturesAccurate and verified date conversion.Optimized code performance compared to similar packages.Intuitive, clean, and easy-to-use interface.Most of the methods and formats are similar to those of standard library.Multilingual representation of weekday names, months, and calendar era
notations.Easily extendable to support other natural languages.Rich comparison between dates.Validation of input dates.Works on Python 3.7+ with zero dependencies.Thoroughly tested with 100% test coverage.LimitationsThe date range supported by converter is limited to the period from the
beginning of 1343 AH (1 August 1924 CE) to the end of 1500 AH (16 November
2077 CE).The conversion is not intended for religious purposes where sighting of the
lunar crescent at the beginning of Hijri month is still preferred.InstallationTo install usingpip, run:pipinstallhijri-converterTo install usingconda, run:condainstall-cconda-forgehijri-converterBasic Usagefromhijri_converterimportHijri,Gregorian# Convert a Hijri date to Gregoriang=Hijri(1403,2,17).to_gregorian()# Convert a Gregorian date to Hijrih=Gregorian(1982,12,2).to_hijri()DocumentationPlease seehttps://hijri-converter.readthedocs.iofor full documentation of
this package, including background, benchmarking, usage examples and API
reference.LicenseThis project is licensed under the terms of the MIT license.AcknowledgementsR.H. van Gent— inspiration,
scientific guidance and resources.@AZalshehri7— support in dates review
and conversion accuracy verification.
Package: hijridate
HijriDateformerlyhijri-converterA Python package to convert accurately between Hijri and Gregorian dates using
the Umm al-Qura calendar.FeaturesAccurate and verified date conversion.Optimized code performance compared to similar packages.Intuitive, clean, and easy-to-use interface.Most of the methods and formats are similar to those of standard library.Multilingual representation of weekday names, months, and calendar era
notations.Easily extendable to support other natural languages.Rich comparison between dates.Validation of input dates.Works on Python 3.8+ with zero dependencies.Thoroughly tested with 100% test coverage.LimitationsThe date range supported by converter is limited to the period from the
beginning of 1343 AH (1 August 1924 CE) to the end of 1500 AH (16 November
2077 CE).The conversion is not intended for religious purposes where sighting of the
lunar crescent at the beginning of Hijri month is still preferred.InstallationTo install usingpip, run:pipinstallhijridateTo install usingconda, run:condainstall-cconda-forgehijridateBasic UsagefromhijridateimportHijri,Gregorian# Convert a Hijri date to Gregoriang=Hijri(1403,2,17).to_gregorian()# Convert a Gregorian date to Hijrih=Gregorian(1982,12,2).to_hijri()DocumentationPlease seehttps://hijridate.readthedocs.iofor full documentation of this
package, including background, benchmarking, usage examples and API reference.LicenseThis project is licensed under the terms of the MIT license.AcknowledgementsR.H. van Gent— inspiration,
scientific guidance and resources.@AZalshehri7— support in dates review
and conversion accuracy verification.
Package: hikapi
根据 海康 的综合安防管理平台写的python库https://open.hikvision.com/docs/docId?productId=5c67f1e2f05948198c909700&version=%2Ff95e951cefc54578b523d1738f65f0a1&tagPath=%E7%BC%96%E7%A8%8B%E5%BC%95%E5%AF%BC-%E4%B8%80%E5%8D%A1%E9%80%9A%E5%BA%94%E7%94%A8%E6%9C%8D%E5%8A%A1
Package: hikari-arc
hikari-arcA command handler forhikariwith a focus on type-safety and correctness.InstallationTo install arc, run the following command:pipinstall-Uhikari-arcTo check if arc has successfully installed or not, run the following:python3-marc# On Windows you may need to run:py-marc[!NOTE]hikari-arcrequires a Python version ofat least3.10.If you're just getting started, you may also use thetemplate repositoryto get started with.Basic Usageimporthikariimportarcbot=hikari.GatewayBot("TOKEN")# or hikari.RESTBotclient=arc.GatewayClient(bot)# or arc.RESTClient@client.include@arc.slash_command("hi","Say hi!")asyncdefping(ctx:arc.GatewayContext,user:arc.Option[hikari.User,arc.UserParams("The user to say hi to.")])->None:awaitctx.respond(f"Hey{user.mention}!")bot.run()To get started witharc, see thedocumentation, or theexamples.Issues and supportFor general usage help or questions, see thehikari discord, if you have found a bug or have a feature request, feel free toopen an issue!ContributingSeeContributing.Acknowledgementsarcis in large part a combination of all the parts I like in other command handlers, with my own spin on it. The following projects have inspired me and aided me greatly in the design of this library:hikari-lightbulb- The library initially started as a reimagination of lightbulb, it inherits a similar project structure and terminology.Tanjun- For the idea of usingtyping.Annotatedanddependency injectionin a command handler.arcalso uses the same dependency injection library,Alluka, under the hood.hikari-crescentThe design ofhooksis largely inspired bycrescent.FastAPI- Some design ideas and most of thedocumentationconfigurationderives fromFastAPI.LinksDocumentationExamplesLicense
Package: hikari-bot-official
Hikari战舰世界水表BOT💘您不打算给可爱的Hikari点个Star吗QAQ简介战舰世界水表BOT，基于Nonebot2，适配QQ官方机器人
水表人，出击！wws me recent！！！特色账号总体、单船、近期战绩全指令支持参数乱序快速切换绑定账号实时推送对局信息支持@快速查询全异步，高并发下性能更优适配官方BOT点我查看功能列表绑定账号：wws bind/set/绑定 [服务器+游戏昵称]：查询账号绑定列表：wws [查询/查]绑定/绑定列表 [me/@群友]：切换删除绑定账号：wws [切换/删除]绑定 [序号]查询账号总体战绩：wws [(服务器+游戏昵称)/@群友/me]查询账号历史记录：wws [(服务器+游戏昵称)/@群友/me] record查询账号近期战绩：wws [(服务器+游戏昵称)/@群友/me] recent [日期]查询单船总体战绩：wws [(服务器+游戏昵称)/@群友/me] ship [船名]查询单船近期战绩：wws [(服务器+游戏昵称)/@群友/me] ship [船名] recent [日期]查询服务器排行榜：wws [服务器+战舰名] rank/ship.rank查询军团详细信息：wws [(服务器+军团名)/@群友/me] clan查询军团历史记录：wws [(服务器+军团名)/@群友/me] clan record查询舰船中英文名：wws [搜/查船名] [国家][等级][类型]添加游戏战绩监控: wws [添加监控] [服务器] [游戏昵称] [备注名]查询游戏战绩监控: wws [查询监控]删除游戏战绩监控: wws [删除监控] [监控序号]重置全部战绩监控: wws重置监控检查版本更新：wws 检查更新更新：wws 更新Hikari查看帮助：wws help噗噗：一言在Windows系统上快速部署windows安装python版本请勿大于3.11,建议版本3.10下载Hikari的最新Release并解压到合适文件夹复制一份.env.prod-example文件，并将其重命名为.env.prod,打开并按其中注释编辑只显示了.env，没有后面的后缀？请百度windows如何显示文件后缀名id = xxxx
token = xxxxx
secret = xxxxx
API_TOKEN = xxxxxxxx #无需引号，TOKEN即回复您的邮件所带的一串由[数字+冒号+英文/数字]组成的字符串
SUPERUSERS=["唯一ID"]最后TOKEN应该长这样API_TOKEN = 123764323:ba1f2511fc30423bdbb183fe33SUPERUSERS请在首次启动BOT后发送test，BOT将会回复你的USER_ID，再填入配置文件中重启即可如果在服务器上部署保持UPLOAD_IMAGE = local即可，如需在无公网IP的环境上部署，请将该项修改为oss或smms如使用smms，请前往SMMS注册账号后进入API页面获取Token并填入SMMS_KEY如使用oss，请前往阿里云OSS创建对应存储库，将EndPoint和Bucket名分别填入OSS_ENDPOINT和OSS_BUCKET，并创建可读写Access令牌，将ID和Key分别填入OSS_ID和OSS_KEY双击启动.bat更新实验性更新指令：wws 更新Hikari请确保在能登录上服务器的情况下使用
以下是旧更新方法按不同版本Windows一键包：下载最新一键包，复制旧版本中accounts文件夹和env.prod文件替换至新版文件夹中即可完整版：以管理员身份运行更新.bat或执行./manage.sh update等效于在cmd中执行如下代码pip install --upgrade hikari-bot
git pull插件版：在cmd中执行如下代码pip install --upgrade hikari-bot对比.env.prod-example中新增的配置项，并同步至你本地的env.prodinstall结束后会打印当前版本您也可以通过pip show hikari-bot查看当前Hikari版本如果没有更新到最新版请等待一会儿，镜像站一般每五分钟同步从0.3.2.2版本开始，您没有填写的配置将按.env文件中的默认配置执行，具体逻辑为私聊、频道默认禁用群聊默认开启，默认屏蔽官方交流群可能会遇到的问题出现ZoneInfoNotFoundError报错您可以在这里找到相关解决办法Recent和绑定提示'鉴权失败'检查Token是否配置正确，token格式为XXXXX:XXXXXX如果配置正确可能是Token失效了，请重新申请Ubuntu系统下部署字体不正常(针对一些云服务器的Ubuntu镜像，不保证成功，只是提供一个解决方案)执行以下命令，完善字体库并将中文设置成默认语言（部分Ubuntu可能不需要该步骤，可直接从第二步开始）sudo apt install fonts-noto  
sudo locale-gen zh_CN zh_CN.UTF-8  
sudo update-locale LC_ALL=zh_CN.UTF-8 LANG=zh_CN.UTF-8  
sudo fc-cache -fv在你的Windows电脑上打开C:\Windows\fonts文件夹，找到里面的微软雅黑字体，将其复制出来，放在任意目录，应该会得到msyh.ttc，mshybd.ttc，msyhl.ttc三个文件。（不会有人还用Win7吧？）进入到/usr/share/fonts文件夹下，创建一个文件夹命名为msyh，然后进入其中cd /usr/share/fonts 
sudo mkdir msyh 
cd msyh将三个字体文件上传到msyh文件夹中(过程中遇到的问题请自行解决)执行以下命令（此时你应该是在msyh文件夹下），加载字体sudo mkfontscale 
sudo mkfontdir 
sudo fc-cache -fv（可选，若不正常可尝试）重启Hikari。贡献代码请向dev分支提交PR鸣谢感谢以下开发者及项目做出的贡献与支持Nonebot2go-cqhttp战舰世界API平台开源相关MIT
修改、分发代码时请保留原作者相关信息赞助
Package: hikari-clusters
hikari-clustersDocumentationhikari-clusters allows you to scale your Discord bots horizontally by using multiprocessing and websockets. This means that your bot can use multiple cores, as well as multiple VPSes.See the #clusters channel in the hikari-py discord for help.# brain.pyfromhikari_clustersimportBrainBrain(host="localhost",port=8765,token="ipc token",total_servers=1,clusters_per_server=2,shards_per_cluster=3,).run()# server.pyfromhikariimportGatewayBotfromhikari_clustersimportCluster,ClusterLauncher,ServerclassMyBot(GatewayBot):cluster:Clusterdef__init__(self):super().__init__(token="discord token")# load modules & events hereServer(host="localhost",port=8765,token="ipc token",cluster_launcher=ClusterLauncher(MyBot),).run()Run examples withpython -m examples.<example name>(python -m examples.basic)Creating Self-Signed Certificate:openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout cert.key -out cert.cert && cat cert.key cert.cert > cert.pem
Package: hikari-expo
# hikari-expo
expo is a extension for hikari providing a meriad of useful features.# Warning
expo is still under heavy development and is not meant for public use,
however if you do use it expect frequent breaking changes.# Installing
If you want to install the stable version just do the following command:`sh pip install-Uhikari-expo`If you want to install the dev version just do the following command:`sh pip install-Ugit+https://github.com/VincentRPS/hikari-expo`Little note, You will want to have [git](https://git-scm.com) to install the dev version.To clone the repo just do the following set of commands:`sh git clonehttps://github.com/VincentRPS/hikari-expocdhikari-expo`# Useful links
the [hikari discord](https://discord.gg/3kDAzaM36b)the [hikari docs](https://www.hikari-py.dev/hikari/index.html)the [discord developers](https://discord.gg/discord-developers) server.
Package: hikari-flare
FlareA stateless component manager for hikari with a type-safe API.Features:buttons, select menus, and modalseasy and powerful API for simple interactionssaves data between bot restarts by utilizing the component's custom idIf you want to create complex component interactionshikari-mirumay be a better choice.Installationpipinstallhikari-flareLinks🗃️ |Docs📦 |PypiExampleimportflareimporthikari@flare.button(label="Test Button",style=hikari.ButtonStyle.PRIMARY)asyncdeftest_button(ctx:flare.MessageContext,)->None:awaitctx.respond(content="Hello World!")@flare.button(label="State Button",style=hikari.ButtonStyle.PRIMARY)asyncdefstate_button(ctx:flare.MessageContext,# Args and kwargs are used for state.number:int,)->None:awaitctx.respond(content=f"The number is:{number}")bot=hikari.GatewayBot("...")flare.install(bot)@bot.listen()asyncdefbuttons(event:hikari.GuildMessageCreateEvent)->None:# Ignore other bots or webhooks pinging usifnotevent.is_human:returnme=bot.get_me()# If the bot is mentionedifme.idinevent.message.user_mentions_ids:# Set custom state for components that need itrow=awaitflare.Row(test_button(),state_button(5))message=awaitevent.message.respond("Hello Flare!",component=row)bot.run()The API can also be accessed at a lower level if components need typed attributes.classButton(flare.Button):a:intb:strasyncdefcallback(self,ctx:flare.Context)->None:typing_extensions.reveal_type(self.a)# inttyping_extensions.reveal_type(self.b)# strawaitctx.respond("Hello flare!")ConvertersConverters allow you to serialize and deserialize types.
Here in an example of an int converter.Converters forint,str,typing.Literal, andenum.Enumare built in.classIntConverter(Converter[int]):asyncdefto_str(self,obj:int)->str:returnstr(obj)asyncdeffrom_str(self,obj:str)->int:returnint(obj)flare.add_converter(int,# The typehint this converter is used for.IntConverter# The converter class.)