Saravanan666/pypi-org huggingface dataset:
Package: useful-scripts
publishRemove-Item-Path'dist/*'-Recurse-Force
poetrypublish--buildtestdist/:useful_scripts-0.1.0-py3-none-any.whluseful_scripts-0.1.0.tar.gzuseful_scripts-0.1.1-py3-none-any.whluseful_scripts-0.1.1.tar.gzuseful_scripts-0.1.2-py3-none-any.whluseful_scripts-0.1.2.tar.gzuseful_scripts-0.1.3232-py3-none-any.whluseful_scripts-0.1.3232.tar.gzuseful_scripts-0.1.332-py3-none-any.whluseful_scripts-0.1.332.tar.gztests/:md_test.pyuseful_scripts/:docx/:code_to-docx.pymain.pymain.pymarkdown/:logs/:config.pyscripts.logmain.pyobsidian_config_zipper.pyreadme_handler.pypaths/:main.pypaths.pytranslater.pypptx/:combine.pymain.pytest22024-01-24 by Atticuszz - feat: refactor the cli🔨README.MD🔨main.py🔨readme_handler.py2024-01-24 by Atticuszz - refactor🔨README.MD🔨poetry.lock🔨pyproject.toml🗑️ README.md🔨md_test.py🔨main.py🔨readme_handler.py🔨paths.py2024-01-04 by Atticuszz - add cil and build for package🔨README.MD🔨scripts.log🔨readme_handler.py2024-01-04 by Atticuszz - add cil✨git_toolbox_prj.xml🔨README.MD🗑️ main.py🗑️ scripts.log🔨pyproject.toml🔨 [README.md](Invalid path or deleted file)🔨md_test.py🚚init.py<-init.py🚚init.py<-init.py✨main.py✨main.py🚚init.py<-init.py🚚init.py<-init.py🚚config.py<- config.py✨scripts.log✨main.py🚚obsidian_config_zipper.py<- obsidian_config_zipper.py🚚readme_handler.py<- readme_handler.py🚚init.py<-init.py✨main.py🚚paths.py<- paths.py🚚translater.py<- translater.py✨init.py🚚combine.py<- combine.py✨main.py2024-01-04 by Atticuszz - reshape md_handler✨GitLink.xml🔨misc.xml🔨ruff.xml🔨useful_scripts.iml✨README.MD🔨 [readme_handler.py](Invalid path or deleted file)🔨 [paths.py](Invalid path or deleted file)🔨poetry.lock🔨pyproject.toml🔨 [README.md](Invalid path or deleted file)🔨md_test.py2023-12-31 by Atticus Zhou - add markdown handle✨ [init.py](Invalid path or deleted file)✨ [code_to_docx.py](Invalid path or deleted file)🔨 [main.py](Invalid path or deleted file)✨ [init.py](Invalid path or deleted file)✨ [init.py](Invalid path or deleted file)✨ [config.py](Invalid path or deleted file)✨ [scripts.log](Invalid path or deleted file)✨ [obsidian_config_zipper.py](Invalid path or deleted file)✨ [readme_handler.py](Invalid path or deleted file)✨ [paths.py](Invalid path or deleted file)🔨poetry.lock🔨pyproject.toml✨ [README.md](Invalid path or deleted file)✨init.py✨md_test.py2023-12-11 by Atticus Zhou - fix pptx combine.py🔨poetry.lock🗑️ combine.py✨ [combine.py](Invalid path or deleted file)🔨pyproject.toml2023-12-11 by Atticus Zhou - add pptx combine.py✨.gitignore🔨misc.xml✨poetry.xml✨ruff.xml🔨useful_scripts.iml✨poetry.lock✨ [init.py](Invalid path or deleted file)✨ [combine.py](Invalid path or deleted file)🔨pyproject.toml2023-10-12 by Atticuszz - initial commit✨.gitignore✨dbnavigator.xml✨Project_Default.xml✨profiles_settings.xml✨misc.xml✨modules.xml✨useful_scripts.iml✨vcs.xml✨ [main.py](Invalid path or deleted file)✨ [init.py](Invalid path or deleted file)✨ [translater.py](Invalid path or deleted file)✨pyproject.tomltest3[test](Invalid path or deleted file)
Package: useful-types
useful_typesThis package contains useful types!Are you tired of defining the same protocols and type aliases over and over in your projects?
Look no further.The types in this package are not special cased by type checkers in any way. Feel free to vendor
them in your project instead of depending on this package.While most of this library will work on any recent type checker version,
some types depend on newer type checker features. We guarantee
support on mypy 1.4 and pyright 1.1.314 or higher.
Package: useful-wsi
Installationuseful_wsi can be installed by unzipping the source code in one directory and using this command:python setup.py installYou can also install it directly from the Python Package Index with this command:pip install useful_wsiDependenciesUseful_wsi depends on the python wrapper for openslide. I recommend using anaconda and this set of commands:conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda install openslide-pythonLicenceSee file LICENCE.txt in this folderContributeuseful_wsi is an open-source software. Everyone is welcome to contribute !
Package: useintest
# Use In TestI
don’t care how it’s done, I just want to use it in my tests!Less blurb, more documentation - link to
ReadTheDocs.Key FeaturesSimple way of running services (e.g. Mongo, CouchDB, iRODS) and using
executables (e.g. Samtools, icommands).No knowledge of containers required.No knowledge of service/executables required (how to install it, when
it’s ready to use, etc.).Does not require the installation of anything on your local machine,
aside from Docker.Makes it simple to test against multiple versions of the same service
or set of executables.Easy to achieve test isolation.ModulesOut of the box support for:MongoCouchDBiRODSSamtoolsGitLabGogsBissellConsulWhy Use This Library?Software no longer works in isolation; with the trend towards
microservices over monoliths, modern day applications rely on numerous
external services for both data and computation.Mocks can be a quick way to test against something that (should) behave
like the external service that your application uses. However, unless a
well respected mocking framework exists, the mock you’ll end up with
will probably make the same bad assumptions about the behaviour of
service as your faulty code does!Testing with the “real thing” or a shared dev mirror of it is probably
not a good idea during development, particularly if the services that
you’re using hold state. You want to be able to run the tests in
parallel, have repeatability and have availability, be it for when
you’re offline or for collaborators outside of your organisation. You
also want to be able to wipe the slate clean and start again if
something goes terribly wrong! It is unlikely you will be able to do
this in any kind of shared environment.This library offers a way to just start up services and then throw them
away after each test case, with no mess left over on your machine. It
gives complete test isolation along with confidence that you’re testing
with services similar to those used in production.Quick ExamplesStart up a containerised instance of Mongo:fromuseintest.modules.mongoimportMongoServiceController# Starts a containerised version of Mongocontroller=MongoServiceController()withcontroller.start_service()asservice:run_my_tests(my_application,service.host,service.port)Use samtools in a container from the host machine via “proxy
executables”:fromuseintest.modules.samtoolsimportSamtoolsExecutablesControllercontroller=SamtoolsExecutablesController()executables_directory=controller.write_executables()# In the case of Samtools, there will be one executable in `executables_directory` named "samtools"run_my_tests(my_application,executables_directory)controller.tear_down()DocumentationFor more details, including information on how to setup and use the
library, pleaseview the documentation on
ReadTheDocsor read it from/docs.
Package: useless-lavalink
Useless LavalinkA Lavalink client library written for Python 3.9 and 3.10 using the AsyncIO
framework. This is a fork ofRed-Lavalinkoptimized to work with Useless Bot.To install:pipinstalluseless_lavalinkUsageimportlavalinkfromdiscord.ext.commandsimportBotbot=Bot()@bot.eventasyncdefon_ready():awaitlavalink.initialize(bot)awaitlavalink.add_node(bot,host='localhost',password='password',ws_port=2333)asyncdefsearch_and_play(voice_channel,search_terms):player=awaitlavalink.connect(voice_channel)tracks=awaitplayer.search_yt(search_terms)player.add(tracks[0])awaitplayer.play()Shufflingdefshuffle_queue(player_id,forced=True):player=lavalink.get_player(player_id)ifnotforced:player.maybe_shuffle(sticky_songs=0)"""`player.maybe_shuffle` respects `player.shuffle`And will only shuffle if `player.shuffle` is True.`player.maybe_shuffle` should be called every timeyou would expect the queue to be shuffled.`sticky_songs=0` will shuffle every song in the queue."""else:player.force_shuffle(sticky_songs=3)"""`player.force_shuffle` does not respect `player.shuffle`And will always shuffle the queue.`sticky_songs=3` will shuffle every song after the first 3 songs in the queue."""When shutting down, be sure to do the following:awaitlavalink.close(bot)
Package: uselessmodule
Warning : Maker’s country doesn’t use English, so maker is not good at English.Commandsdeletestr(a,b) : delete b from a.deletesymbol(a) : delete symbol from a.add(a,b) : If type a and b is int or float, this will plus a and b.But if a or b is str, this will add text.lastdigit(a) : This will returns you last digit of a.nndellastobj(a) : This will delete last object of a.average(a) : This will returns you average of a.nnmode(a) : This will returns you mode of a.median(a) : This will returns you median of a.deviation(a) : This will returns you devitation of a.variance(a) : This will returns you variance of a.standdevia(a) : This will returns you standard deviation of a.triangle(a,b) : This will returns you the area of ab. This is also same with a×b/2.square(a,b) : This will returns you the area of ab. This is also same with a×b.circle(a) : This will returns you the area of a. You have to insert half radius at a. This is also same with a*a*pi.sphere(a) : This will returns you the area of sphere. You have to insert half radius at a. This is also same with a*a*pi/3*4.duum(a,showcomment=False) : This is a function for Korean, 이 설정은 한국어 전용으로 두음법칙된 값을 반환합니다.
Package: useless.pipes
Pseudo-hacky sugar around generators. If you write nested for loops or nested functionsa(b(c([1,2,3])))this might help you.Basically it looks like this:[1, 2, 3] | add(2) | list == [3, 4, 5]where@worker
def add(items, n):
        for i in items:
                yield i + nThe leftmost argument always is the iterator coming from the left side. The other arguments represent a bound state. Using this worker is a two-step process.adder = add(2)                # bind a state in a closure
