Saravanan666/pypi-org huggingface dataset:
Package: umm
umm: yoUr Mirror ManagerA toolkit to manager the fastest mirror of various tools, such as pip, npm, composer and etc.Table of Contentsumm: yoUr Mirror ManagerFeaturesInstallationUsageShow umm helpManage pipShow umm pip helpList all available mirrors of pipUse the given mirror for pipShow current mirror of pipManage npmShow umm npm helpList all available mirrors of npmUse the given mirror for npmShow current mirror of npmHow to test in localFeaturesWe are going to support to manage the mirror of following tools:pipnpmcomposerhomebrewlinuxbrewgolangdockerubuntucentosjuliaetc.InstallationpipinstallummUpgradepipinstall-UummUsageShowummhelpummorumm--ehlpOutputUsage: umm [OPTIONS] COMMAND [ARGS]...

  A toolkit to manager the fastest mirror of various tools, such as pip,
  npm, composer and etc.

Options:
  --help  Show this message and exit.

Commands:
  npm  Manage npm mirrors.
  pip  Manage pip mirrors.
  v    Show umm version.ManagepipShowumm piphelpummpiporummpip--ehlpOutputUsage: umm pip [OPTIONS] COMMAND [ARGS]...

  Manage pip mirrors.

Options:
  --help  Show this message and exit.

Commands:
  ls   List all available mirrors
  now  Show current mirror.
  use  Use the given mirror.List all available mirrors ofpipummpiplsOutputo               https://pypi.python.org/simple/
tuna            https://pypi.tuna.tsinghua.edu.cn/simple
douban          http://pypi.douban.com/simple/
aliyun          https://mirrors.aliyun.com/pypi/simple/
ustc            https://mirrors.ustc.edu.cn/pypi/web/simpleUse the given mirror forpipFor example, use thetunamirror.ummpipusetunaShow current mirror ofpipummpipnowOutputtuna            https://pypi.tuna.tsinghua.edu.cn/simpleManagenpmShowumm npmhelpummnpmorummnpm--ehlpOutputUsage: umm npm [OPTIONS] COMMAND [ARGS]...

  Manage npm mirrors.

Options:
  --help  Show this message and exit.

Commands:
  ls   List all available mirrors.
  now  Show current using mirror.
  use  Use the given mirror.List all available mirrors ofnpmummnpmlsOutput[npm] name      url
------------------------------------------------------------
* o               https://registry.npmjs.org/
  cnpm            http://r.cnpmjs.org/
  taobao          https://registry.npm.taobao.org/
  nj              https://registry.nodejitsu.com/
  npmMirror       https://skimdb.npmjs.com/registry/
  edunpm          http://registry.enpmjs.org/Use the given mirror fornpmFor example, use thetabaomirror.ummnpmusetaobaoShow current mirror ofnpmummnpmnowOutputtaobao          https://registry.npm.taobao.org/How to testinstall locallyOnce your developed a while and want to test the umm, your have two ways to test:install this package in your local via:pipinstall--editable.or, directly run the python file via:python-mummrun the testMake sure you have installedpytestcdumm/exportPYTHONPATH=src
pytest
Package: ummalqura
Python Umalqurra Calender is an API that will give you the ability to convert Gregorian to Hijri and hijri to Gregorian
it will give you the day name in arabic and english , and the month name in Hijri arabic and Gregorian.Thanks for Khalid Al-hussayen :https://pypi.python.org/pypi/umalqurra/0.2InstallFeaturesUsageInstall:sudo pip3 install ummalquraFeatures:Convert Gregorian to HijriConvert Hijri to Gregoriangive the arabic name of the hijri monthgive the english name of the gregorian monthgive the day name in Arabic and Englishgive the current day both in Hijri and GregorianUsage#!/usr/bin/env python3

from ummalqura.hijri_date import HijriDate
from datetime import date


# create the object with Gregorian date
um = HijriDate(2017, 12, 26, gr=True)

