Saravanan666/pypi-org huggingface dataset:
Package: pylogix2
pylogix2This project will allow you to easily read/write values from tags in Rockwell Automation Logix based PLC's over Ethernet I/P using Python.  PLC models inclued CompactLogix, ControlLogix and Micro8xx.  Python2 and Python3 are both supported.Getting StartedThere are currently no dependencies so you can get going quickly without having to install any other prerequiste packages.InstallingYou can clone the repo with the following:git clone https://github.com/daniel-leicht/pylogix2.git
cd pylogix2
python setup.py install --userOr you can install with pip:pip install pylogix2Verifying InstallationTo verify the installation on Linux, open the terminal and use the following commands:python
import pylogix
pylogix.__version__Your First Script:The cloned repository will come with many examples, I'll give one here.  We'll read one simple tag and print out the value.  All methods will return the Response class, which contains tag_name, value and status.from pylogix import PLC
with comm as PLC()
    comm.IPAddress = '192.168.1.9'
    ret = comm.Read('MyTagName')
    print(ret.tag_name, ret.value, ret.status)NOTE: If your PLC is in a slot other than zero (like can be done with ControLogix), then you can specify the slot with the following:comm.ProcessorSlot = 2NOTE: If you are working with a Micro8xx PLC, you must set the Micro800 flag since the path is different:comm.Micro800 = TrueIf you want to query module information for modules under a nested bus / backplane:# Uses custom CIP routing path
