Saravanan666/pypi-org huggingface dataset:
Package: uaDevice
ua-device解析user-agent的python包，可以获取到系统、浏览器内核、浏览器、设备信息，其特点：相比国内外的流行的python包，该模块解析国内复杂的ua信息更加精确，有几千行代码专门来匹配具体的特定的uaWhy由于在国内生产PC的厂家有限，大众用户使用的浏览器也主要是当前的一些主流浏览器。因此目前的UA解析库在对OS、浏览器外壳、浏览器内核等的识别率都相当高。但是由于国内的移动设备的五花八门，对于移动设备的硬件信息是很难用一套通用的方法进行识别，因此 ua-device 诞生通过机型识别品牌: 例如 [-\s](Galaxy[\s-]nexus|Galaxy[\s-]\w*[\s-]\w*|Galaxy[\s-]\w*|SM-\w*|GT-\w*|s[cgp]h-\w*|shw-\w* 这样的匹配规则以及一些从中关村在线爬取到的机型名称如G3508、G3508J、G3508i 等识别出来该机型的品牌为Samsung 因为单纯从UA信息确实无法得到品牌数据，这也是为何很多高Star的UA解析库识别手机品牌成功率只有30%-40%的原因(ua-device识别率可见下面测试用例)。解决国内UA信息不规范: 由于国内很多手机生产厂家的设计问题，例如小米可供识别的UA数据可能为 mi 2 、mi2、m2、mi-2LTE、MI-20150XX、minote等等，如果匹配规则限制太紧就会导致数据无法命中，如果匹配规则太松又会让其它山寨机型滥竽充数，所以需要一套比较特殊的处理流程。解决国内因不同发版而造成的UA数据不一致: 例如很多机型会因同电信、移动、联通而UA信息不同，但实际应该把他们算成同一款手机解决机型的重命名与合并: 很多手机在不同时间生产其UA信息可能不同，所以需要对他们进行合并，防止在展示top数据时因数据分散而排不上号。解析成功率供参考（以30000个线上ua测试）:浏览器：98.5%系统： 99.8%内核： 99.92%设备类型： 100%设备型号：98.9%厂商信息：95.5%javascript版本ua-device安装pipinstall-UuaDevice使用importuaDeviceua='Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 MQQBrowser/8.9.1 Mobile/15E148 Safari/604.1 MttCustomUA/2 QBWebViewType/1 WKType/1'info=uaDevice.parseUA(ua)output='\t'.join([info['os']['name'],info['os']['version']['original'],info['browser']['name'],info['browser']['version']['original'],info['engine']['name'],info['engine']['version']['original'],info['device']['type'],info['device']['model'],info['device']['manufacturer']])print(output)贡献随着新设备新app等等的上市，ua信息会越来越复杂，因为该项目需要不断迭代，希望大家一起来贡献不支持的ua，使得ua解析越来越准确感谢该项目是基于fex团队维护的js版本的ua解析库ua-device， 在此表示感谢
Package: ua-djangolibrary
For use within Django.There are two Python modulesguardedsettings.py
projectbuilder.pyguardedsettingsFor use within a Django settings.py file.
It allows a Django project to ship and
not incorporate secret information in the
settings.py file, such as the SECRET_KEY
and DATABASE:PASSWORD.When the guardedsettings program starts, it
reads the guardedsettings.json file and creates
a Python dictionary from guardedsettings.json content.
The JSON is referenced by using the method,
SettingsDictionary['Key In The JSON'].guardedsettings.jsonIn the Django Project Root, where the manage.py
file resides, you create a JSON file named
guardedsettings.JSON as such.{
"SecretKey": "Secret",
"DatabasePassword" : "MoreSecret"
}Consider the line containing"SecretKey": "Secret",The term "SecretKey" is a key and the term
"Secret" is the value. Together they are called
a pair, hence the term 'key/value pair'.Add as many key/value pairs as necessary, each
separated by a comma.settings.pyUse guardedsettings within the Django settings.py
file as shown below. Place the two lines of code close
to or at the top of the settings.py file.--- At Or Near The Top of settings.pyfrom UA_GuardedSettings import guardedsettings
gs = guardedsettings.guardedsettings()---An instance of guardedsettings is now instantiated
as the variable named 'gs'. You are welcome to name
the variable as you choose.Later in the settings.py, use guardedsettings as
shown.The generic form of usage isSomeDjangoSetting = gs.SettingsDictionary['SomeKey']For example-- in the settings.py fileSECRET_KEY	= gs.SettingsDictionary['SecretKey']and like so for a database password.-- in the settings.py file DATABASE section.'PASSWORD' : gs.SettingsDictionary['databasePassword'],projectbuilder.pyThe goal of projectbuilder is to package an existing
Django Project (not the apps), and create a package under
a new name - for use as a Site in a deployment.This alleviates the need to create a new Django Project
in each deployment phase; testing, staging and production,
among others your organization may employ.projectbuilder must run in the 'Project Root', where the
Django manage.py folder resides.The program requires two inputs.
(1) The name of the existing Django project to package.
(2) The name of the new Django Project to create.The new package will be completely referenced to the
new name you provide. The manage.py will be re-referenced,
as is the asgi.py, settings.py and, the wsgi.py files, all
referencing the new project.It will build a zip file in the RootFolder\dist\projects
folder and is named with '_Project.zip' preceding the
project name you input as the new name.Transport this zip file to a new deployment site and
unzip it.
Package: ua-eds-api
UA-EDS-APIProvides easy interface for making REST requests to University of Arizona EDS registry.MotivationTo make a python API that could generically interact with the REST architecture of EDS.Code Examplefromua_eds_apiimportua_eds_apieds_api=ua_eds_api.EdsApi("host","username","password","grouper url")users=eds_api.get_grouper_users("grouper endpoint")Installationpip install --user ua-eds-apiCreditsRyanJohannesBlandEtienneThompsonLicenseMIT
Package: ua-email-client
UA-Email-ClientProvides easy interface for sending emails through Amazons Simple Email Service.MotivationTo make a python API that could obfuscate the details of sending emails using AWS SES service.Code Examplefromua_email_clientimportua_email_clientclient=ua_email_client.EmailClient(email)# The template name given should be relative name to a file.client.add_template("success.html")# Destinationsclient.send_email(destinations,"success.html",subject,body)# No Templateclient.send_email(destinations,None,subject,body,use_template=False)Installationpip install --user ua-email-clientTestsNOTE:Running this test suiteWILLsend emails. Please specify an email which can receive emails. The emails can all be ignored once received.To run the tests you will need to create a json configuration with some user-specific values. This file will be ua_email_client/tests/email_creds.json. It will be populated with:{"email":"...","default_recipient":"...","secondary_recipient":"..."}Where"email"is the sending email,"default_recipient"is the main email you want to receive emails, and"secondary_recipient"is a second email to test sending emails to multiple recipients at once.Once this file is created, just run:cdua_email_client/tests
noseteststest_ua_email_client.pyCreditsRyanJohannesBlandEtienneThompsonLicenseMIT
Package: ua-framer
UA-framerOverviewDraw the frame of the Ukrainian flag on the image.InstallPython 3 or higher is required.# Linux/OS X
$ python -m pip install -U ua-framer

# Windows
> py -3 -m pip install -U ua-framerExampleDraw the frame.importframerfromPILimportImageframer("example.png",10).save("example.png")
Package: uagen
简单 UA 生成器须知：根据版本规则生成很多很多个不同的 ua （我也没数过，总之很多）有 chrome 和 firefox 和 opera 的有些可能没有用可以在代码中 import，也可以在终端测试UA用不了别怪我安装：# 注意是 uagen, 不是 uagent, 那是另外一个老兄的
$ pip3 install uagen代码导入：import uagen

random_user_agent = uagen.random_ua()       # 随机 ua
firefox_user_agent = uagen.firefox_ua()     # firefox ua
chrome_user_agent = uagen.chrome_ua()       # chrome ua
opera_user_agent = uagen.opera_ua()         # opera ua终端：# 生成一个 ua，在终端打印出来
$ uagen [-m --mode random/firefox/chrome/opera]
Package: ua-generator
ua-generatorA random user-agent generator for Python >= 3.6FeaturesNo external user-agent list. No downloads.Templates are hardcoded into the code.Platform and browser versions are based on real releases.Client hints (Sec-CH-UA fields).Installingpip3install-Uua-generatorBasic usageimportua_generatorua=ua_generator.generate()print(ua)# Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/15.2 Safari/604.1.38CustomizationThere are three different parameters to the generate user-agent by the certain conditions.device=('desktop','mobile')platform=('windows','macos','ios','linux','android')browser=('chrome','edge','firefox','safari')All of the parameters are optional, and the types can be choose multiple.importua_generatorua=ua_generator.generate(device='desktop',browser='firefox')print(ua.text)# Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0print(ua.platform)# linuxprint(ua.browser)# firefoxprint(ua.ch.brands)# " Not A;Brand";v="99"print(ua.ch.mobile)# ?0ua=ua_generator.generate(platform=('ios','macos'),browser='chrome')print(ua.text)# Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/537.36 (KHTML, like Gecko) CriOS/80.0.3987.44 Mobile/15E148 Safari/537.36print(ua.platform)# iosprint(ua.browser)# chromeprint(ua.ch.brands)# " Not A;Brand";v="99", "Chromium";v="80", "Google Chrome";v="80"print(ua.ch.mobile)# ?1AuthorEkin Karadeniz (iamdual@icloud.com)
Package: ua-generic-rest-api
UA-Generic-Rest-ApiProvides basic REST API Implementation for GET, PUT, and POST, and DELETE.MotivationWas designed to remove similarities among REST API implementations by creating a generic REST API that classes can be extended and override for specific needs.FeaturesGET - Implementation of GET which can single GET, batch GET, single GET with query, and GET every page on a paginated endpoint.Batch gets with queries are unavailable as there is no way to give each get a unique query. Because of this the feature was not included.PUT - Basic implementation of PUT which puts the payload to the given endpoint.POST - Basic implementation of POST which posts the payload to the given endpoint.DELETE - Basic implementation of DELETE which deletes the given endpoint.Code Examplefromua_generic_rest_apiimportGenericRestApiclassSpecificRestApi(GenericRestApi):# Replace '...' with any other initialization arguments.def__init__(self,...):# host, header_info, page_query, and page_tag are site specific.# Set them to your own values.super().__init__(host,header_info,page_query,page_tag=page_tag)# Can override GET, PUT, POST, or DELETE here.host - The base url for the endpoint that is to be gotten.header_info - Any information to be added to a request header such as Authorization or Content-Type.Should be in the form of a dictionary, such as {"Authorization": None, "Content-Type": "text/xml"}.page_query - The tag to use when querying for specific pages.For example, for sites queried with the tag "?page=", page_query should be "page".page_tag - The tag name of paginated endpoints to search for when getting data.For sites paginated with the tag "page", page_tag should be "page".Installationpipinstallua-generic-rest-api
pipinstall-rrequirements.txtTestsTests are only necessary when wanting to make changes to the module.pipinstall--updatenodecd./ua_generic_rest_apicd./tests
noseteststest_generic_rest_api.pyCreditssterns1EtienneThompsonLicenseMIT
Package: uagents-twilio
Thisuagentsutlity was generated withCookiecutter.Featuresuagents protocols to send SMS or Whatsapp messages using twiliosupports on_message and on_query methods to receive and send messagesInstallationYou can install “uagents-twilio” viapipfromPyPI:$ pip install uagents-twilioYou can install “uagents_twilio” via poetry:$ poetry add uagents-twilioUsageCreate .env file in root folder of project:AGENT_ADDRESS=""
ACCOUNT_SID=""
AUTH_TOKEN=""
FROM_NUMBER=""
WP_FROM_NUMBER=""
TO_NUMBER=""Create a uagents in your projectImport uagents_twilio protocol:$ from uagents_twilio.protocols.messages import service_protocolInclude protocol in uagent:$ service_agent.include(service_protocol)Use functions:from uagents_twilio.models import Message, MessageType

@service_agent.on_interval(period=2.0)
async def send_message(ctx: Context):
    await ctx.send(
        AGENT_ADDRESS,
        Message(receiver="<replace_your_number>", msg="hello there bob", type=MessageType.sms),
    )
Package: uagents-twilio-beta
Thisuagentsutlity was generated withCookiecutter.Featuresuagents protocols to send SMS or Whatsapp messages using twiliosupports on_message and on_query methods to receive and send messagesInstallationYou can install “uagents-twilio” viapipfromPyPI:$ pip install uagents-twilioYou can install “uagents_twilio” via poetry:$ poetry add uagents-twilioUsageCreate .env file in root folder of project:AGENT_ADDRESS=""
ACCOUNT_SID=""
AUTH_TOKEN=""
FROM_NUMBER=""
WP_FROM_NUMBER=""
TO_NUMBER=""Create a uagents in your projectImport uagents_twilio protocol:$ from uagents_twilio.protocols.messages import service_protocolInclude protocol in uagent:$ service_agent.include(service_protocol)Use functions:from uagents_twilio.models import Message, MessageType

@service_agent.on_interval(period=2.0)
async def send_message(ctx: Context):
    await ctx.send(
        AGENT_ADDRESS,
        Message(receiver="<replace_your_number>", msg="hello there bob", type=MessageType.sms),
    )
Package: uagents-twilio-test-dummy
Thisuagentsutlity was generated withCookiecutter.Featuresuagents protocols to send SMS or Whatsapp messages using twiliosupports on_message and on_query methods to receive and send messagesInstallationYou can install “uagents-twilio” viapipfromPyPI:$ pip install uagents-twilioYou can install “uagents_twilio” via poetry:$ poetry add uagents-twilioUsageCreate .env file in root folder of project:AGENT_ADDRESS=""
ACCOUNT_SID=""
AUTH_TOKEN=""
FROM_NUMBER=""
WP_FROM_NUMBER=""
TO_NUMBER=""Create a uagents in your projectImport uagents_twilio protocol:$ from uagents_twilio.protocols.messages import service_protocolInclude protocol in uagent:$ service_agent.include(service_protocol)Use functions:from uagents_twilio.models import Message, MessageType

@service_agent.on_interval(period=2.0)
async def send_message(ctx: Context):
    await ctx.send(
        AGENT_ADDRESS,
        Message(receiver="<replace_your_number>", msg="hello there bob", type=MessageType.sms),
    )
Package: ua-headers
Fake HeadersAn ideal tool for generating random user agentsUser Agents:

Elementaryos # elementary OS
Blackberry   # blackberry
Openbsd      # openbsd
Windows      # windows
Console      # nintendo/ps/xbox
Android      # android
Sumbian      # sumbian OS
Sunos        # Sun OS
Linux        # fedora/ubuntu/debian & other
Ios          # iosfromheadersimportuaua.elementaryos()#Generate elementary OS user agentua.blackberry()#Generate Blackberry user agentua.windows()#Generate Windows user agentua.console()#Generate Nintendo/PS/Xbox user agentua.openbsd()#Generate OpenBSD user agentua.sumbian()#Generate Sumbian user agentua.android()#Generate Android user agentua.sunos()#Generate sun OS user agentua.linux()#Generate Linux user agentua.ios()#Generate IOS user agent
Package: ua-ilab-tools
UA-Ilab-ToolsA set of tools that interact with Ilab's REST database.MotivationWas designed to implement a simple way to interact with Ilab's REST architecture.Featuresilab_api.py contains a class to use simple REST functions such as GET, PUT, POST, and DELETE.ua_ilab_tools.py contains a class to interact with the REST architecture outside of the simple REST verbs, such as:get_service requests which returns the service requests with a given status.get_service_cost which returns the cost associated with a given service_id.get_request_charges which returns all of the charges of the request id.get_milestones which returns all of the milestones associated with a service request.get_custom_forms which returns all of the custom forms associated with the request id.extract_project_info which gets the relevant project info from a request.extract_custom_form_info which gets all of the fields of a form.Code Examplefromua_ilab_toolsimportilab_api,ua_ilab_toolsapi=ilab_api.IlabApi(core_id,auth_creds)# "token" contains the Authorization information for headers.tools=ua_ilab_tools.IlabTools(core_id,token)prj_info=ua_ilab_tools.extract_project_info(soup)form_info=ua_ilab_tools.extract_custom_form_info(req_id,form_id,form_soup)Installationpipinstallua-ilab-toolsTestsYou will have to create a file named "ilab_creds.json" in the format of:{"token":"Bearer {your token}","core_id":"{your core_id}"}```bashpipinstall--updatenosecd./ua_ilab_toolscd./testsnoseteststest_ilab_tools.pyHow to UseGet general endpointsGet information associated with specific service requests.Get data associated with specific projects and custom_forms.Creditssterns1EtienneThompsonLicenseMIT
Package: uai-pre-import-transform-interface
GeneralThis package provides an Interface that can be implemented to then be turned into a job.
The used URI interface (from uai_pre_transform_interface import URI) is basically apathlib.Pathwith some missing functionality.WARNING: URI is not a local fileBeware: Inside understand.ai we will hand cloud paths as URIs. So using the string of a path to open it will fail in these cases!
E.g. Donotdo things like this:fromuai_pre_import_transform_interfaceimportPreImportTransformInterface,URIfromPILimportImageclassPreImportTransformer(PreImportTransformInterface):deftransform(self,input_path:URI,output_path:URI):path_to_image=input_path/"images"/"00001.png"withImage.open(str(path_to_image))asim:# This will fail if input path is "gs://dataset/clip1/"im.show()instead you could dofromuai_pre_import_transform_interfaceimportPreImportTransformInterface,URIfromPILimportImagefromtempfileimportNamedTemporaryFileclassPreImportTransformer(PreImportTransformInterface):deftransform(self,input_path:URI,output_path:URI):path_to_image=input_path/"images"/"00001.png"# example for when your method takes readable byteswithImage.open(path_to_image.open("rb"))asim:im.show()# example for when your method needs just a path to the filewithNamedTemporaryFile()astmp:tmp.write(path_to_image.open("rb").read())Image.open(tmp.name)Unit tests do not catch this, unfortunately. One idea to be more save against this could be to not use pathlib.Path directly for debugging but to instead extend path with an implementation that raises an error on usage of__str__.frompathlibimportPathclassDebuPath(Path):def__str__(self):raiseException("it is not a good idea to use strings for paths for anything but logging as these paths could point to remote resources.")ImplementationEvery implementation should provide a python package named by you. Let's usepackage_nameas an example. From this package the following import has to work:frompackage_nameimportPreImportTransformerThis should give your implementation of the interface. To achieve this the__init__.pyoyour package should contain something like this (depending on how you name things):from.my_interface_implementationimportPreImportTransformer__all__:Sequence[str]=["PreImportTransformer"]This is how we will automatically bind your library into our system.
Package: uam
# uamUniversal application manager.## Development### Create a docker environment```docker run -dt -v `pwd`:/app --workdir /app --entrypoint bash --name uam -v /var/run/docker.sock:/var/run/docker.sock -v `pwd`/uamlib/:/usr/local/uam python:2docker exec -ti uam bash```### Run Locally1. Run without installation:```python -m uam```2. Install locally and run:```pip install --editable .uam```
Package: uamd
uamd(User Agent Mobile Detect) is for detecting japanese mobile phone
from HTTP_USER_AGENT and return device information include UID from HTTP Header
and spoof check by CIDR of each carrierInstallsudo pip install uamdor:sudo pip install git+git://github.com/lambdalisue/uamd.git#egg=uamdRequired (Automatically installed)IPyBeautifulSoupHow to use>>> META = {
>>>     'HTTP_USER_AGENT': u"J-PHONE/2.0/J-SH02",
>>>     'HTTP_X_JPHONE_UID': u"XXXXXXX",
>>>     'REMOTE_ADDR': u"123.108.237.0",                        # Valid IP for Softbank (2011/03/22)
>>> }
>>> deice = uamd.detect(META)
>>> device.name
u'J-SH02'
>>> device.type
u'J-Phone'
>>> device.uid
u'XXXXXXX'
>>> device.spoof
False
Package: uamobile
WSGIUserAgentMobile is HTTP mobile user agent string parser. It’ll be useful in parsing HTTP_USER_AGENT strings of (mainly Japanese) mobile devices.This library is ported from similar libraries in Perl and PHP and owes a lot to them.HTTP-MobileAgent?http://search.cpan.org/~kurihara/HTTP-MobileAgent-0.26/lib/HTTP/MobileAgent.pmPEAR::Net_UserAgent_Mobile? http://pear.php.net/package/Net_UserAgent_Mobile
Package: uamutils
Overviewuamutilspackage provides a Python interface toUpper Atmosphere Model(UAM) binary data format as well as utilities for processing & analysing UAM data.DocumentationThisJupyter notebook demonstrates essential functionality of the package.CautionThis project is a work in progress. Some features are still lacking, while existing features need more rigorous testing. Also, huge refactoring is due — API-breaking changeswillbe made.
Package: ua-node-avail
ua-node-availA simple script to host on pip to allow the user to analyze the queues for available nodes.Installation:pip install ua-node-availUsage:node_availOutput:CPU CORES                MEMORY GB
  NODE                VENDOR  FREE       ALLOC  TOTAL  FREE       ALLOC  TOTAL

  chpc-compute-12-2   AMD     32         32     64     123        128    251
  chpc-compute-12-8   AMD     32         32     64     123        128    251
  chpc-compute-12-17  AMD     32         32     64     123        128    251
  chpc-compute-12-22  AMD     32         32     64     123        128    251
  chpc-compute-12-24  AMD     32         32     64     133        118    251
  chpc-compute-12-0   AMD     16         48     64     67         184    251
  chpc-compute-12-1   AMD     16         48     64     64         187    251
  chpc-compute-12-3   AMD     16         48     64     64         187    251
  chpc-compute-12-4   AMD     16         48     64     64         187    251
  chpc-compute-12-6   AMD     16         48     64     64         187    251
  chpc-compute-12-7   AMD     16         48     64     67         184    251
  chpc-compute-12-9   AMD     16         48     64     73         178    251
  chpc-compute-12-15  AMD     16         48     64     64         187    251
  chpc-compute-12-16  AMD     16         48     64     64         187    251
  chpc-compute-12-18  AMD     16         48     64     64         187    251
  chpc-compute-12-12  AMD     10         54     64     50         201    251
  chpc-compute-12-10  AMD     0          64     64     14         237    251
  chpc-compute-12-11  AMD     0          64     64     14         237    251
  chpc-compute-12-13  AMD     0          64     64     14         237    251
  chpc-compute-12-14  AMD     0          64     64     10         241    251
  chpc-compute-12-19  AMD     0          64     64     14         237    251
  chpc-compute-12-20  AMD     0          64     64     14         237    251
  chpc-compute-12-21  AMD     0          64     64     10         241    251
  chpc-compute-12-23  AMD     0          64     64     14         237    251
  chpc-gpu-12-1       AMD     64         0      64     251        0      251
  chpc-gpu-10-0       AMD     0          64     64     14         237    251
  chpc-gpu-10-2       AMD     0          64     64     14         237    251
  chpc-gpu-12-0       AMD     0          64     64     14         237    251
  chpc-highmem-12-0   AMD     40         8      48     1906       109    2015
  chpc-highmem-10-0   AMD     0          48     48     15         2000   2015
  chpc-highmem-10-1   AMD     0          48     48     926        1089   2015
  chpc-highmem-12-1   AMD     0          48     48     1411       604    2015
Package: uao
Big5-UAO table in pure Python.純 Python 的 UAO (Unicode-At-On) encoder/decoder。Installationpip install uaoUsagefromuaoimportregister_uaoregister_uao()# register big5-uao as a builtin codecsprint("无法被Big5編碼の字串♥".encode("big5-uao").decode("big5-uao"))Or use the standaloneBig5UAOCodecclass:fromuaoimportBig5UAOCodecuao=Big5UAOCodec()print(uao.decode(uao.encode("无法被Big5編碼の字串♥")))Changelog0.2.0 (Feb 22, 2021)Add: support python 3.7~3.9.0.1.1 (Jun 11, 2018)Fix: remove a print statement.0.1.0 (Jun 11, 2018)First release.