Saravanan666/pypi-org huggingface dataset:
Package: uglyduck
Ugly DuckUse this module to make protocols based on classes in your python project. This
project was made out of frustration with the current state of static types in
Python 3, mainly juggling with circular imports and the workaround of importing
with TYPE_CHECKING. I originally made this to generate a starting point for one
of my projects, but I ended up enjoying working with it and ended up setting it
up to work in real-time in other projects. It makes working with static typing
in Python as easy as it is in other languages. All protocols are the class name
with an 'I' prefix. For example, a class named 'User' will have a protocol
named 'IUser'. You can then import IUser from the types.py file and use it
anywhere and not have to think about/manage imports. It's ugly, I know.InstallationpipinstalluglyduckUsageInclude the following in a package's__init__.pyfile:fromuglyduck.inspectorimportTypeInspector# This will create packagename/types.py with protocols for all classes in the# models and helpers modules.TypeInspector.make_package_types_file('packagename',modules=['models','helpers'])If you're using Django, you will need to run it after the app is ready in yourapps.pyfile:fromdjango.confimportsettingsfromdjango.appsimportAppConfigfromuglyduck.inspectorimportTypeInspectorclassMyAppConfig(AppConfig):name="apps.myapp"defready(self):ifsettings.DEBUG:TypeInspector.make_package_types_file('apps.myapp',modules=['models','helpers'])Possible ImprovementsSupport inheritance from classes outside of the package.
Package: ugly-sql
ugly-sql基础使用数据库连接工具:importpymysqlfromugly_sqlimportSessionManagerimportloggingimportsysimportcontextlib@contextlib.contextmanagerdefdb_ctx(cfg,tran=False):conn=pymysql.connect(**cfg)sm=SessionManager(conn)try:iftran:sm.begin()yieldsm.__enter__()sm.__exit__(None,None,None)exceptExceptionase:logging.warning("db_ctx error%s",e)et,ev,tb=sys.exc_info()sm.__exit__(et,ev,tb)raiseefinally:conn.close()基础操作:fromugly_sqlimportTableUser=Table("users",("id","name","password"),"id",True)db_cfg={}if__name__=='__main__':withdb_ctx(db_cfg,True)asdb:user=db.query(User).filter(User.name=="root",User.password=="***").one()print("name={}\npassword={}".format(user.name,user.password))扩展工具DBConsole[简单数据库操作工具(SQL方式)]ugly_sql.ex.DBConsole(self, connect, args=(), kwargs=None, conn_retry=3)​	connect: 创建数据库连接的函数​    args: 创建数据库连接的参数​	kwargs: 创建数据库连接的命名参数​	conn_retry: 创建连接异常的重试次数importpymysqlfromugly_sql.eximportDBConsolecfg=dict(host='127.0.0.1',port=3306,user='***',passwd='***',charset='utf8',db='test')db=DBConsole(pymysql.connect,kwargs=cfg)simple_select(sql, cursor=None, params=(), rows=False, callback=None)sql: 执行的SQL语句params: SQL语句的参数rows: 指示是否返回多条数据callback: 处理数据的回调函数，callback(data,exception)db.simple_select("select * from application",callback=lambdad,e:d,rows=True)simple_update(sql, params=(), cursor=None, commit=False, auto_id=False, catch=None)sql: 执行的SQL语句param: SQL语句的参数commit: 是否commitauto_id:自动生成的ID，auto_id为True则返回ID值catch: 发生异常时的回调catch(exception),未指定则抛出异常db.simple_update("update application set enable=1 where id=%s",params=1,catch=lambdae:print(e))
Package: ugly-switch
ugly_switchAn ugly pseudo solution for using switches in python.Installationpip install ugly_switchUsagefrom ugly_switch import switchA Switch can be used once:switch[
    True, door_lock,
    False, door_unlock
](not door_state)

# looks the door when it's state is False and vice versaor can be stored to be used multiple times in the future:s = switch[
    'a', lambda: print('was a'),
    'b', lambda: print('was b')
]

# some stuff

value = 'a'
s(value)