comm.GetModuleProperties(custom_routing_path=[(1, 0), (7, 2)])The above code will fetch module information for slot 2 of a CompactLogix CPU CompactBus virtual backplane.Other FeaturesPylogix has features other than simply reading/writing.  You can see all of them in the examples, I'll also list them hereDiscover()GetPLCTime()SetPLCTime()GetTagList()GetModuleProperties(slot=0)AuthorsBurt Peterson-Initial workDustin Roeder-Maintainer-dmroederFernando B.-Contributor-kodaman2Ottowayi-Contributor-ottowayiDaniel Leicht-Contributor-daniel-leichtLicenseThis project is licensed under Apache 2.0 License - see theLICENSEfile for details.AcknowledgementsArchie of AdvancedHMI for all kinds pointers and suggestions.Thanks to ottowayi for general python and good practice adviceThanks to all of the users that have tested and provided feedback.
Package: pyloglib
PyLogLibA python logging library designed to be quick and easy to usewith a large amount of customization optionswhile still remaining simpleLog -classSyntaxLog(prefix, suffix, splitter, time, clock, saveprefix, printprefix, savesuffix, printsuffix, savetime, printtime, print, file)DescriptionUse Log() to create a Log object, this is essential for logging since it contains all the methodsin the library.Argumentsprefixstring--- the default prefix for all logged messagessuffixstring--- the default suffix for all logged messagessplitterstring--- text to split the start of the message from the message contenttimeboolen--- if the time when logged should be displayed in the messageclockboolen--- if the time should contain the current clocksaveprefixboolen--- if the prefix should be included in the message saved to fileprintprefixboolen--- if the prefix should be included in the printed messagesavesuffixboolen--- if the suffix should be included in the message saved to fileprintsuffixboolen--- if the suffix should be included in the printed messagesavetimeboolen--- if the time should be included in the message saved to fileprinttimeboolen--- if the time should be included in the printed messageprintboolen--- if the logged messages should be printed to the consolefilestring--- file to log messages to (if left blank the messages will not be logged to a file)log -methodSyntaxlog(content, prefix, suffix, time)Descriptionlog() is a method of Log(), it is the standard way to log a message via the parameters of the object it is used on.you can change these parameters with the arguments:prefix, suffix, time.Argumentscontentstring--- the content that the message containsprefixstring--- what prefix the message should have, if left blank it will used the default value defined in Log()suffixstring--- what suffix the message should have, if left blank it will used the default value defined in Log()timeboolen--- if the time when logged should be displayed in the message, if left blank it will used the default value defined in Log()logtitle -methodSyntaxlogtitle(content)Descriptionlogtitle() is a method of Log() and is used to display some content in a very visible format, it is typicallyused for marking the start and end of tasks.Argumentscontentstring--- the content of the titlelograw -methodSyntaxlograw(content)Descriptionlogtitle() is a method of Log() and is used to log a raw message without prefixes, suffixes or time.Argumentscontentstring--- the content of the messageclear -methodSyntaxclear()Descriptionclear() is a method of Log() and is used to wipe a log of all of it's previous messages.ArgumentsThis method does not have any argumentsremove -methodSyntaxremove(number)Descriptionremove() is a method of Log() and is used to remove a certain amount of messages from a log.Argumentsnumberinteger--- the number of messages to removePyLogLib v1.0.8 - Change LogFixed error with Log.loglistChanged description
Package: pylogus
pylogusFormatted log for pythonUsage example:importloggingfrompylogusimportlogger_initlog=logger_init(__name__,logging.DEBUG)defexample():log.info("This is a info msg")log.debug("This is a debug msg")log.warning("This is a warning msg")log.error("This is a error msg")if__name__=="__main__":example()
Package: pylogutils
logutilsBetter logging made easy with support for structlog and the standard logging module.Badges 📛project status badges:version badges:tools / frameworks used by test suite (i.e. used bymake test):linters used to maintain code quality (i.e. used bymake lint):tools / frameworks used to render documentation (i.e used bymake build-docs):miscellaneous tools used to maintain this project:Installation 🗹To installpylogutilsusingpip, run the following
commands in your terminal:python3-mpipinstall--userpylogutils# install logutilsIf you don't have pip installed, thisPython installation guidecan guide
you through the process.Useful Links 🔗API Reference: A developer's reference of the API exposed by this
project.cc-python: Thecookiecutterthat was used to generate this project.
Changes made to this cookiecutter are periodically synced with this project
usingcruft.CHANGELOG.md: We use this file to document all notable changes made to
this project.CONTRIBUTING.md: This document contains guidelines for developers
interested in contributing to this project.Documentation: This project's full documentation.
Package: pylogview
logviewlogview is a simple terminal script that allows you to tail multiple log files
in a windowed format.InstallingAt this time I have only tested with Python 3.8.5 but it should work with any version
from 3.6 up.With pip:pipinstall--userpylogviewWith setup.py:gitclonehttps://github.com/CrazyIvan359/logview.gitcdlogview
pythonsetup.pyinstall--userUsageRunlogview -hfor full usage details.
Package: pylogx
pylogxpython logging extensions supporting additional levels, colorization, indentation and moreFeaturesAdditional log levels (HINT, NOTE, TRACE) for more granularityColorize log messages based on the log levelIndent log messagesLog relative time stampsDocumentationCheck thepylox documentationfor more details.QuickstartColorize your log messagesimport time
    import pylogx
    from pylogx import log

    pylogx.enable_colors(level=pylogx.Level.NOTE, ups=[pylogx.Level.NOTE])

    log.trace("Have fun with colorized log messages")
    log.note("This message disappears with the next log message")
    time.sleep(5)
    log.note("Another message disappearing soon..")
    time.sleep(5)
    log.success("Last message is gone")Indent your log messagesimport logging
    from pylogx import log, Indent

    formatter = logging.Formatter(fmt="%(asctime)s %(indent)s%(message)s")
    sh = logging.StreamHandler()
    sh.setFormatter(formatter)
    log.addHandler(sh)

    indent = Indent(indent=" => ")

    log.info("base level")

    indent.inc()
    log.info("sub level")
    indent.inc()
    log.info("sub sub level")
    indent.dec()
    log.info("sub level")Print log messages with relative time stampimport time
    import logging
    from pylogx import log, PrettyDelta, Level

    pd = PrettyDelta()
    prd = PrettyDelta(name="prettyRelativeDelta", fmt="+%M:%S.%f", relative=True)
    log.addFilter(prd)
    formatter = logging.Formatter(fmt="%(prettyDelta)s [%(prettyRelativeDelta)s] %(message)s")
    sh = logging.StreamHandler()
    sh.setFormatter(formatter)
    log.addHandler(sh)
    log.setLevel(Level.INFO)

    log.warning("enjoy relative timestamps")
    time.sleep(1)
    log.info("enjoy relative timestamps")
    time.sleep(2)
    log.info("enjoy relative timestamps")
