Saravanan666/pypi-org huggingface dataset:
Package: ktdk
Kontr Test Development KitKontr Test Development Kit was designed to write custom test scenarios for multiple programming languages.
Configuration is done by python script with predefined structure.Getting statedKTDKis a library, to use it, you have to install it, or add it to your'sPipenvorrequirements.txtfile.PrerequisitesPython 3.6 or later(Optional)pipenvInstall the released versionYou can install ktdk using thepip:$pipinstallktdkOr you can add it as a development dependency using thepipenv$pipenvinstallktdkInstall the development versionYou can either use thePipenvcommand.pipenvinstallgit+https://gitlab.fi.muni.cz/grp-kontr2/ktdk.gitor thepipcommand:pipinstallgit+https://gitlab.fi.muni.cz/grp-kontr2/ktdk.gitAvailable Env variablesKTDK_WORKSPACE- Workspace dirKTDK_TEST_FILES- Test files dirKTDK_SUBMISSION- Student's submission dirKTDK_RESULTS- Results directory submission dirKTDK_ENTRY_POINT- Entry point - main script (default:instructions.py)KTDK_TEST_TIMEOUT- Test timeoutKTDK_WEBHOOK_URL- Webhook urlKTDK_WEBHOOK_TOKEN- Webhook tokenKTDK_TEST_TIMEOUT- Test timeoutKTDK_SUITE_TIMEOUT- Suite timeoutKTDK_SUITE_ID- Suite IDRun the cli toolKtdk also provides a simple cli tool, to run your tests# Show the help$ktdk--help# List all the static tests$ktdktestslist# Run your tests using the ktdk$ktdkexecute--help# Example:$ktdkexecute--submission="<SUBMISSION_DIR>"--test-files="<TEST_FILES_DIR>"--develExamplesTBD - python examples of the KTDK testsDevelopmentTake a look at thecontribution guide
Package: ktechpayapi
ktechpay-pythonPython plugin forKtechPayView onpypi.python.orgInstallationpipinstallktechpayapiInstantiate KtechPayfromktechpayapi.ktechpayimportKteckpayktech_secret_key="kt_test_23cf0"ktechpay=Kteckpay(ktech_secret_key=ktech_secret_key)# to use transaction classprint(ktechpay.transaction.list())# initiateprint(ktechpay.transaction.initialize(amount=3,email="info@ktechhub.com"))print(ktechpay.transaction.verify(reference="e1b6679c5aad4bd3999953ac78e677a79d28d539085e409ebde1be640ebc27e7"))Static UseTo start using the KtechPay Python API, you need to start by setting your secret key.You can set your secret key in your environment by running:exportKTECH_SECRET_KEY='your_secret_secret_key'After exporting the keys, you can use the api like thisfromktechpayapi.transactionimportTransaction# to use transaction classprint(Transaction.list())# initiateprint(Transaction.initialize(amount=3,email="info@ktechhub.com"))print(Transaction.verify(reference="e1b6679c5aad4bd3999953ac78e677a79d28d539085e409ebde1be640ebc27e7"))
Package: ktemplate
kTemplatea minimalist python html template🔗source codeQuick StartInstallationpip install kTemplateExamplesfromkTemplateimport(div,img,# common html elementselement# for creating custom element)# create common html element# `class` represents by `cls` due to python keywordhtml_str=div(img(src='url'),cls='bar')# <div class="bar"><img src="url"/></div># create custom elementmy_element=element(tag="MyElement",content="foo"props="bar")# <MyElement props="ar">foo</MyElement>Please refer to the docs for creating HTMLtemplates and componentsDocumentationRead thedocumentationfor more about:usage detailsfunction referencescontributingtestingchangelogMotivationWhen building web apps with python, no matter using Flask, FastAPI or Django, the go-to template isJinja. This is a sensible choice when building web app. However it's a bit over-kill when creating simple website. Also, I am not a fan of Jinja's template syntax, eg. putting python loops in html with{% ... %}looks clumsy:<ulid="navigation">{% for item in navigation %}<li><ahref="{{ item.href }}">{{ item.caption }}</a></li>{% endfor %}</ul>I prefer something like this instead:ul(id="navigation",content=[li(a(item.caption,href=item.href))foriteminnavigation])Its pure python, having full support of intellisense, type checking, and all language supports from the text editor. I feel much better DX with this approach.Separation of concern sounds good, but it comes with a cost: adding another concern 🤪... So separating HTML with python is not always a good choice, especially in simple projects.Mixing template logic within python eliminates the extra layer of complexity, which I think is a reasonable choice for small/medium size projects. There are libraries provide in-python html template, such asDominateandfast-html.Dominate is a well designed lib and I'll certainly go for it for medium sized project. Theirwith element_namepattern is a brilliant use of python context manager, highly recommended 👍. However, for simple project, I'm still looking for a simpler solution.fast-htmlcome close to what I want. It uses pythongeneratoras element output to speed up the template concatenation process. This is a efficient technical choice, and I think that's why the author name it "fast" html. But still, when dealing with simple or even single page demo sites, pure text elements is what I am looking for instead of generator. Performance hit is negligible in that case.That's why I create this text centric html template library, and share it on PyPi. I name it "k" template because... just after my initial 😜. Hope u find it useful.Need Help?Open agithub issueor ping me onTwitter
Package: kth
Python APIBitcoin Cash full node as a Python libraryKnuth Python APIis a high performance implementation of the Bitcoin Cash protocol focused on users requiring extra performance and flexibility. It is a Bitcoin Cash node you can use as a library.Getting started with PythonCreate a new Python console project:$ mkdir HelloKnuth
$ cd HelloKnuthAdd a reference to our Python API package:$ pip install kthCreate a new file calledindex.pyand write some code:importkthimportsignalimportasynciorunning_=Falsedefshutdown(sig,frame):globalrunning_print('Graceful shutdown ...')running_=Falseasyncdefmain():globalrunning_signal.signal(signal.SIGINT,shutdown)config=kth.config.getDefault(kth.config.Network.mainnet)withkth.node.Node(config,True)asnode:awaitnode.launch(kth.primitives.StartModules.all)print("Knuth node has been launched.")running_=True(_,height)=awaitnode.chain.getLastHeight()print(f"Current height in local copy:{height}")ifawaitcomeBackAfterTheBCHHardFork(node):print("Bitcoin Cash has been created!")# node.close()print("Good bye!")asyncdefcomeBackAfterTheBCHHardFork(node):hfHeight=478559whilerunning_:(_,height)=awaitnode.chain.getLastHeight()ifheight>=hfHeight:returnTrueawaitasyncio.sleep(10)returnFalseasyncio.run(main())Enjoy Knuth node as a Python library:$ python index.pyIssuesEach of our modules has its own Github repository, but in case you want to create an issue, please do so in ourmain repository.
Package: kthread
kthreadKillable threads in Python!PurposeThe built-inthreading.Threadclass offers no simple solution to terminate a running thread.kthread.KThreadinheritsthreading.Threadand supplies methods namedexit(),kill(), andterminate()that serve the same purpose: attempt to stop a thread if it's running.How it worksKThread leverages the CPython API to raise aSystemExitexception on a given thread.  Assuming that the thread is not blocked by an operating system call (such assleep,accept, orrecv), the thread will forcefully quit.DISCLAIMERTERMINATING THREADS MAY INTRODUCE INSTABILITY OR OTHER UNDESIRABLE EFFECTS IN YOUR PROGRAMS.  THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY.  THE MUNSHI GROUP CANNOT BE HELD LIABLE FOR ANY DAMAGES, LOSSES, OR EXPENSES INCURRED BY YOU OR YOUR ORGANIZATION WHILE USING THIS SOFTWARE.InstallationTo install this package, run the following command:$ pip install kthreadUsage>>> import time
>>> import kthread
>>> import sys
>>> def func():
>>>     try:
>>>         while True:
>>>             time.sleep(0.2)
>>>     finally:
>>>         sys.stdout.write("Greetings from Vice City!\n")
>>>         sys.stdout.flush()
>>>
>>> t = kthread.KThread(target = func, name = "KillableThread1")
>>> t.start()
>>> t.isAlive()
True
>>> t.terminate()
Greetings from Vice City!
>>> t.isAlive()
FalseLicenseMIT
Package: kthreading
KThreading - Get more control over threadsKThreading is a Python library that provides advanced functionality for interacting with threads.FeaturesForced thread termination: The library allows you to forcibly terminate threads.Timed execution of functions: KThreading enables you to launch functions with a specified timeout.Retrieval of function results: The library provides the capability to retrieve the results of functions running in separate threads.Quick thread launch: KThreading offers a simple and convenient interface for launching threads with a single line of code.Usage of functions as error handlers: The library allows for the usage of functions as error handlers, which will be called in case of exceptions occurring in a thread.Whats new in 0.3Add "ident" property to KThread classSet default "daemon" attribute value to "False"Add "daemon" param to "start_kthread" functionRead docs atthis webpage.
Package: kthread-sleep
A "killable" sleep function for kthreadhttps://pypi.org/project/kthread/From kthread's pypi site:Assuming that the thread is not blocked by an operating system call (such as sleep, accept, or recv), the thread will forcefully quit.pipinstallkthread-sleepimportkthreadimportsysfromkthread_sleepimportsleepdeffunc():try:sleep(2000000)finally:sys.stdout.write("Greetings from Vice City!\n")sys.stdout.flush()t=kthread.KThread(target=func,name="KillableThread1")t.start()sleep(.1)print(t.is_alive())t.kill()sleep(.1)print(t.is_alive())TrueGreetingsfromViceCity!False
Package: kth-timeoutdecorator
kth-timeoutdecorator简介kth-timeoutdecorator 是一个用于Python的超时修饰器，目前已在 Windows 和 Linux 下测试过，也经过了异步兼容的测试，目前只是基本实现了要达到的目的。修改自这份原代码不过它无法正常使用。Why实际上超时修饰有很多，但大多数都有很多问题，一部分只能运行在 Linux 系统上，还有一部分无法异步兼容，使得无法满足我的另一个项目XUN_Bot的需求，直到我找到了这份原代码，令人非常惊艳的code，但是由于部分原因使得它无法被正常使用。而本项目是我修改后可以正常使用的版本。安装From source code:pythonsetup.pyinstallFrom pypi:pipinstallkth-timeoutdecorator使用方法importtimefromkth_timeoutdecoratorimport*@timeout(4)deftestmain():print("Start")foriinrange(6):time.sleep(1)print("[Test]{}seconds have passed".format(i+1))defmytest():try:testmain()exceptTimeoutExceptionase:print("[Test]{}".format(e))if__name__=='__main__':mytest()如果执行成功，则会输出以下信息：[Test] 1 seconds have passed[Test] 2 seconds have passed[Test] 3 seconds have passed[Test] function run too long, time limit exceeded.开源许可证本项目使用MIT许可证。开发日志0.0.4修改了seconds参数的可选项，使得修饰器更加灵活。0.0.5修复了之前版本的bug，请勿再使用0.0.2版本
Package: kthutils
This package provides various utilities for automation at KTH. It
provides the following modules:kthutils.ugAccess the UG editor through Python.kthutils.participantsRead expected course participants through Python.kthutils.iprangeRead IP ranges for computers in lab rooms.kthutils.formsRead forms data (CSV) from KTH Forms.We also provide a command-line interface for the modules. This means
that the functionality can be accessed through both Python and the
shell.An exampleWe want to add the userdboskas teacher in the groupedu.courses.DD.DD1317.20232.1.teachers.In Python, we would doimportkthutils.credentialsimportkthutils.ugug=kthutils.ug.UGsession(*kthutils.credentials.get_credentials())group=ug.find_group_by_name("edu.courses.DD.DD1317.20232.1.teachers")user=ug.find_user_by_username("dbosk")ug.add_group_members([user["kthid"]],group["kthid"])In the shell, we would dokthutilsugmembersaddedu.courses.DD.DD1317.20232.1.teachersdboskInstallation and documentationInstall the tools usingpip:python3-mpipinstall-UkthutilsYou can read the documentation by runningpydocon the package:python3-mpydockthutils
Package: k-time-kit
K-Time-Kit ⏱️This project is a Python implementation of the Duration class, which represents a duration of time in years, days, hours, minutes, and seconds. It allows you to easily manipulate durations of time with arithmetic operations, conversions, and comparisons.Features 💡The Duration class can accept floating-point values for its parameters, and convert them to a standard time format.The Duration class can be added, subtracted, and compared to other durations with the operators+,-,==,<=, and<.The Duration class can be converted to seconds, minutes, hours, days, or years with the methodsto_sec,to_min,to_hour,to_day, andto_year.The DurationInt class is an integer version of the Duration class, which allows you to manipulate large integers more efficiently.Examples of use 📝# Create a duration of 3 years, 2 days, 4 hours, 30 minutes, and 15 secondsd1=Duration(15,30,4,2,3)print(d1)# prints "3.0y 2.0d 4.0h 30.0m 15.0s"# Create a duration of 0.5 year, 0.25 day, 0.125 hour, 0.0625 minute, and 0.03125 secondd2=Duration(0.03125,0.0625,0.125,0.25,0.5)print(d2)# prints "0.0y 182.0d 18.0h 7.0m 33.78125s"# Add two durationsd3=d1+d2print(d3)# prints "3.0y 184.0d 22.0h 37.0m 48.78125s"# Subtract two durationsd4=d3-d1print(d4)# prints "0.0y 182.0d 18.0h 7.0m 33.78125s"# Compare two durationsprint(d1==d2)# prints "False"print(d1<=d2)# prints "False"print(d1<d2)# prints "False"# Convert a duration to secondsprint(d1.to_sec())# prints "94770115.0"# Convert a duration to minutesprint(d1.to_min())# prints "1579950.25"# Convert a duration to hoursprint(d1.to_hour())# prints "26332.504166666666"# Convert a duration to daysprint(d1.to_day())# prints "1097.1876736111112"# Convert a duration to yearsprint(d1.to_year())# prints "3.0059936263318114"# Create an integer duration of 1000000000 secondsd5=DurationInt(1000000000)print(d5)# prints "31y 259d 1h 46m 40s"Author ✍️This project was created by KpihX. You can contact me atkapoivha@gmail.comfor any questions or suggestions.License 📄This project is licensed under the MIT license - see the LICENSE file for more details.:https://github.com/KpihX
Package: ktimeout
ktimeoutDescriptionadd timeout to any functionInstallpipinstallktimeout# orpip3installktimeoutUsage# CHECK 'demo.py' FOR ALL EXAMPLESfromtypingimportOptionalimporttimefromktimeoutimporttimeoutdeffunc_with_arguments(sleep_time:float,extra_print:Optional[str]=None):whileTrue:time.sleep(sleep_time)print('Sleeping',sleep_time,'sec',extra_printor'')deffunc():func_with_arguments(0.5,extra_print='called from func()')try:timeout.run(func,2)exceptExceptionase:print(e)try:timeout.run(timeout.partial(func_with_arguments,0.25,extra_print='extra'),2)exceptExceptionase:print(e)try:withtimeout.timeout(1):whileTrue:sleep_time=0.25time.sleep(sleep_time)print('Sleeping',sleep_time,'sec')exceptExceptionase:print(e)
Package: ktiny
KTiny is a Qt/KDE based client for TinyERP. Main goals for the project are
outstanding integration with the KDE Desktop using the KDE Development
Platform, which means it should be available to Linux, Mac and Windows users
as well as other operating systems. It’s in no way supported by the TinyERP
project at the moment, though we intend to work in the same directoion of
TinyERP, and give back to the whole community any features that could be
useful to other clients. Main development is currently supported by NaN
(http://www.nan-tic.com) but the whole open source community is invited and
encouraged to participate. All project information can be found at
sourceforge. That includes users and hackers mailing lists as well as bug
tracker and subversion repository. New releases will also be available there.
Package: ktis-parser
ktis-parserThis is parser of default information of "ktis.kookmin.ac.kr" with student-number & passwordHow 2 usepip3 install ktis-parserorpip install ktis-parserafter thenfromktis_parser.ktis_parserimport*print(parseInfoFromKTIS("2017XXXX","password"))it is return when, successful.{"status":"True","content":{"id":"2017XXXX","name":"{YOUR_NAME}","ssn":"{YOUR_SOCIAL_SECURITY_NUMBER}","college":"{YOUR_COLLEGE}","school":"{YOUR_SCHOOL}","time":"{YOUR_TIME}","major":"{YOUR_MAJOR}","date":"{YOUR_IN_DATE}","status":"{YOUR_STATUS}","grade":"{YOUR_GRADE}","passwd":"{YOUR_PASSWORD}"}}then fail case{"status":"False","content":"존재하지 않는 사용자입니다."}{"status":"False","content":"비밀번호가 맞지않습니다\\r\\n비밀번호 입력오류 횟수 : (2 / 5)"}
Package: ktkkt-downloader
ktkkt-downloaderAboutA tool to get anime fromktkkt.ccwith CLI (Command Line Interface) and GUI (Graphical User Interface).
It currently supports to download one single episode / all episodes in a series.PrerequisitesTo running this tool, please make sure the following prerequisites are ready:FFmpegUsage (Package)from ktkkt_downloader import KtkktDownloader
downloader = KtkktDownloader(args.directory)

# download all episodes in a series (e.g. 鬼滅之刃粵語)
series_url = "https://www.ktkkt.cc/movie/index15170.html"
downloader.download_series(series_url)

# download single episode (e.g. 鬼滅之刃粵語 EP.01)
episode_url = "https://www.ktkkt.cc/play/15170-0-0.html"
downloader.download_episode(episode_url)Usage (Standalone)Before running the application, required packages need to be installed by following command:$ python -m pip install -r requirements.txtCLI (Command Line Interface)# download single episode
$ python __main__.py -d OUTPUT_DIR -u TARGET_URL

# download all episodes in a series
$ python __main__.py -d OUTPUT_DIR -u TARGET_URL -aExample鬼滅之刃粵語,series URL:https://www.ktkkt.cc/movie/index15170.htmlepisode 1 URL:https://www.ktkkt.cc/play/15170-0-0.html# download 鬼滅之刃粵語 episode 1 to /home/ktkkt/ by the episode URL
$ python __main__.py -d /home/ktkkt/ -u https://www.ktkkt.cc/play/15170-0-0.html

# download 鬼滅之刃粵語 all episodes to /home/ktkkt/ by the episode URL
$ python __main__.py -d /home/ktkkt/ -u https://www.ktkkt.cc/play/15170-0-0.html -a

# download 鬼滅之刃粵語 all episodes to /home/ktkkt/ by series URL
$ python __main__.py -d /home/ktkkt/ -u https://www.ktkkt.cc/movie/index15170.html -aGUI (Graphical User Interface)# start gui
$ python __main__.pyProvide the TARGET_URL, OUTPUT_DIR and then click the buttons to download the single episode / all episodes in a seriesLicenseGNU GPL v3.0
Package: ktLDA
ktLDAThis is an implementation of Latent Dirichlet Allocation for pedagogical purposes.DependenciesnumpytqdmExamplesfromktldaimportKtLDAimportpicklewithopen('ourdata-cleaned.pickle','rb')asf:comp,rec=pickle.load(f)X=comp+recY=[0]*len(comp)+[1]*len(rec)lda=KtLDA(n_components=2,alpha=0.5,beta=0.5,iterations=10,max_vocab=5000,random_state=663)lda.fit(X)print(lda.doc_topic_dist)
Package: ktm
===ktm===ktm (a.k.a. kill the messenger!) is a configurable notification daemon with queues and history display- Free software: GPL V3+ License- Documentation will be available at: http://ktm.readthedocs.org.This project has been originally fork from https://github.com/the-isz/notipyMany thanks to its author!The following documentation has been taken from the notipy project, and is meant to be changed-----------------------------------------------------------------------------------------ktm (aka kill the messenger!) is an implementation of the http://developer.gnome.org/notification-spec/[Desktop Notification Specification]. It showsmessage popups using gtk3, allowing for pango marked up message bodies and iconsthat can be specified in various ways... image:: https://github.com/the-isz/notipy/raw/master/doc/screen.pngThe design goals of notipy include a minimalistic implementation (following theunix philosophy "do one thing and do it well") and having as little as possibledependencies.Installation------------ktm requires the following libraries to work:- gtk3- pygobject- dbus-pythonInstallation is simply done via::./deployment/setup.py installConfiguration-------------Until now, ktm is configured exclusively via command-line arguments. Thesecan be listed via the --help command-line option::usage: ktm.py [-h] [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-t EXPIRETIMEOUT] [-m MARGINS][-a {NORTH_WEST,SOUTH_WEST,SOUTH_EAST,NORTH_EAST}] [-d {VERTICAL,HORIZONTAL}]A notification server implementing the specification from http://developer.gnome.org/notification-spec/.optional arguments:-h, --help            show this help message and exit-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}set the logging level (default: WARNING)-t EXPIRETIMEOUT, --expire-timeout EXPIRETIMEOUTset the maximum/default timeout for notifications in [ms] (default: 10000)-m MARGINS, --margins MARGINSset screen margins for top, right, bottom and left side of the screen in pixels (default: 0,0,0,0)-a {NORTH_WEST,SOUTH_WEST,SOUTH_EAST,NORTH_EAST}, --layout-anchor {NORTH_WEST,SOUTH_WEST,SOUTH_EAST,NORTH_EAST}set the origin for the notifications (default: NORTH_EAST)-d {VERTICAL,HORIZONTAL}, --layout-direction {VERTICAL,HORIZONTAL}set the direction for the notifications (default: VERTICAL)History-------0.1.0 (2014-07-24)---------------------* First release on PyPI.
Package: ktoolbox
KToolBoxKToolBox is a useful CLI tool for downloading posts content inKemono.party / Kemono.suEnglish|中文FeaturesSupport formulti-threaddownloads (technically, coroutine)Retryafter download failedAbility to download individual post as well asall postby a specified creator/artistUpdate downloadedcreator/artist directories to the latest statusCustomize thestructureof downloaded post/creatordirectoriesSearch for creators/artists and posts, andexport the resultsCross-platformsupport &iOS shortcutsavailableFor Coomer.su / Coomer.party support, check documentCoomerfor more.Dev PlanAdd a Fluent Design style GUIAdd uvloop support for Unix platformTutorialSeedocumentationfor more details.InstallationNormalpip3installktoolboxFora-Shellpip3installktoolbox-pure-pyCommandFor more information, use the help command or gotoCommandpage.❓ Get general helpktoolbox-h❓ Get help of a commandktoolboxdownload-post-h⬇️🖼️ Download a specific postktoolboxdownload-posthttps://kemono.su/fanbox/user/49494721/post/6608808If some files failed to download, you can try to execute the command line again,
the downloaded files will beskipped.⬇️🖌️ Download all posts from a creatorktoolboxsync-creatorhttps://kemono.su/fanbox/user/9016By default, you will get acreator-indices.ktoolboxfile in the creator directory,
you can use it to update the directory anytime.🔄️ Update a downloaded creator directoryktoolboxsync-creatorhttps://kemono.su/fanbox/user/641955--update-with=./xxx/creator-indices.ktoolboxThecreator-indices.ktoolboxfile contains the information and filepath of posts inside the directory.iOS ShortcutsGotoShortcuts for iOSpage for more details.ConfigurationGotoConfiguration-Guidepage for more details.Other BranchesPure Python branch:🔗pure-pyUse pydantic v1 so that cargo is not needed for installationFor example, you can use it on iOS terminal Appa-Shell🔗PyPIDevelopment branch:🔗develAbout KemonoDescription fromhttps://kemono.su:Kemono is a public archiver for:PatreonPixiv FanboxDiscordFantiaAfdianBoostyDLsiteGumroadSubscribeStarContributors here upload content and share it here for easy searching and organization.To get started viewing content, either search for creators on the artists page, or search for content on the posts page.Code CoverageLicenseKToolBox is licensed under MIT.Copyright © 2023 by Ljzd-PRO.