# hijri month
print('hijri month: ', um.month)  # 4
# Hijri year
print('hijri year: ', um.year)  # 1439
# arabic day name
print('arabic day name: ', um.day_name)  # الثلاثاء
# english day name
print('english day name: ', um.day_name_en)  # Tuesday
# arabic hijri month name
print('arabic hijri month name: ', um.month_name)  # ربيع الثاني
# english gregorian month name
print('english gregorian month name: ', um.month_name_gr)  # December
# gregorian year
print('gregorian year: ', um.year_gr)  # 2017
# gregorian month
print('gregorian month: ', um.month_gr)  # 12
# gregorian day
print('gregorian day: ', um.day_gr)  # 26

# current hijri month
print('current_month: ', HijriDate.current_month())  # 4
# the gregorian date corresponding to the first day of the given hijri month/year
print('first day: ', HijriDate.month_start_date(4))  # 2017-12-19
print('first day: ', HijriDate.month_start_date(4, 1439))  # 2017-12-19
# the gregorian date corresponding to the last day of the given hijri month/year
print('last day: ', HijriDate.month_end_date(4))   # 2018-01-17
print('last day: ', HijriDate.month_end_date(4, 1439))   # 2018-01-17
# the hijri month for the given gregorian date
print('hijri month: ', HijriDate.hijri_month_from_date(date.today()))  # 4
# the hijri year for the given gregorian date
print('hijri year: ', HijriDate.hijri_year_from_date(date.today()))  # 1439
# convert the given gregorian date to hijri date
print('hijri date: ', HijriDate.get_hijri_date(date.today()))  # 1439-04-08
# convert the given hijri date to gregorian date
print('georing date: ', HijriDate.get_georing_date('1439-04-08'))  # 2017-12-26
Package: umnet-pyncs
OverviewThis module is intended to be installed on the production NCS nodes and imported in other services/actions that need to gather state from the network.  It uses the NCS device manager and the standard pythonmultiprocessinglibrary to connect to devices in-parallel and issue commands, returning results as structured data.Usage informationBasic usage example in an NCS callback:fromumnet_pyncs.stateimportStateManager...classDemoAction(Action):@Action.actiondefcb_action(self,uinfo,name,kp,input,output,trans):...withStateManager()asm:interfaces=m.get_state(al_devices,["get-interface-details"])arp=m.get_state(dl_devices,["get-arp-table"])...Supported commandsCurrently supported commands are:get-mac-tableget-arp-tableget-interface-detailsget-transciever-detailsget-lldp-neighborsget-bfd-neighborsget-ospf-neighborsDeveloper testingUse therun_cmdsscript to start a session with the localncsdaemon and test the various state gathering commands[grundler@ncs-1umnet-pyncs]$./run_cmds-h
usage:run_cmds[-h]-cCMD-dDEV