Package: pylogz
pylogzSuper basic logger used in personal projects.Why should you use this? You probably shouldn't.Quickstartpipinstall--upgradepylogzUsagefromlogzimportget_loggerlogger=get_logger(name='libname',log_level='info',*args,**kwargs)logger.info('...')### Multi lib usage, threadsafe-ishfromlogzimportget_cls_loggerget_logger=get_cls_logger(name='libname_1',log_level='info',*args,**kwargs)get_logger2=get_cls_logger(name='libname_2',log_level='info',*args,**kwargs)# Now you can call the get_logger function from any submodule.logger=get_logger()logger.info('hi')"""2021-12-03 03:36:26Z [libname_1] <stdin>.<module>             hi"""logger2=get_logger2()logger2.info('hi')"""2021-12-03 03:36:26Z [libname_2] <stdin>.<module>             hi"""
Package: pyloidal
pyloidalPython utilities for tokamak science.InstallInstall from PyPI:$python3-mpipinstall--upgradepip
$python3-mpipinstallpyloidalInstall from GitHub repo:$gitclonehttps://github.com/PlasmaFAIR/pyloidal
$cdpyloidal
$python3-mpipinstall--upgradepip
$python3-mpipinstall.TestsFirst clone the repo, then:$python3-mpipinstall.[test]$pytest--cov=pyloidal./testsLicenseCopyrighted under the MIT License. Uses elements fromOMAS, which is also
copyrighted under MIT, 2017 Orso Meneghini.
Package: pylokit
A python CFFI wrapper for LibreOfficeKit. Tested in cpython2,
cpython3, and pypy.RequirementsAn installation of LibreOffice >= 4.3.0 is required on the same machine.If you are using cpython you needlibffi-devin order to compile CFFI.InstallationpipinstallpylokitExamplesA basic conversion from a rtf file to a doc:frompylokitimportOfficeimportoslo_path="/path/to/libreoffice/program/dir"withOffice(lo_path)aslo:withlo.documentLoad("myfile.rtf")asdoc:doc.saveAs("myfile.doc")os._exit(0)Same conversion passing an explicit format and filter options:frompylokitimportOfficeimportoslo_path="/path/to/libreoffice/program/dir"withOffice(lo_path)aslo:withlo.documentLoad("myfile.rtf")asdoc:doc.saveAs("myfile.doc",fmt="docx",options="skipImages")os._exit(0)The usage of a context manager is needed to properly handle LibreOfficeKit
file locking.
The use of _exit() instead of default exit() is required because in some
circumstances LibreOffice segfaults on process exit.AcknowledgementsProject inspired by Olly Betts’lloconv.
Package: pylol
PyLolA Module to reduce importsBROKEN DON'T INSTALLStatusCurrent Verison: 1.0.1
Author: BXRCODES
License: MIT LicenseDescriptionPython has so many packages to offer, but perhaps a bit too many. Are your imports looking messy? Well PyLol is the solution for all of that. Simply put a couple of imports rather than 100 and still get the same results!UsageUse PyLol for many things like Async Development and Opening Files, manipulate JSON Files, Do Maths and many moreLicenseMIT License
See LICENSE for more detailsPatch NotesNew:Random Class was Added to the PackageINITIAL RELEASEAll new functions in define state:ALL THE FUNCTIONS WILL HAVE THE SAME NAMES AS THEIR PROPER MODULES SO WHEN USING THEM, YOU DON'T NEED TO LEARN ANY NEW SYNTAXUpdate 1.0.11Fixed Bugs for Random Functions!Update 1.0.1 #Added os (not all of it was complete as there was so many functions but will be completed in future updates, see below for OS Functions) functionsSplit each class into different filesImport Statements are now like --> from Pylol.fileName import functionNamesFixed issues with random functions giving errorsOS FUNCS SO FARdef ctermid():
os.ctermid()def environ():
os.environ()def environb():
os.environb()def chdir(path):
os.chdir(path)def fchdir(fd):
os.fchdir(fd)def getcwd():
os.getcwd()def fsencode(filename):
os.fsencode(filename)def fsdecode(filename):
os.fsdecode(filename)def fspath(path):
os.fspath(path)deffspath():
os.fspath()def getenv(key, default=None):
os.getenv(key, default)def getenvb(key, default=None):
os.getenvb(key, default)def get_exec_path(env=None):
os.get_exec_path(env)def getegid():
os.getegid()def geteuid():
os.geteuid()def getgrouplist(user,group):
os.getgrouplist(user,group)def getgroups():
os.getgroups()def getlogin():
os.getlogin()def getpgid(pid):
os.getpgid(pid)def getpgrp():
os.getpgrp()def getppid():
os.getppid()def getpriority(which,who):
os.getpriority(which, who)def getreusid():
os.getresuid()def getresgid():
os.getresgid()def getuid():
os.getuid()def initgroups(username,gid):
os.initgroups(username,gid)def putenv(key,value):
os.putenv(key,value)def setegid(egid):
os.setegid(egid)def seteuid(euid):
os.seteuid(euid)def setgid(gid):
os.setegid(gid)def setgroups(groups):
os.setgroups(groups)def setpgrp():
os.setpgrp()def setpgid(pid,pgrp):
os.setpgid(pid, pgrp)def setpriority(which,who,priority):
os.setpriority(which,who,priority)def setregid(rgid,egid):
os.setregid(rgid,egid)def setresgid(rgid,egid,sgid):
os.setresgid(rgid, egid, sgid)def setresuid(ruid,euid,suid):
os.setresuid(ruid, euid, suid)def setreuid(ruid,euid):
os.setreuid(ruid, euid)Previous UpdateRandom Functions!seed(a=None, version=2)