adder([1, 2, 3]) == [3, 4, 5] # apply an iteratorworkers tend to be very simple and short, reusable and easy to test.@worker
def echo(items):
        for i in items: yield i
echo = echo()   # echo 'has' no state
assert [1, 2, 3] | echo == [1, 2, 3]Sometimes you can achieve something like this:filter_audio_files = fs.filter_by_ext(['.mp3'])

@producer
def folders_with_audio_files(path):
    for root, folders, filenames in os.walk(path):
        if any(filenames | filter_audio_files):
            yield root


@worker
def that_need_fix(paths):
        for path in paths:
                files     = listdir(path) | filter_audio_files | join_path(path) | list
                dos_names = files | get_83DOS_name | list

                if files.sort() != dos_names.sort():
                        yield path
that_need_fix = that_need_fix()


# and the outermost commands in a script then look like this

#give me all folders with mp3-files inside, e.g. print them to stdout
folders_with_audio_files(root)
#give me all folder that need a specific fix, aka dry-mode
folders_with_audio_files(root) | that_need_fix
#actually apply a fix to these folders
folders_with_audio_files(root) | that_need_fix | apply_fix
Package: useless-py
useless-pyUseful python utilities with less effort.Installation:pipinstalluseless-pyFeatures:set_interval() function and @interval decorator - similar to
Javascript’s setInterval() method, uses geventset_timeout() function and @timeout decorator - similar to
Javascript’s setTimeout() method, uses geventset_time_limit() function and @time_limit decorator - limits the
maximum execution time of a function, raises TimeLimitExceededError@extends decorator - inheritance using a class decorator, inspired by
Java’s extends@nocase decorator - class decorator that allows access to attributes
regardless of coding style (camelCase or snake_case)@didyoumean decorator - class decorator, raises DidYouMeanError
(subclass of AttributeError) which suggest close matchesUsage:Check
“samples”
folder.To-Do:[ ] Class Decorators[x] @extends - like Java’s (instead of direct inheritance). IMO,
more readable when you are doing multiple inheritance.[ ] @implements - like Java’s (with the help of python “abc”
module).[x] @nocase - rewrite of “nocase” module using a class decorator
instead of direct inheritance, more Pythonic, IMO.
(https://pypi.python.org/pypi/nocase)[x] @didyoumean - raises a “DidYouMean” exception (instead of
AttributeError) when an attribute of an instance does not exist
and suggests close matches. Think of “git” when you messed up on
giving the correct argument:C:\Users\RonieMartinez>githellogit:'hello'isnotagitcommand.See'git --help'.Didyoumeanoneofthese?helpreflog[ ] Context Managers[ ] Regular expressions in a “with” statement - I miss the old
Perl $1, $2, $3 (special variables)… but global variable is an
overkill, let’s make a more Pythonic featureAuthor:Ronie Martinez (ronmarti18@gmail.com)
Package: usellm
useLLM - Use Large Language Models in Python AppTheusellmPython library enables interaction with a chat-based Large Language Model (LLM) service. This interaction can be used to perform various language-related tasks, like generating chat conversation using the OpenAI API. It's designed as a Python port of theusellmJavaScript library.InstallationThe library can be installed withpip:pip install usellmExample UsageHere is a basic usage example:fromusellmimportMessage,Options,UseLLM# Initialize the serviceservice=UseLLM(service_url="https://usellm.org/api/llm")# Prepare the conversationmessages=[Message(role="system",content="You are a helpful assistant."),Message(role="user",content="What can you do for me?"),]options=Options(messages=messages)# Interact with the serviceresponse=service.chat(options)# Print the assistant's responseprint(response.content)The above code will generate a response using the OpenAI ChatGPT API. The service URL "https://usellm.org/api/llm" should be used only for testing.Classes and Methods1.UseLLMclassTheUseLLMclass provides the interface for interacting with the LLM service.Methods:__init__(self, service_url: str): Initializes a new instance of theUseLLMclass.chat(self, options: Options) -> Message: Interacts with the LLM using the providedOptions, and returns aMessageinstance that represents the LLM's response.2.OptionsclassTheOptionsclass represents a set of configuration options for a chat interaction with the LLM.messages: A list ofMessageinstances representing the conversation up to the current point.stream: A boolean indicating if the interaction is a streaming interaction. Note: streaming is currently not supported.template: A string representing a message template to guide the conversation.inputs: A dictionary of additional inputs for the conversation.Methods:__init__(self, messages: Optional[List[Message]] = [], stream: Optional[bool] = None, template: Optional[str] = None, inputs: Optional[dict] = None): Initializes a new instance of theOptionsclass.3.MessageclassTheMessageclass represents a message in a conversation. It consists of two main attributes:role: The role of the message sender. Common values could besystem,user,assistant.content: The content of the message.Methods:__init__(self, role: str, content: str): Initializes a new instance of theMessageclass.__repr__(self) -> str: Returns a string representation of theMessageinstance.__str__(self) -> str: Returns a string representation of theMessageinstance.to_dict(self) -> dict: Returns a dictionary representation of theMessageinstance.to_json(self) -> str: Returns a JSON string representation of theMessageinstance.ExceptionsThe library raises anExceptionin the following situations:If thestreamoption is set toTrue, because streaming is not currently supported.If the HTTP response status code from the LLM service is not 200.If the HTTP response from the LLM service contains an "error" field.If the HTTP response from the LLM service does not contain a "choices" field.Please create an issue to report bugs or suggest improvements. Learn more about the original JavaScript library here:https://usellm.org
Package: use-logger
一个全局拦截日志并转为loguru日志的插件安装pip install use-logger使用直接使用fromuse_loggerimportuseLoggeruseLogger()# 使用默认配置如果你是usepy用户fromusepy.pluginimportuseLoggeruseLogger()# 使用默认配置如果你自身项目正在使用loguru，这一切似乎感觉毫无变化。因为默认的配置只是修改了一点输出样式。如果想要感受它带来的“魔法”，需要稍微配置一下。fromusepy.pluginimportuseLoggeruseLogger(packages=["scrapy","django","usepy"])Logstash/Filebeat日志的更重要能力是将日志记录发送到Logstash/Filebeat，这样就可以将日志记录存储到Elasticsearch中，方便进行日志分析。所以统一日志的最终输出格式是非常重要的。useLogger内置一个logstash_handler统一化输出格式。fromloguruimportloggerfromusepy.pluginimportuseLogger,useLoggerHandlersuseLogger(handlers=[useLoggerHandlers.logstash_handler(level="DEBUG",extra={"app_name":"spider"})],packages=["usepy"],# hook拦截 usepy 的日志extra={"project_name":"usepy"})logger.warning("test warning")logger.info("test info")logger.debug("test debug")Uvicorn/FastAPI使用uvicorn作为FastAPI的服务器，那么你可以使用useLogger来拦截uvicorn的日志。
(如果使用的是gunicorn， 那么只要指定class为uvicorn.workers.UvicornWorker即可)fr
Package: use-logging
use_logging========================Tool for changing python print statements into logging module invocations. Automatically adds the appropriate imports.Implemented by wrapping lib2to3, hence some oddities.Installation------------------------$ pip install use_loggingExample Useage------------------------$ use_logging -w my_project/*.pyLinks------------------------https://docs.python.org/2/library/2to3.htmlToDo------------------------1. Any more tests?1. Publish on pypi.1. Rest of stuff in https://github.com/vitorbaptista/pyconuk_helloworld (bandit, manifest/+check)
Package: use-nacos
use-nacosA python nacos client based on the officialopen-api.installpipinstalluse-nacosusageconfigfromuse_nacosimportNacosClientclient=NacosClient(...)# publish configclient.config.publish("test_config","DEFAULT_GROUP","test_value")# get configassertclient.config.get("test_config","DEFAULT_GROUP")=="test_value"# subscribe configdefconfig_update(config):print(config)client.config.subscribe("test_config","DEFAULT_GROUP",callback=config_update)instancefromuse_nacosimportNacosClientnacos=NacosClient()nacos.instance.register(service_name="test",ip="10.10.10.10",port=8000,weight=10.0)nacos.instance.heartbeat(service_name="test",ip="10.10.10.10",port=8000,)😘supportasyncmode# example: fastapifromcontextlibimportasynccontextmanagerimportuvicornfromfastapiimportFastAPIfromuse_nacosimportNacosAsyncClientdefconfig_update(config):print(config)@asynccontextmanagerasyncdeflifespan(app:FastAPI):nacos=NacosAsyncClient()config_subscriber=awaitnacos.config.subscribe(data_id="test-config",group="DEFAULT_GROUP",callback=config_update,)yieldconfig_subscriber.cancel()app=FastAPI(lifespan=lifespan)if__name__=='__main__':uvicorn.run("in_fastapi:app",host="0.0.0.0",port=1081)Developingmake install  # Run `poetry install`
make lint  # Runs bandit and black in check mode
make format  # Formats you code with Black
make test  # run pytest with coverage
make publish  # run `poetry publish --build` to build source and wheel package and publish to pypi
Package: use-notify
一个简单可扩展的异步消息通知库安装pip install use-notify使用fromuse_notifyimportuseNotify,useNotifyChannel# if you use usepy, also can use `usepy.plugin`# from usepy.plugin import useNotify, useNotifyChannelnotify=useNotify()notify.add(# 添加多个通知渠道useNotifyChannel.Bark({"token":"xxxxxx"}),useNotifyChannel.Ding({"token":"xxxxx","at_all":True}))notify.publish(title="消息标题",content="消息正文")支持的消息通知渠道列表WechatDingBarkEmailChanifyPushdeerPushover自己开发消息通知fromuse_notifyimportuseNotifyChannelclassCustom(useNotifyChannel.BaseChannel):"""自定义消息通知"""defsend(self,*args,**kwargs):...asyncdefsend_async(self,*args,**kwargs):...
Package: usepy
usepy是一个简单易用的Python工具库，包含了一些常用的工具函数。安装pipinstallusepy-U示例及文档官方文档演示useAdDictfromusepyimportuseAdDictd=useAdDict({'a':1,'b':2,'c':{'d':3,'e':4}})assertd.a==1assertd.c.e==4useBloomFilterfromredisimportRedisfromusepyimportuseBloomFilterrds=Redis(host='localhost',port=6379,db=0)bf=useBloomFilter(client=rds)bf.add('hi','miclon')assertbf.exists('hi')isTrueassertbf.exists('miclon')isTrueassertbf.exists('python')isFalse更多参阅官方文档贡献欢迎提交PR，一起完善这个工具库。
Package: usepy-plugin-logger
一个全局拦截日志并转为loguru日志的插件安装pip install 'usepy[logger]'使用fromusepyimportuseLoggeruseLogger()# 使用默认配置如果你自身项目正在使用loguru，这一切似乎感觉毫无变化。因为默认的配置只是修改了一点输出样式。如果想要感受它带来的“魔法”，需要稍微配置一下。fromusepyimportuseLoggeruseLogger(packages=["scrapy","django","usepy"])Logstash/Filebeat日志的更重要能力是将日志记录发送到Logstash/Filebeat，这样就可以将日志记录存储到Elasticsearch中，方便进行日志分析。所以统一日志的最终输出格式是非常重要的。useLogger内置一个logstash_handler统一化输出格式。fromloguruimportloggerfromusepyimportuseLogger,useLoggerHandlersuseLogger(handlers=[useLoggerHandlers.logstash_handler(level="DEBUG",extra={"app_name":"spider"})],packages=["usepy"],# hook拦截 usepy 的日志extra={"project_name":"usepy"})logger.warning("test warning")logger.info("test info")logger.debug("test debug")
Package: usepy-plugin-notify
一个简单可扩展的异步消息通知库安装pip install usepy-plugin-notify使用fromusepy.pluginimportuseNotify,useNotifyChannelnotify=useNotify()notify.add(# 添加多个通知渠道useNotifyChannel.Bark({"token":"xxxxxx"}),useNotifyChannel.Ding({"token":"xxxxx","at_all":True}))notify.publish(title="消息标题",content="消息正文")支持的消息通知渠道列表WechatDingBarkEmailChanifyPushdeerPushover自己开发消息通知fromusepy.pluginimportuseNotifyChannelclassCustom(useNotifyChannel.BaseChannel):"""自定义消息通知"""defsend(self,*args,**kwargs):...asyncdefsend_async(self,*args,**kwargs):...
Package: usepy-plugin-rabbitmq
usepy-plugin-rabbitmqa plugin forusepyto use rabbitmqexamplefromusepy_plugin_rabbitmqimportuseRabbitMQrmq=useRabbitMQ()@rmq.listener(queue_name="test")deftest_listener(message):print(message.body)message.ack()# ack messageif you use it withusepy, you can use it like this:fromusepy.pluginimportuseRabbitMQrmq=useRabbitMQ()
Package: use-rabbitmq
use-rabbitmqa plugin forusepyto use rabbitmqexamplefromuse_rabbitmqimportuseRabbitMQrmq=useRabbitMQ()@rmq.listener(queue_name="test")deftest_listener(message):print(message.body)message.ack()# ack messageif you use it withusepy, you can use it like this:fromusepy.pluginimportuseRabbitMQrmq=useRabbitMQ()
Package: useragent
==================================useragent==================================useragent is a Python library that parses HTTP User-agent stringsand tries to give you as much data as possible in a normalized form.It uses the data provided by the ua-parser project (originally collected bySteve Souders). It aims to be more pythonic than the python wrapper foundin the original ua-parser project.To-wit::#!/usr/bin/env pythonimport useragentua = useragent.detect("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; nl; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1")print(ua)Which would print ``ua``, a dict-like object with the following structure::{'device': {'family': None,'major_version': None,'minor_version': None,'patch_version': None},'os': {'family': 'Mac OS X','major_version': '10','minor_version': '5','patch_version': None},'browser': {'family': 'Firefox','major_version': '3','minor_version': '0','patch_version': '1'}}The ``ua`` object actually has each of those keys exposed as attributes on itself, so you may find it more comfortable to navigate like so::print(ua.browser.family)print(ua.os.family)print(ua.device.family)