optionalarguments:-h,--helpshowthishelpmessageandexit-cCMD,--cmdCMD-dDEV,--deviceDEV[grundler@ncs-1umnet-pyncs]$[grundler@ncs-1umnet-pyncs]$[grundler@ncs-1umnet-pyncs]$./run_cmds-ds-ehall-2012p-1-cget-interface-details
INFO:root:connectingtoncs...
INFO:root:transactionstarted...
INFO:root:submittingcommandstoworkerpool(1)DEBUG:root:pid:19275:invokingget-interface-detailsagainsts-ehall-2012p-1
DEBUG:root:sending'show interfaces'tos-ehall-2012p-1
...For any given command, the various platform-specific models are responsible for implementing how the data is fetched and parsed from the remote device.  Each command corresponds to a method that can be invoked to retrieve the data, e.g.get-interface-detailsmaps to theget_interface_details()instance method of the model(s).For Cisco IOS and NXOS devices (which use CLI-based NEDs), the built-in NCSlive-statusaction(s) are used to send raw CLI commands to the device.  For example, theget_mac_address()method will send ashow mac address-tableCLI command.  For both IOS and NXOS we usentc_templatesto parse the raw text output into structured data.For Juniper devices, since the NED uses NETCONF for all device communications, we instead call the<get-ethernet-switching-table-information>RPC directly.  Since this RPC is modelled in YANG, we can then parse the results directly using the maagic API.All the nitty-gritty details of parsing the data retrieved directly from the remote device is handled by the platform-specific model implementation for that device.  Each model normalizes the data using the dataclasses defined inbase.py.  The intention is to makes it simpler for NCS actions/services to use this module, as well as making it easier to develop/maintain.NB: this implementation currently relies on an additional template for NXOS that handles parsingshow ip arp detail vrf all-- seePR# 1204.
Package: umnet-scripts
umnet-scriptsA set of python modules/classes for interacting with UMnet tools.This package is hosted on pypi - you can install it withpip install umnet-scriptsand use it in your own code.Database Helper ClassesAs of Dec 2021 this repo defines db wrapper classes for Equipdb, Netinfo, and Netdisco.
To use these classes you need to set specific environment variables with the credentials
for each db respectively:Netinfo:NETINFO_USERNAME,NETINFO_PASSSWORDNetdisco:NETDISCO_DB_USER,NETDISCO_DB_PASSWORDEquipdb:EQUIP_DB_USER,EQUIP_DB_PASSWORDQueries for specific things are added as they're needed. As of Dec 2021 there are only a few methods defined for netdisco and equipdb.
Each class inherits a super basic sql query builder method as well as an 'execute' method from a base class (seeumnetdb.py).Rancid Helper ClassThe rancid helper class currently parses the router.db files in/home/rancid/as well as the/home/rancid/Topologyinto a list ofDeviceobjects with rancid-related data as attributes, particularly the following:rancid_name: The name of the device as rancid knows it (the name of the config file). IP address for AL, DNS name for everything else.rancid_type: The rancid perl script that is used to back up the device (egjuniperorCat3750)rancid_role: This is the folder the device config lives in, egaccesslayerorcore. Maps 1:1 to the equipdb devicetype.model: Device model as populated in equipdb, eg 'EX2200-24T-4G'cfg_file: Full path to the config file, eg/home/rancid/accesslayer/10.233.0.10status: Up or down per the equipdbofflineflag (offline is down).neighbors: A dict of the device's neighbors as reported by TopologyWalker.There are also two attributes that look like attributes but are actually 'property' functions:hostnameandipthat return the device's hostname
or IP respectively. If you call 'hostname' for a device whose rancid name is an IP, a dns reverse lookup is done. Similarly,
if you call 'ip' on a device whose rancid name is a DNS name, a forward dns lookup is done.Note that if you're only focusing on one rancid config folder (eg datacenter, accesslayer, etc),
to speed your code up you can limit which folders are processed when you instantiate the Rancid class.
Note that if you want to get devices by dl_zone youmustinclude the distlayer folder at minimum.
Package: umo
Umo is a modeling interface for mathematical programming solvers.Using UMOYou can use UMO with the following solvers:CBCMinisatPython exampleimportumom=umo.Model()a=m.bool_var()b=m.bool_var()umo.constraint(a+b<=1)umo.maximize(a+2*b)m.solve()print(a.value)print(b.value)
Package: uModbus
uModbusuModbus or (μModbus) is a pure Python implementation of the Modbus protocol as
described in theMODBUS Application Protocol Specification V1.1b3. uModbus
implements both a Modbus client (both TCP and RTU) and a Modbus server (both
TCP and RTU). The “u” or “μ” in the name comes from the the SI prefix “micro-“.
uModbus is very small and lightweight. The source can be found onGitHub.
Documentation is available atRead the Docs.QuickstartCreating a Modbus TCP server is easy:#!/usr/bin/env python# scripts/examples/simple_tcp_server.pyimportloggingfromsocketserverimportTCPServerfromcollectionsimportdefaultdictfromumodbusimportconffromumodbus.server.tcpimportRequestHandler,get_serverfromumodbus.utilsimportlog_to_stream# Add stream handler to logger 'uModbus'.log_to_stream(level=logging.DEBUG)# A very simple data store which maps addresss against their values.data_store=defaultdict(int)# Enable values to be signed (default is False).conf.SIGNED_VALUES=TrueTCPServer.allow_reuse_address=Trueapp=get_server(TCPServer,('localhost',502),RequestHandler)@app.route(slave_ids=[1],function_codes=[3,4],addresses=list(range(0,10)))defread_data_store(slave_id,function_code,address):"""" Return value of address. """returndata_store[address]@app.route(slave_ids=[1],function_codes=[6,16],addresses=list(range(0,10)))defwrite_data_store(slave_id,function_code,address,value):"""" Set value for address. """data_store[address]=valueif__name__=='__main__':try:app.serve_forever()finally:app.shutdown()app.server_close()Doing a Modbus request requires even less code:#!/usr/bin/env python# scripts/examples/simple_tcp_client.pyimportsocketfromumodbusimportconffromumodbus.clientimporttcp# Enable values to be signed (default is False).conf.SIGNED_VALUES=Truesock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)sock.connect(('localhost',502))# Returns a message or Application Data Unit (ADU) specific for doing# Modbus TCP/IP.message=tcp.write_multiple_coils(slave_id=1,starting_address=1,values=[1,0,1,1])# Response depends on Modbus function code. This particular returns the# amount of coils written, in this case it is.response=tcp.send_message(message,sock)sock.close()FeaturesThe following functions have been implemented for Modbus TCP and Modbus RTU:01: Read Coils02: Read Discrete Inputs03: Read Holding Registers04: Read Input Registers05: Write Single Coil06: Write Single Register15: Write Multiple Coils16: Write Multiple RegistersOther featues:Support for signed and unsigned register values.LicenseuModbus software is licensed underMozilla Public License. © 2018Advanced
Climate Systems.
Package: uModbus-extended
This is a fork with some additional features of the original uModbus library, more specifically:Add the features of reading/writing on devices/systems with values bigger than 16 Bit dataAdd the flush_on_write parameter to disable the auto flush after writing (some hardware drivers auto manage the flush on write)uModbus or (μModbus) is a pure Python implementation of the Modbus protocol as
described in theMODBUS Application Protocol Specification V1.1b3. uModbus
implements both a Modbus client (both TCP and RTU) and a Modbus server (both
TCP and RTU). The “u” or “μ” in the name comes from the the SI prefix “micro-“.
uModbus is very small and lightweight. The source can be found onGitHub.
Documentation is available atRead the Docs.QuickstartCreating a Modbus TCP server is easy:#!/usr/bin/env python# scripts/examples/simple_tcp_server.pyimportloggingfromsocketserverimportTCPServerfromcollectionsimportdefaultdictfromumodbusimportconffromumodbus.server.tcpimportRequestHandler,get_serverfromumodbus.utilsimportlog_to_stream# Add stream handler to logger 'uModbus'.log_to_stream(level=logging.DEBUG)# A very simple data store which maps addresss against their values.data_store=defaultdict(int)# Enable values to be signed (default is False).conf.SIGNED_VALUES=TrueTCPServer.allow_reuse_address=Trueapp=get_server(TCPServer,('localhost',502),RequestHandler)@app.route(slave_ids=[1],function_codes=[3,4],addresses=list(range(0,10)))defread_data_store(slave_id,function_code,address):"""" Return value of address. """returndata_store[address]@app.route(slave_ids=[1],function_codes=[6,16],addresses=list(range(0,10)))defwrite_data_store(slave_id,function_code,address,value):"""" Set value for address. """data_store[address]=valueif__name__=='__main__':try:app.serve_forever()finally:app.shutdown()app.server_close()Doing a Modbus request requires even less code:#!/usr/bin/env python# scripts/examples/simple_tcp_client.pyimportsocketfromumodbusimportconffromumodbus.clientimporttcp# Enable values to be signed (default is False).conf.SIGNED_VALUES=Truesock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)sock.connect(('localhost',502))# Returns a message or Application Data Unit (ADU) specific for doing# Modbus TCP/IP.message=tcp.write_multiple_coils(slave_id=1,starting_address=1,values=[1,0,1,1])# Response depends on Modbus function code. This particular returns the# amount of coils written, in this case it is.response=tcp.send_message(message,sock)sock.close()FeaturesThe following functions have been implemented for Modbus TCP and Modbus RTU:01: Read Coils02: Read Discrete Inputs03: Read Holding Registers04: Read Input Registers05: Write Single Coil06: Write Single Register15: Write Multiple Coils16: Write Multiple RegistersOther featues:Support for signed and unsigned register values.Easy data packing and unpacking (Write and Read) with the methods data_packer & data_unpackerLicenseuModbus software is licensed underMozilla Public License. © 2018.
Package: umonitor
uMonitorThis is a minimalistic python supervisor for your
microservices.Once started, it will launch all the services you've specified
in the provided config file, and monitor their execution.
Suppose you have following services in theconfig.json:{"services":[{"comment":"Another service to run and monitor.","program":"python3","args":["other_script.py"],"persist":true,"cwd":"/opt"},{"comment":"And this one should not be restarted","program":"bash","args":["will_be_executed_with_bin_bash.sh"],"persist":false,"cwd":"/opt"}]}Then the supervisor (uMonitor) will run the specified commands
and for those which havepersisset, will restart the described
processes, whenever they fail/crash.More complex: it also provides environment variables and venv-like
behavior for the specified programs. See theconfig_example.jsonfor more details.{"comment":"Treat this as virtual environment, but not only for python.","interpreters":{"python3":"/venv_some/bin/python3","sh":"/bin/sh","bash":"/bin/bash"},"comment":"Services to run and monitor.","services":[{"program":"python3","args":["script_1.py"],"comment":"Do not recover after crashes","persist":false,"cwd":"/opt","env":{"PYTHONPATH":["/opt/your_python_module/","/usr/local/another/module/","/joined_with/colon/will_be"],"PATH":["/opt/prog_1/bin/","/home/username/.prog_2/bin/","/joined_with/colon/will_be"],"ENVIRON_VARIABLE":["SINGLE_VALUE_42"]}},{"comment":"Another service to run and monitor.","program":"python3","args":["other_script.py"],"persist":true,"cwd":"/opt"},{"comment":"And this one should not be restarted","program":"bash","args":["will_be_executed_with_bin_bash.sh"],"persist":false,"cwd":"/opt"}]}Installation:Installation using pip:python3-mpipinstallumonitorInstallation using poetry:poetryaddumonitorUsage example:As a callable module:python3-mumonitorconfig.jsonIn a script:importumonitormonitor=umonitor.uMonitor("config.json")monitor.run()
Package: umOpener
umOpener=====netcdf4/GeoTiff/ENVI/ read and wirte------------1. nc<--->nc2. tif<--->tif3. img<--->img4. nc<--->tif5. nc<--->img6. tif<--->nc7. tif<--->img8. img<--->nc9. img<--->tif10.read grib2
Package: umovme
Umovme Api Python ClientFree software: MIT licenseInstallationpip install umovmeYou can also install the in-development version with:pip install https://github.com/kmee/python-umovme/archive/master.zipDocumentationhttps://python-umovme.readthedocs.io/DevelopmentTo run all the tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog0.0.0 (2021-01-27)First release on PyPI.
Package: umpyre
umpyreCode analysis and quality metricsTo install:pip install umpyreExamples of useGet stats about packages. Your own, or other's.Note: These examples will probably not work as doctests,
since results are sensitive to other slight system differences (such as python version etc.))>>> from umpyre import modules_info_df
>>> import collections
>>> modules_info_df(collections)
                      lines  empty_lines  ...  num_of_functions  num_of_classes