getstate()

setstate(state)

getrandbits(k)

randrange(start, stop)

randint(a, b)

choice(seq)

choices(population, weights=None, *, cum_weights=None, k=1)

shuffle(x)

sample(population, k)

random()

uniform(a,b)

triangular(low, high, mode)

betavariate(alpha, beta)

expovariate(lambd)

gammavariate(alpha, beta)

gauss(mu, sigma)

lognormvariate(mu, sigma)

normalvariate(mu, sigma)

vonmisesvariate(mu, kappa)

paretovariate(alpha)

weibullvariate(alpha, beta)
Package: pylol-rl
PyLoL - League of Legends v4.20 Learning EnvironmentPyLoL is the Python component of the League of Legends v4.20 Learning Environment
(using a modified version of the LeagueSandbox's GameServer project, not the
original server from Riot). It exposes a custom machine learning API for the
GameServer project as a Python RL Environment. PyLoL provides an interface for RL
agents to interact with the League of Legends v4.20, getting observations and
sending actions.Read the README athttps://github.com/MiscellaneousStuff/pylolfor more information.
Package: pylolzapi
zelenka.guru | lolz.guru APIО библиотекиПозволяет удобно пользоваться API лолзаГрядущие обновленияДобавление всех методовДобавление Асинхронной поддержкиДобавление поддержи ПроксиДобавление документацииИспользование:frompylolzapiimportLZTApiapi=LZTApi("YOUR_TOKEN")print(api.user_info.user_id)
Package: pylom
PyLomThis is a Python library for reading and writing IMS-LOM files.
Almost all fields are supported, but only one language will be supported for language-specific langstring elements.
The reader supports common vCard field extraction with vobject.Reader UsageBasically, import the class and tell it to parse a lom file. The parsed data will be available in thelomattribute dict.
By default, it reads theenlanguage, but another can be set on init.
To start parsing, initialize the class and use one of two public methods,parsePathorparseString.basic examplefrompylom.readerimportLomReaderlomreader=LomReader()lomreader.parsePath("test/records/ims-complete.xml")print(lomreader.lom["title"])# Bloodbath of B-R5RBfieldset examplefrompylom.readerimportLomReaderlomreader=LomReader()lomreader.parsePath("test/records/ims-complete.xml",["title","location"])# Only the title and location field results are available in the lom dictWriter UsageThe writer class is used by providing it with a dictionary with all the values you want in your record. Like the reader class
the instance can be called with a language argument for all the langstring elements. After parsing, the lom record is available
in thelomattribute.basic examplefrompylom.writerimportLomWriterlomwriter=LomWriter()lomwriter.parseDict({"title":"Bloodbath of B-R5RB"})print(lomwriter.lom)custom vocabulariesBy default, all vocabulary sources are set toLOMv1.0, but they can be changed by setting thevocabulary_sourcesafter
creating the instance.frompylom.writerimportLomWriterlomwriter=LomWriter()lomwriter.vocabulary_sources.update({"aggregationlevel":"my-source"})lomwriter.parseDict({"aggregationlevel":"2"})print(lomwriter.lom)input valuesFor easy implementation, many of the values can be provided as needed. For instance, any basic element or langstring element
can be provided as string or as a list of strings.Vocabulary elements can be provided as a single string or a list of strings, using the class default vocabulary source, or as
a single dictionary, with separate source and value values.More detailed examples can be inferred from thetest_writer_elementstest cases.frompylom.writerimportLomWriterlomwriter=LomWriter()lomdict={"title":"Bloodbath of B-R5RB","keyword":["Eve Online","Halloween War"],"aggregationlevel":{"source":"my-source","value":"2"},"context":["school","higher education"]}lomwriter.parseDict(lomdict)print(lomwriter.lom)DependencieslxmlvcardsetuptoolsTo DoReaderimplement all LOM fieldssupport IEEE bindingcleanup options, trim, unique, etcapplication profile validationvalue validationWritervocabulary, provide list of source/value dictsmore LOM-spec aware validation, for instance, prevent multiple title fields
Package: pylone
PYLONEPython CD frameworkFeaturesPublish, update and delete LambdasPublish, update and delete LayersDopplerintegrationSimple and light wieghtMulti stages lambdasBefore/after deploy hooksUsagePylone usagepylone-hTemplate referencestagesglobal parameterYou can set thestagesparameter to have a multistage projectstages:-dev# first one is used as default stage-prod# all other stages are more advanced stagessourceparameterYou can use thesourceparameter to force a directory to be used as sourcesource:./binbefore-scriptparameterYou can use thebefore-scriptparameter to execute a bash script before processing an entitybefore-script:./script.sh# ORbefore-script:"echo'Starting...'"after-scriptparameterSimilar asbefore-scriptbut launch script at the end of processafter-script:./script.sh# ORafter-script:"echo'ENDofprocess'"bucket-nameparameterDefault value:pylone-bucketAllows you to choose the bucket name where pylone will upload zip files.bucket-name:tmp-pylone-files
Package: pylong
dl_cmstest framework powered by pytestcommon文件夹，可放置跨项目的通用型脚本，作为共享目的test文件夹，每个项目独立一份子文件夹（可嵌套多层），DEMO项目子文件夹的内部结构如下basic structconfig全局配置 host 、db、logdata用例数据，如输入参数、参数模板（针对复杂参数使用）、其他数据（image、export、cookies）每个参数的有效用例和无效用例可分开编写，会按照一定方式组合为param_listtest_suits用例编写（1、读取参数列表 2、调用interface对象 3、结果处理 4、断言  ）demo.py化所有待测接口为对象  （名称为自己的项目名称）run.py按需执行用例计划，生成报告write testcase step前提条件测试用例（单个接口的详细的入参和出参设计，多个接口的调用依赖流程）data，准备每个接口的测试数据（eg. cookies、input_loads)步骤config，修改host、dbdemo.py， 修改文件名，封装待测接口test_suits/conftest.py （可选）通常，需准备测试环境的脚本（setup、teardown）特殊地，需二次格式化参数，二次格式化输出，以及复杂断言的脚本test_suits/test_xx.py调用接口和conftest.py， 编写用例suit/run.py （可选）定义要执行的接口测试，运行即自动产生测试报告对接自动化测试平台在平台上新建项目，输入git地址、项目路径（以tests目录为基准的相对路径， 如DEMO就是demo项目的路径）在平台上导入用例，选择用例执行即可
Package: pylon-lib
Pylon: A PyTorch Framework for Learning with ConstraintsDependenciesPython >= 3.6torch>=1.9.0astorInstallationOptional, set up virtualenv:python3 -m venv /path/to/env
source /path/to/env/bin/activateInstall using pip:pip install pylon-libAlternatively, compile from source:git clone https://github.com/pylon-lib/pylon.git
cd pylon
python3 -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txtMake sure to install PyTorch:https://pytorch.orgBasic ExampleOur goal is to enforce the XOR constraint on the output of a simple classifier:
only one of the outputs can be "on" i.e. set to 1import torch
import torch.nn.functional as F