# OUT: "was a"When the number of args in the switch iseven,
the pairs make up the switch as sets ofcasesandactions.
actions must becallable methodsorlambdas.
If the number of args may beodd, the last item
will be used asdefault, expecting it to be a callable.With the example directly above, nothing will happen, ifvaluehappens to be neither'a'nor'b'.Below it has a default action.value = 'c'
s = switch[
    'a', lambda: print('was a'),
    'b', lambda: print('was b'),
    lambda: print('something else')
]

# some stuff

s(value)

# OUT: "something else"
Package: uGMRT-beamds
uGMRT_beamdsA python package to make and plot dynamic spectrum from uGMRT beamformer observationsRequirementspython3numpy==1.19.0, scipy==1.6.2, astropy==4.3, pandas, seaborn, pysigprocInstallationpip install uGMRT-beamdsIf multiple versions of python exists, python3 -m pip install uGMRT-beamdsTasksmake_uGMRT_ds : Task to made dynamic spectrum from the uGMRT beamformer raw data file and save it as a Pandas Dataframe. Typemake_uGMRT_ds -hin terminal for more details.plot_uGMRT_ds : Plot the dynamic spectrum from the Pandas Dataframe file made usingmake_uGMRT_ds. Typeplot_uGMRT_ds -hin terminal for more details.
Package: ugoki
Ugoki API ServerUgoki is a simple server for storing categorized gifs where anyone can suggest
gifs but the owner can approve them only.UsageProductionTo install the last stable version, simply run$ pip install ugokiTo start a ugoki API server, runugoki-prodwith correct arguments.$ ugoki-prod -h
usage: ugoki-prod [-h] [-p PORT] [-H HOST] STORAGE SERVE_ROOT AUTH_USER AUTH_PASSWORD DB_STRING