collections.__init__   1280          189  ...                 1               9
collections.abc           3            1  ...                 0              25
<BLANKLINE>
[2 rows x 7 columns]
>>> modules_info_df_stats(collections.abc)
lines                      1283.000000
empty_lines                 190.000000
comment_lines                79.000000
docs_lines                  133.000000
function_lines              138.000000
num_of_functions              1.000000
num_of_classes               34.000000
empty_lines_ratio             0.148090
comment_lines_ratio           0.061574
function_lines_ratio          0.107560
mean_lines_per_function     138.000000
dtype: float64Multiple packages (nice for comparing).>>> from umpyre import stats_of
>>> stats_of(['urllib', 'json', 'collections'])
                              urllib         json  collections
empty_lines_ratio           0.157293     0.136503     0.148090
comment_lines_ratio         0.075217     0.038344     0.061574
function_lines_ratio        0.212391     0.448620     0.107560
mean_lines_per_function    13.463768    41.785714   138.000000
lines                    4374.000000  1304.000000  1283.000000
empty_lines               688.000000   178.000000   190.000000
comment_lines             329.000000    50.000000    79.000000
docs_lines                425.000000   218.000000   133.000000
function_lines            929.000000   585.000000   138.000000
num_of_functions           69.000000    14.000000     1.000000
num_of_classes             55.000000     3.000000    34.000000
Package: uMQ
uMQ: A minimal and reliable JSON MQ library!uMQ is a minimal package derived from my main research project to achieve reliable and fast JSON communication.The story:I'm developing a full-fledged hardware+software product as my research project and I needed to instanciate IPC communication between two(or several) python processes. After looking around, found packages with extreme capabilities. 0MQ(https://zeromq.org/) and RabbitMQ are just a couple of examples. My specific application didn't need to use all those features and I didn't see the necessity of going through their steep lurning curves so I decided to write my own code.As a hardware engineer, I deal with state machines all the time. I have used state machines in this code to reliably convert bytes to JSON packets.Development:My goal is to keep this packege easy to use. You only need to learn one class and three functions to start a JSON communication. My main focus is currently to fix bugs and improve the performance.Please feel free to contribute, add features or request them.UsageInstallingTo install the package you can simply do:$ pip install uMQStarting the communicationOn the server side, run:uMQIntance=uMQ_Socket()uMQIntance.server("localhost",5008)while(True):uMQIntance.hold()while(uMQIntance.data_available()):data=uMQIntance.get_next_pkt()## do something with the datauMQIntance.Clear()This will create a uMQ_Socket which is listening on localhost and port 5008.on the client side do:data={"Sample Data":"DEADBEEF"}uMQIntance=uMQ_Socket()uMQIntance.connect("localhost",5008)uMQIntance.send_all(json.dumps(data))For the complete test scripts. Refer to the "tests" directory.
Package: umsc
Script Converter for Uyghur LanguageThis converter converts multiple Uyghur scripts such asULS(Uyghur Latin Script),UAS(Uyghur Arabic Script),CTS(Common Turkish Script),UCS(Uyghur Cyrillic Script),UYS(Uyghur Yengi (new) Script),
International Phonetic Alphabet (IPA), Uzbek and Xinjiang University Script (XJUS).Installationpip install umscMapping tableUASCTSULSUCSUYSIPAUzbekXJUSاaaаa/ɑ/oaەeeәə/æ/aAبbbбb/b/bbپppпp/p/ppتttтt/t/ttجcjҗj/d͡ʒ/jjچçchчq/t͡ʃ/chcخxxхh/χ/xHدddдd/d/ddرrrрr/r/rrزzzзz/z/zzژjzhжⱬ/ʒ/jJسssсs/s/ssشşshшx/ʃ/shxفffфf/f/ffڭñngңng/ŋ/ngNلllлl/l/llمmmмm/m/mmھhhһⱨ/h/hhوooоo/o/oʻoۇuuуu/u/uuۆööөɵ/ø/oʻOۈüüүü/y/uʻUۋvwвw/w/vwېééеe/ɛ/eeىiiиi/i/iiيyyйy/j/yyقqqқⱪ/q/qqكkkкk/k/kkگggгg/ɡ/ggنnnнn/n/nnغğghғƣ/ʁ/gʻGئvياyayaяyayayaيۇyuyuюyuyuyuSample input and output examplesReview the files in the tests directory for examples of converting between different scripts.Usagefrom umsc import UgMultiScriptConverter
source_script = 'UAS'
target_script = 'ULS'
converter = UgMultiScriptConverter(source_script, target_script)
text = 'ياخشىمۇسىز!'
text = converter(text)
print(text)NotesAPI and Uzbek are currently developing. The mapping might not be very accurate. Especially for Uzbek, it is not very clear how to map "ئا" and "ئە" to Uzbek.CitationIf you wish to cite this project, please usecite this repository.ContributingFeel free to raise issue and pull request.LicenseDistributed under the Apache 2.0 License. SeeLICENSEfor more information.