class Net(torch.nn.Module):
    def __init__(self, w=None):
        super().__init__()
        if w is not None:
            self.w = torch.nn.Parameter(torch.tensor(w).float().view(6, 1))
        else:
            self.w = torch.nn.Parameter(torch.rand(6, 1))

    def forward(self, x):
        return torch.matmul(self.w, x).view(3, 2)We define our constraint funcitonfrom pylon.constraint import constraint
from pylon.brute_force_solver import SatisfactionBruteForceSolver

# Our constraint function accepts a decoding tensor of
# shape (batch_size, ...) and is expected to return
# a tensor fo shape (batch_size, )
def xor(y):
    return y[:, 0] != y[:, 1] and y[:, 1] != y[:, 2]
    
xor_cons = constraint(xor, SatisfactionBruteForceSolver())And proceed to our training loop# Create network and optimizer
net = Net()
opt = torch.optim.SGD(net.parameters(), lr=0.1)

# Input and label
x = torch.tensor([1.])
y = torch.tensor([0, 0, 1])

# training loop
y0, y1, y2 = [], [], []
for i in range(500):
    opt.zero_grad()
    y_logit = net(x)
    loss = F.cross_entropy(y_logit[2:], y[2:])
    loss += xor_cons(y_logit.unsqueeze(0)) #Pylon expect tensors of shape (batch_size, ...)
    loss.backward()
    y_prob = torch.softmax(y_logit, dim=-1)
    y0.append(y_prob[0,1].data); y1.append(y_prob[1,1].data); y2.append(y_prob[2,1].data)
    opt.step()