positional arguments:
  STORAGE               Path to store gifs
  SERVE_ROOT            Root where the gifs are served by the web server
  AUTH_USER             Username for API
  AUTH_PASSWORD         Password for API
  DB_STRING             String to connect to database. (e.g. sqlite:///ugoki.sqlite)

optional arguments:
  -h, --help            show this help message and exit
  -p PORT, --port PORT  Port to listen on. Default: 8000
  -H HOST, --host HOST  Host to listen for. Default: 127.0.0.1Developmentgit clone https://gitlab.com/ceda_ei/ugoki.git/cd ugokipoetry installpoetry shellugoki-dev
Package: uGPT
uGPTuGPT is an API and CLI wrapper for chatGPT and other AIGC API base onutypeto make integration easierVersion:0.1.1[test]Author:@voidZXLLicense: MITFeaturesprovide type-hints for OpenAI's API and enforce them at runtime usingutype, increasing integration experience and reducing bugsprovide easy to use commands for common AIGC tasksInstallationpipinstall-UugptuGPT requires Python >= 3.7CLI Usageuse a simple command to start a chat session with chatGPTugptchatNOTICE: in the first time, you will be asked for an API key, you can get that inhereif you need to set a request proxy, you can just useugptset--proxy=http://127.0.0.1:7890or update your API key usingugptset--key=<YOUR-NEW-API-KEY>Image generationyou can generate image with prompt in a single commandugptdraw"an orca whale in the sea"... more are comingAPI UsageuGPT provided a developer-friendly wrapper for OpenAI's API, All the API params and responses are type-hinted and enforced at runtime usingutype, increasing integration experience and reduce bugssuch asimage.py
Package: ugpy
UGPy : Pythonic UnderGraduateA bunch of code meant to automate the analysis of the synaptic changes due to memory formation in zebrafish and make us independent of the free labor of the undergads... and switch to the free labor of the AI. Now that I wrote it down.. why bother? >_<InstallationThere's nothing yet to use. But if you really-really want to , you can use the package managerpipto install ugpy.pipinstallugpyUsagePlease see notebooks/examples ongithub. I mean .. see them some time later, when I actually make them ...LicenseMIT
Package: ugreshaper
ugreshaperText reshaper for ug-language. بۇ تېكىستنى ئەسلىگە كەلتۈرۈش بولىقىIshlitish UsuliWindows:pipinstallugreshaperUbuntu18:pip3installugreshaperfromugreshaperimportugreshaperre=ugreshaper()reshaped_text=re.reshape(text)Qachilap bolup:fromgoogletransimportTranslatorfromugreshaperimportugreshapertr=Translator(service_urls=['translate.google.cn'])txt=tr.translate('Hello world. This is a text reshaper package',dest='ug',src='en')txt=txt.text# Original textprint(txt)#asli textre=ugreshaper()ans=re.reshape(txt)# Reshaped textprint(ans)#pichimlanghan textSample:
Package: ugropy
ugropy is aPythonlibrary to obtain the UNIFAC's subgroups from both the
name or the SMILES representation of a molecule. If the name is given, the
library uses thePubChemPylibrary to
obtain the SMILES representation from PubChem. In both cases, ugropy uses theRDKitlibrary to search the functional groups
in the molecule.ugropy is in an early development stage, leaving issues of examples of
molecules that ugropy fails solving the UNIFAC's groups is very helpful.Try ugropy nowYou can try ugropy from it'sBinder. Open the
binder.ipynb file to explore the basic features.Models supported v1.0.1Classic liquid-vapor UNIFACPredictive Soave-Redlich-Kwong (PSRK)JobackWritersClapeyron.jlExample of useYou can check the full tutorialhere.Get UNIFAC groups from the molecule's name:fromugropyimportGroupshexane=Groups("hexane")print(hexane.unifac_groups)print(hexane.psrk_groups)print(hexane.joback.groups){'CH3': 2, 'CH2': 4}
{'CH3': 2, 'CH2': 4}
{'-CH3': 2, '-CH2-': 4}Get UNIFAC groups from molecule's SMILES:propanol=Groups("CCCO","smiles")print(propanol.unifac_groups)print(propanol.psrk_groups)print(propanol.joback.groups){'CH3': 1, 'CH2': 2, 'OH': 1}
{'CH3': 1, 'CH2': 2, 'OH': 1}
{'-CH3': 1, '-CH2-': 2, '-OH (alcohol)': 1}Estimate properties with the Joback model!limonene=Groups("limonene")print(limonene.joback.groups)print(f"{limonene.joback.critical_temperature}K")print(f"{limonene.joback.vapor_pressure(176+273.15)}bar"){'-CH3': 2, '=CH2': 1, '=C<': 1, 'ring-CH2-': 3, 'ring>CH-': 1, 'ring=CH-': 1, 'ring=C<': 1}
657.4486692170663 K
1.0254019428522743 barWrite down theClapeyron.jl.csv input files.fromugropyimportwritersnames=["limonene","adrenaline","Trinitrotoluene"]grps=[Groups(n)forninnames]# Write the csv files into a database directorywriters.to_clapeyron(molecules_names=names,unifac_groups=[g.unifac_groupsforgingrps],psrk_groups=[g.psrk_groupsforgingrps],joback_objects=[g.jobackforgingrps],path="./database")Installationpip install ugropyRefereces[1]http://www.ddbst.com/published-parameters-unifac.html[2] Joback, K. G., & Reid, R. C. (1987). ESTIMATION OF PURE-COMPONENT
PROPERTIES FROM GROUP-CONTRIBUTIONS. Chemical Engineering Communications,
57(1–6), 233–243.https://doi.org/10.1080/00986448708960487[3] Joback, K. G. (1989). Designing molecules possessing desired physical
property values [Thesis (Ph. D.), Massachusetts Institute of Technology].https://dspace.mit.edu/handle/1721.1/14191
Package: uhabits-converter
uhabits_converterLoop Habit / uhabitsconverter.WarningsPlease back up your data! By default this project does copy your data to a new db before editing it, but I make no promises it won't break on write or import.This project is developed in my spare time, so it could be out of sync withLoop Habit / uHabits.
It has been tested with version2.0.3.FeaturesConvert boolean habits to the new numeric habit type.Example outputBeforeAfterInstallation# options 1 pypipipinstalluhabits-converter# option 2 github releasepipinstallhttps://github.com/ConorSheehan1/uhabits_converter/releases/latest/download/uhabits_converter.tar.gz# option 3 from source# install python (>=3.8 check pyproject.toml)# https://github.com/ConorSheehan1/uhabits_converter/blob/main/pyproject.toml#L9gitclonegit@github.com:ConorSheehan1/uhabits_converter.gitcduhabits_converter
poetryinstall# if you want the uhabits_converter command available run the lines below.# otherwise you can use: PYTHONPATH=$(pwd) poetry run task devpoetrybuild
pipinstall.Steps to convert habitsFollow the instructions forHow can I export a full backup of my data?https://github.com/iSoron/uhabits/discussions/689Select the option "Export full backup" on the settings screen.Copy the.dbfile to your computerRunuhabits_converterfrom a terminalYou can specify arguments up front or interactively. e.g.uhabits_converter --inputdb=Loop_Habits_Backup_2022-02-28_220305.db --habits=Gym,Coffeethis will convert the habits Gym and Coffee from boolean to numeric habits.
now you can track hours in the gym and cups of coffee, rather than just the days you went to the Gym or drank coffee.copy theoutput.dbfile back to your android device.follow the instructions forHow can I restore a full backup?First, go to the settings screen and tap "Import data". A file browser should appear. Tap the menu icon (the one with three vertical lines) and select the app where your backup is stored, such as Google Drive.If your backup file is located in your SD card, after tapping "Import data", tap the icon with three dots on the top right corner of the screen and select "Show internal storage". Then, tap the menu icon (the one with three vertical lines) and select your SD card.DevelopmentSeeDEV.md
Package: uharfbuzz
uharfbuzzStreamlined Cython bindings for theHarfBuzzshaping engine.Exampleimportsysimportuharfbuzzashbfontfile=sys.argv[1]text=sys.argv[2]blob=hb.Blob.from_file_path(fontfile)face=hb.Face(blob)font=hb.Font(face)buf=hb.Buffer()buf.add_str(text)buf.guess_segment_properties()features={"kern":True,"liga":True}hb.shape(font,buf,features)infos=buf.glyph_infospositions=buf.glyph_positionsforinfo,posinzip(infos,positions):gid=info.codepointglyph_name=font.glyph_to_string(gid)cluster=info.clusterx_advance=pos.x_advancex_offset=pos.x_offsety_offset=pos.y_offsetprint(f"{glyph_name}gid{gid}={cluster}@{x_advance},{y_offset}+{x_advance}")How to make a releaseUsegit tag -ato make a new annotated tag, orgit tag -sfor a GPG-signed annotated tag, if you prefer.Name the new tag with with a leading ‘v’ followed by three MAJOR.MINOR.PATCH digits, like in semantic versioning. Look at the existing tags for examples.In the tag message write some short release notes describing the changes since the previous tag. The subject line will be the release name and the message body will be the release notes.Finally, push the tag to the remote repository (e.g. assuming upstream is called origin):$ git push origin v0.4.3This will trigger the CI to build the distribution packages and upload them to the Python Package Index automatically, if all the tests pass successfully. The CI will also automatically create a new Github Release and use the content of the annotated git tag for the release notes.
Package: uhepp
Universal HEP plotUniversal HEP plotis a textual data format (JSON or YAML) to define plots used
in high-energy physics contexts, especially for my PhD within the ATLAS
Collaboration. Usually, analysis software processes a list of events (xAOD,
ntuple, HDF5 or similar formats) and converts them into a histograms and, in
most cases, also into plots.
This makes it hard to change the style retroactively. Alternatively, plots
might be saved in ROOT format (e.g. TH1F), which lose a lot of information
on how the data should be visualized.Theuniversal HEP plotformat defines an interfacebetweenanalysis software and
plotting software. The definition of a plot in UHEP contains
histograms organized in stacks, their uncertainties (potentially systematic
variations) and the plotting style (colors, line widths, labels, etc.). The
separation of data processing and data visualization is mirrored in the file
format. The style can be changed without rerunning the analysis. The
universality of the interface allows for multiple analysis frameworks and
plotting frameworks to be wired together.Typical applications include:Bulk storage of plots in a database (e.g.mongodb) for later retrieval
and reuseProvide plots on multiple media, e.g. traditional files (png, pdf), or
interactive web applicationsCollaboration in an analysis teamRebrand plots from "ATLASInternal" to "ATLAS"LinksDocs:https://uhepp.readthedocs.io/PyPI:https://pypi.org/project/uhepp/Hub:https://uhepp.org/
Package: uh-halp
uh halpInstall:pipinstalluh-halpConfigure:$uhreversefile.txt
>>>Needanopenaikey,it'llbesavedto~/.uh-key:<pastehere>
>>Savingopenaikeyto~/.uh-keys
tacfile.txtUsage:$uhcheckmysyslog
tail-f/var/log/syslog

$uhcleanupdockerdiskspace
dockersystemprune-a

$uhsyncthisshitto/home/gaz/projectongaz@server
rsync-avz--progress.gaz@server:/home/gaz/project

$uhhowmuchspacehaveIgotfreehere?
df-h.

$uhgimmeasocksproxyon192.168.0.1
ssh-D8080username@192.168.0.1

$uhcheckiftheinternetisup
ping-c3google.com

$uhmakeannoyingbeepingnoisesrandomlyinthebackgroundforeverwhiletrue;doecho-e"\a";sleep$((RANDOM%10));done&NotesIt currently defaults to OpenAI. If you want to use something else, open~/.uh-config.jsonand changecurrentand edit the config. If you want
to add your own custom back-end, give the name of a module that has aqueryfunction in it, then fill in the parameters with templates vars
in the example format. Use{key}as one of the params to send the key
wherever you like (postdata, query param, cookie or other header).Look before you paste. There's no protection against doing things like$(uh how do I break this computer?). So please don't just execute its
output!Seems to work well in bash and zsh on Linux and macOS. It's not had much
testing elsewhere else. Windows, BSD, Solaris, zOS etc should also work.DisclaimerIf it blows your machine up it's your own fault. Don't run code produced by
a language model without reading it.LicenseWTFPL with one additional clause: don't blame me!
Package: uhi
UHI: Universal Histogram InterfaceThis is a package meant primarily fordocumentinghistogram
indexing and the PlottableHistogram Protocol and any future cross-library
standards. It also contains the code for the PlottableHistogram Protocol, to be
used in type checking libraries wanting to conform to the protocol. Eventually,
it might gain a set of tools for testing conformance to UHI indexing, as well.
It is not usually a runtime dependency, but only a type checking, testing,
and/or docs dependency in support of other libraries (such asboost-histogram0.13+,hist2.1+,mplhep0.2.15+,uproot4+,
andhistoprint2+).  There are a few useful runtime usable components
(listed below). It requires Python 3.6+.See what's
new.To assist plotting libraries in accepting Histograms from classic sources, seeuhi.numpy_plottable.ensure_plottable_histogram, which will adapt NumPy style
tuples into a simple PlottableHistogram.The Protocols provided do support runtime checking, soisinstance(h, uhi.typing.plotting.PlottableHistogram)is valid at runtime and
might be simpler than manually checking for the expected methods.
Package: uhid-freebsd
uhid-freebsd is a Python library to retrieve information on USB HID devices
on FreeBSD (/dev/uhid*).Installationpkginstallpy38-uhid-freebsdcd/usr/ports/devel/py-uid-freebsdmakeinstallcleanUsagefrom__future__importprint_functionimportuhid_freebsdasuhidimportosfordevinuhid.enumerate():print("Device:",dev["device"])print("  Path:",dev["path"])print("  VendorId: 0x%04x"%dev["vendor_id"])print("  ProductId: 0x%04x"%dev["product_id"])print("  ProductDesc:",dev["product_desc"])print("  SerialNumber:",dev["serial_number"])fd=os.open(dev["path"],os.O_RDONLY)out=uhid.get_report_data(fd,3)os.close(fd)print("  ReportData: "+" ".join([("%02x"%(x))forxinout]))ContributingPull requests are welcome.  For major changes, please open an issue first to
discuss what you would like to change.Please make sure to update tests as appropriate.LicenseBSD 2-Clause
Package: uhkamalli
UhkamalliThreat model (Finnish: uhkamalli) your application.License: MIT|Country of origin: Switzerland|Export control classification number(ECCN): EAR99Third party dependencies are documented in the folderthird-party.DocumentationUser and developerdocumentation of uhkamalli.Bug TrackerAny feature requests or bug reports shall go to thetodos of uhkamalli.Primary Source repositoryThe main source ofuhkamalliis on a mountain in central Switzerland.
We use distributed version control (git).
There is no central hub.
Every clone can become a new source for the benefit of all.
The preferred public clones ofuhkamalliare:on codeberg- a democratic community-driven, non-profit software development platform operated by Codeberg e.V.at sourcehut- a collection of tools useful for software development.ContributionsPlease do not submit "pull requests" (I found no way to disable that "feature" on GitHub).
If you like to share small changes under the repositories license please kindly do so by sending a patchset.
You can either send such a patchset per email usinggit send-emailor
if you are a sourcehut user by selecting "Prepare a patchset" on the summary page of your fork atsourcehut.StatusExperimental.Note: The default branch isdefault.
Package: uhlive
Uh!ive Python SDKThe Uh!live Python SDK provides convenient access to the Uh!live API from
applications written in the Python language.Read thefull documentation.RequirementsInstallation from sourceInstall withpip install .[examples]to install the the library and all the dependencies necessary to run the examples.Installation from Pypipip install uhliveAudio filesTo play with the examples, you should have a raw audio file.
This raw audio file should be in the proper format. This can be done
using a source audio file in wav format using the following command:sox audio_file.wav  -t raw -c 1 -b 16 -r 8k -e signed-integer audio_file.rawUsageSee theREADME.mdin each of the example folders.
Package: uhugo
uHugouHugo is a CLI tool to install and update Hugo binary as well as updating any cloud providersInstillationuHugo depends on Python 3.6+, on your terminal:pipinstalluhugoOnce installed you can test it by:uhugo--versionUsageuHugo provides two main commands -installandupdateInstallUsinguhugo install, will download the latest binary file fromHugo's repositoryand adds it to$HOME/binfolder. You can force install by usinguhugo install --force.Note: Make sure you have$HOME/binin your$PATHenvironment variableUpdateUsinguhugo update, will update the current binary to the latest one. You can use--toflag to specify the version you want to rather update to. Exampleuhugo update --to 0.80.0ProvidersProviders can be used to update Hugo environment variables or configuration files of a cloud provider. See theprovider docsfor more information.
Package: ui3
UI utilities for Pythonista (iOS app)Repository of small UI and other utilities, install with:pip install ui3Included with separate docs:anchor - more natural and responsive UI layout creation with anchoring and docking instead of pixel placementcontrollers - wrappers around various iOS built-in dialogsgestures- Pythonic wrapper around iOS gestures (tap, long press, pinch etc.); includes drag and drop support within and between appsgridview - places subviews in grid that is optimized to show as even rectangles as possiblemenu- wrapper for iOS 14 button pop-up menusrichlabel- use markup to create fancier labelssafearea- avoids edges (on iPhones)scripter - generator-driven UI animationssfsymbol- use iOS 14 Apple SFSymbols as icon images; includes a browser of all symbolsvector- vector class for easier UI calculationswkwebview - wrapper for WKWebView, to replace legacy ui.WebView
Package: uiautomatorplug
reference:the python wrapper of android uiautomator:https://pypi.python.org/pypi/uiautomator/dependency:1: sudo apt-get install python-opencv2: sudo apt-get install python-numpy3: target android device: sdk_version>=16usage:>>> from uiautomatorplug.android import device as d>>> d.info>>> d.orientation>>> d.orientation = 'l'>>> d.wakeup()>>> d.start_activity('--activity-clear-task', action='android.intent.action.DIAL', data='tel:xxxx', flags=0x04000000)>>> d.start_activity('--activity-clear-task', component='com.android.settings/.Settings')
>>> d.find('phone_launch_success.png')>>> d.click(100, 200)>>> d.click('abspath/DPAD_NUMBER_1.png')>>> d.click('abspath/DPAD_NUMBER_1.png', rotation=90)>>> d.exists(text='string_value_of_screen_layout_component_text_attribute')>>> d.expect('abspath/phone_launch_success.png')>>> d(text='Settings').click()