import matplotlib.pyplot as plt
plt.plot(y0, label='y0')
plt.plot(y1, label='y1')
plt.plot(y2, label='y2')
plt.legend()
Package: pylons_sphinx_latesturl
pylons_sphinx_latesturlREADMEThis package is aSphinxextension:  it adds alatest_urlkey to the Sphinx template namespace for use in for a versioned document sets.Please seedocs/narr.rstfor detailed documentation.pylons_sphinx_latesturlChangelog0.2 (2016-02-18)When RTD is building json output thecontextis missing thefile_suffixoption but it seems safe to assume.html:sphinx-build -T -b json -d _build/doctrees-json -D language=en . _build/json0.1.1 (2013-09-09)Initial release.
Package: pylontech
pylontech-pythonFunctions to communicate to Pylontech Batteries using RS-485 serial communication3 Layer model - each can be used as lib:pylontech_base.py - Communication layer, RS485 to pylontech with raw frame supportpylontech_decode.py and pylontech_encode.py for decodeing and encoding the frame contentpylontech_stack.py high level abstraction for the whole stack.
It iterates over batteries and calculates overall results and combines battery results to lists.
Some detail information from layer 2 might not be implemented in this layer.Installation using setup.py:run 'python3 ./setup.py install'Example:
an example to use pylontech-python:from pylontech import PylontechStack
x = PylontechStack("/dev/ttyUSB0",baud=115200,manualBattcountLimit=5)
x.battcount
2A big "Thanks" to Daniel Schramm for his contibution!