Saravanan666/pypi-org huggingface dataset:
Package: pydevlpr
pydevlprOverviewEnables simple muscle to application connections.
Pydevlpr is the front-end fordevlprd <https://github.com/FANTM/devlprd>_, and the third piece of the muscle-to-app pipeline.Getting StartedAfter installing pydevlpr, integrating it into a project is straightforward.
First launch thedevlprd daemon <https://github.com/FANTM/devlprd>_, and then use theadd_callback(...)function to attach a handler to the incoming data.
The callback you attach will get the incoming payload as its only parameter, and then the data is yours to handle.Supported TopicsThis list will expand as the package matures, but when adding/removing callbacks use a data topic from this list as it maps directly to the daemon.DataTopic.RAW_DATA_TOPIC - Data straight off the DEVLPR Arduino Shield. Range: 0-1023.DataTopic.FLEX_TOPIC - 1 when there has been a flex, 0 when muscle is relaxed.APIdef stop() -> None:Stops listening to the server.def add_callback(topic: str, pin: int, fn: Callable[[str], None], ws: websocket.server.WebSocketServerProtocol = None) -> None:Attaches a function to be called whenever a message is received at a particular topic and relating to a particular DEVLPR (as specified by thepinparameter).topic: str - Specifies the data stream, differentiating filtered vs. raw data.pin: int - Connects the callback to a physical board. Each DEVLPR is connection to the Arduino via an analog pin, and the message from the daemon relates which pin this is.fn: Callable[[str], None] - Function to be called when a message is received that is both the specified topic and pin. It expects to receive the payload of the incoming message.ws: websocket.server.WebSocketServerProtocol - Websocket connection, by default set to None and uses pydevlprs global connection.
Pass a connection in if it is going to be used in another context, or for testing.def remove_callback(topic: str, pin: int, fn: Callable[[str], None]) -> None:Stops a function from being called whenever a new qualified packet is received.topic: str - The data stream the existing callback is attached to.pin: int - The DEVLPR the callback is attached to.fn: Callable[[str], None] - Function to remove from the callback list.
Package: pydevmgr
____            _                      ____          _ _               _   _              
|  _ \ __ _  ___| | ____ _  __ _  ___  |  _ \ ___  __| (_)_ __ ___  ___| |_(_) ___  _ __   
| |_) / _` |/ __| |/ / _` |/ _` |/ _ \ | |_) / _ \/ _` | | '__/ _ \/ __| __| |/ _ \| '_ \  
|  __/ (_| | (__|   < (_| | (_| |  __/ |  _ <  __/ (_| | | | |  __/ (__| |_| | (_) | | | | 
|_|   \__,_|\___|_|\_\__,_|\__, |\___| |_| \_\___|\__,_|_|_|  \___|\___|\__|_|\___/|_| |_| 
                           |___/This is a redirection of thepydevmgr_eltpackages (pydevmgr was the old name in v0.2).By installing this package one will install the following packages :pydevmgr_elt: pydevmgr Classes to handle ELT devices. Which depend on:pydevmgr_core: Core package of pydevmgrpydevmgr_ua: Classes to handle UA communication within pydevmgrThe documentation of pydevmgr_elt ishereInstall>pipinstallpydevmgr_eltBasic usagefrompydevmgr_eltimportMotor,waitmotor1=Motor(address="opc.tcp://192.168.1.11:4840",prefix="MAIN.Motor001")try:motor1.connect()wait(motor1.reset())wait(motor1.init())wait(motor1.enable())wait(motor1.move_abs(2.3,0.5),lag=0.1)print("Motor Pos",motor1.stat.pos_actual.get())finally:motor1.disconnect()
Package: pydevmgr-core
This python package is used as a core engine for any pydevmgr high level package.The documentation is on its way, but one may be interested to higher level package such aspydevmgr_uapydevmgr_eltPython package to by used as substitute of a real device manager running in a ELT-Software environment when the full ELT-Software environment cannot be used.Sources arehereInstall>pipinstallpydevmgr_coreBasic Usagepydevmgr_core is not indented to be used directly but used by other pydevmgr related package as a core engine.For usage here is an example using pydevmgr_ua to access an OPC-UA node :frompydevmgr_uaimportUaRpc,UaNode,UaComfrompydevmgr_core.nodesimportInsideIntervalimporttimecom=UaCom(address="opc.tcp://192.168.1.11:4840",prefix="MAIN")target=7.0move=UaRpc(com=com,suffix="Motor1.RPC_MoveAbs",args_parser=[float,float])pos=UaNode(com=com,suffix="Motor1.stat.lrPosActual")test=InsideInterval(node=pos,min=target-0.1,max=target+0.1)try:com.connect()move.call(7.0,1)whilenottest.get():time.sleep(0.1)print("posisiotn is",pos.get())finally:com.disconnect()Or using the highest level dedicated for ELT devices:frompydevmgr_eltimportMotor,waitm1=Motor('motor1',address="opc.tcp://192.168.1.11:4840",prefix="MAIN.Motor1")try:m1.connect()wait(m1.move_abs(7.0,1.0),lag=0.1)print("position is",m1.stat.pos_actual.get())finally:m1.disconnect()
Package: pydevmgr-elt
This python package is used to handle ELT standard devices directly from python objects and through OPC-UA.The package is intended to be used when a full instrument ELT software is not available but scripting needs to be done on devices and using the Low Level ELT software (Running on Beckhoff PLC).
A good exemple of the use case is making sequences of initialisation and movement of motors for AIT purposes without the
need to buil a high level ELT software.The documentation (for version >=0.3) ishereSources arehereInstall>pipinstallpydevmgr_eltFrom sources :>gitclonehttps://github.com/efisoft-elt/pydevmgr_elt
>cdpydevmgr_elt>pythonsetup.pyinstallBasic Usage(since v0.5)frompydevmgr_eltimportMotor,waitwithMotor('motor1',address="opc.tcp://192.168.1.11:4840",prefix="MAIN.Motor1")asm1:wait(m1.move_abs(7.0,1.0),lag=0.1)print("position is",m1.stat.pos_actual.get())Can also be done in the old way:frompydevmgr_eltimportMotor,waitm1=Motor('motor1',address="opc.tcp://192.168.1.11:4840",prefix="MAIN.Motor1")try:m1.connect()wait(m1.move_abs(7.0,1.0),lag=0.1)print("position is",m1.stat.pos_actual.get())finally:m1.disconnect()frompydevmgr_eltimportMotor,DataLinkm1=Motor('motor1',address="opc.tcp://152.77.134.95:4840",prefix="MAIN.Motor1")m1_data=Motor.Data()# m1_data is a structure built with default valuem1_dl=DataLink(m1,m1_data)# create a data link use to fill m1_data to real hw valueswithm1:# with conexte manager open/close a connectionm1_dl.download()print(m1_data.stat.pos_actual,m1_data.stat.pos_error)Open from an elt yaml configuration file as defined in ELT IFW v3frompydevmgr_eltimportopen_elt_devicemotor1=open_elt_device("tins/motor1.yml")
Package: pydevmgr-serial
An pydevmgr_core extension for serial communicationSources arehereDoc to commeInstall>pipinstallpydevmgr_serialBasic UsageBellow is an exemple of implementation of a node that check a value from a Tesla Sensor.
An extra configuration argument is added and the fget method is implemented.frompydevmgr_serialimportBaseSerialNode,SerialComimporttimeclassTesaNodeConfig(BaseSerialNode.Config):type:'Tesa'delay:float=0.1classTesaNode(BaseSerialNode):Config=TesaNodeConfigdeffget(self):self.com.serial.write(b'?\r')time.sleep(self.config.delay)sval=self.com.serial.read(20)val=float(sval)returnval# build a standalone nodetesa_com=SerialCom(port='COM1',baudrate=9600)tesa=TesaNode(com=tesa_com)try:tesa_com.connect()print("Position is ",tesa.get())finally:tesa_com.disconnect()One can include the node in devicefrompydevmgr_serialimportBaseSerialDevicefrompydevmgr_coreimportNodeAliasclassTesa(BaseSerialDevice):raw_pos=TesaNode.Prop('raw_pos')@NodeAlias.prop('scaled_pos',['raw_pos'])defscaled_pos(self,raw_pos):return10+1.3*raw_postesa=Tesa('tesa',com={'port':'COM1'})tesa.connect()tesa.scaled_pos.get()
Package: pydevmgr-ua
pydevmgr package dedicated for generic client communication with OPC-UA.The documentation is in progress.One may be interested to higher level package such aspydevmgr_eltPython package to by used as substitute of a real device manager running in a ELT-Software environment when the full ELT-Software environment cannot be used.Sources arehereInstall>pipinstallpydevmgr_uaBasic Usagefrompydevmgr_uaimportUaRpc,UaNode,UaComfrompydevmgr_core.nodesimportInsideIntervalimporttimecom=UaCom(address="opc.tcp://192.168.1.11:4840",prefix="MAIN")target=7.0move=UaRpc(com=com,suffix="Motor1.RPC_MoveAbs",arg_parsers=[float,float])pos=UaNode(com=com,suffix="Motor1.stat.lrPosActual")test=InsideInterval(node=pos,min=target-0.1,max=target+0.1)try:com.connect()move.call(7.0,1)whilenottest.get():time.sleep(0.1)print("posisiotn is",pos.get())finally:com.disconnect()
Package: pydevmgr-vlt
pydevmgr extention for VLT devices.Under construction So far only Motor and IoDev has been implementedThe rest will be implemented on demandInstall>pipinstallpydevmgr_vltBasic usagefrompydevmgr_vltimportVltMotorfrompydevmgr_coreimportwaitm1=VltMotor("m1",address="opc.tcp://192.168.1.11:4840",prefix="MAIN.Motor001")io=VltIoDev("m1",address="opc.tcp://192.168.1.11:4840",prefix="MAIN.IODev1")try:m1.connect()io.connect()wait(m1.init())wait(m1.move_abs(4.0,1.0))print(m1.stat.pos_actual.get())io.set_do([False]*8)io.set_do({2:True,5:True}io.set_ao({0:45.6,1:89.2})finally:m1.disconnect()io.disconnect()
Package: pydevtips
Creating virtual environment and installWithAnaconda(recommended).
After installing Anaconda orMiniconda(light version), create a new environment:# create new environment, press enter to acceptcondacreate-nproject_envpython=3.9# view available environmentscondainfo--envs# activate environmentcondaactivateproject_env# instal package locally(project_env)pipinstall-e.# deactivate environment(project_env)condadeactivateFor machines really light on memory (e.g. Raspberry Pi) useVirtualenv:# install library if not alreadypipinstallvirtualenv# create virtual environment (creates folder called project_env)python3-mvenvproject_env# activate virtual environmentsourceproject_env/bin/activate# instal package locally(project_env)pipinstall-e.# deactivate virtual environment(project_env)deactivateCode formattingThrough pre-commit hooks:# inside virtual environment(project_env)pipinstallpre-commit(project_env)pipinstallblack# Install git hooks(project_env)pre-commitinstall# pre-commit installed at .git/hooks/pre-commitTestingWrite tests in thetestsfolder as function that begin withtest_.To run tests (installpytestfirst if not already done):# inside virtual environment(project_env)pipinstallpytest# run tests(project_env)pytestTo run a specific test:# inside virtual environment(project_env)pytesttests/test_fftconvolve.py::test_fftReleasing new version and deploy to PyPiUploading to PyPi is done viatwine.In the steps below, replace “X.X.X” with the appropriate version number.# inside virtual environment(project_env)pipinstalltwine# edit version in setup
# build package(project_env)pythonsetup.pysdistbdist_wheel# -- creates zip in dist folder# upload to pypi(project_env)python-mtwineuploaddist/pydevtips-X.X.X.tar.gz# -- X.X.X is the version number in setup.py
# -- enter username and password
# -- check https://pypi.org/project/pydevtips/X.X.X/# new release on GitHubgittag-aX.X.X-m"version X.X.X"gitpushoriginX.X.XOnGitHubset the new tag
by (1) clicking “…” and selecting “Create release” and (2) at the bottom
pressing “Publish release”.TODOgithub pagepoint out features in scripts: object-oriented, asserts, tqdm, type hintsmatplotlib, pytest, black in dev installexample file with hydramanifest file to not include file in packageGitHub actions for releasing to PyPidocumentation (autodoc)adding badges to README
Package: pydevto
PyDevToUnofficial dev.to api for python.FeaturesImplements all endpoints fromhttps://docs.dev.to/api/Implements a few other api endpoints not documented but available in the source, such as users and follow_suggestionsIncludes a helper method to convert html to dev.to specific markdown, including support for dev.to specific embeds such as YouTube.InstallationUse the package managerpipto install pydevto.pipinstallpydevtoUsageMake sure you have an api key to use the authenticated endpoints.  You can get your key fromhttps://dev.to/settings/account(You can use pydevto without an api key for some functions, such as the public articles)importpydevtoapi=pydevto.PyDevTo(api_key='MY_KEY')api.articles()# returns list of your own published articlesMethodsimportpydevtoapi=pydevto.PyDevTo(api_key='MY_KEY')api.public_articles(page=None,tag=None,username=None,state=None,top=None)# Return list of public (published) articlesapi.public_article(id)# Return a single public (published) article given its idapi.articles(page=None,per_page=None,state="published")# Return a list of user articlesapi.create_article(...)# Create an articleapi.update_article(id,...)# Update an articleapi.user(id=None,username=None)# Return user informationapi.follow_suggestions(page=None)# Return list of follow suggestionsapi.tags(page=None)# Return list of tagsapi.webhooks()# Return list of webhooksapi.webhook(id)# Return single webhook with idapi.create_webhook(source,target_url,events)# Create a new webhookapi.delete_webhook(id)# Delete  a webhook with idHtml to MarkdownPyDevTo contains a helper function to convert html to dev.to specific markdown (https://dev.to/p/editor_guide)
It supports images with captions using the HTML figcaption tag, and converts embeds such as YouTube to dev.to specific liquid tags.>>>importpydevto>>>pydevto.html_to_markdown('<h1>Heading</h1')>>>'# Heading\n\n'>>>pydevto.html_to_markdown('<iframe src="https://www.youtube.com/embed/kmjiUVEMvI4"></iframe>')>>>'\n{% youtube kmjiUVEMvI4 %}\n'Known issuesThe tags property does not currently work correctly when creating/updating an article.  There is an open issue report on dev.to for this.The html to markdown only caters for a subset of embeds (YouTube, Twitter, repl.it, soundcloud and a few more), more will be added over time.ContributingPull requests and issue reports are welcome.LicenseMIT
Package: pydevtoolkit
This is a set of tools made for python developer’s for their python development.Change Log0.0.0 (11/5/2020)Test Release will be removed0.0.1 (11/5/2020)Test Release will be removed0.0.2 (11/5/2020)Test Release will be removed‘quickcalc’ has been renamed to ‘Calculator’THIS IS AN UNSTABLE VERSION (DONT USE)CREATOR ONLY0.0.3 (11/5/2020)Test Release will be removed‘quickcalc’ has been renamed to ‘Calculator’CREATOR ONLY0.0.4 (11/5/2020)Test Release will be removed‘quickcalc’ has been renamed to ‘Calculator’CREATOR ONLY
Package: pydevtools
Python DevtoolsPydevtools is full of tools i have found to be useful for python3 developmentThis project is BIG fans of decorators. All tools in this project can be used by adding a decorator to a functionGetting startedImportImporting is pretty straight forward simply addimport pydevtoolsTimerTime any function in your code simply by adding the @pydevtools.optimize.timer(output_function) decorator
The output_function variable is designed to be a logging function such as logging.debug
Any function that accepts a single string as input can be used as an output_functionGet_callsWe have all been there. A complex piece of code where one function keeps breaking and you suspect it is because of something that calls it
get_calls helps you find exactly what is breaking it by giving you the function that calls it and the arguments that calls it
it can be applied to any function by using the @pydevtools.debug.get_calls(output_function) decorator
The output_function argument can be any function that accepts a single string argument but is intented for a logging function or print
Package: py-devtools-builtin
Add devtools.debug() to python builtinspython-devtoolsis a tool with
multiple debug functionality. As described in thedocsyou can
add its toolset to the python builtins with a little trick. But instead of adding the
import tositecustomize.pyorusercustomize.pyyou can also write it to a*.pyfile in thesite-packagesdirectory and also add a*.pthfile which
then imports the first file. This package does exactly that.Simply install this package alongsidedevtoolsand you have its toolset available
without an explicit import:$ pip install devtools py-devtools-builtinIf you do not havedevtoolsinstalled,py-devtools-builtinwill installed it for you.
Package: pydevutils
Python Dev Utils
===A collection of commands and functions used for building modules and developing python code.Provides the following commands:bump_package_patch_version - when run inside a module with setup.py, it will update the VERSION.make-github-repo - Automate the creation of github repo. This command will create a local repo or if you already have an existing repo, it will connect to your github account and create a remote repo to push your code to.Test
—make testYou can also test with a specific version of Python:make PYTHON_VERSION=2.7.11 test
Package: pyDEW
pyDEWTools for interacting with DEW, EQPT, and EQ3, via python (formally known as pyQ3).The first step is to import DEW into ENKI by making phase objects for each DEW species. This is done in the import_DEW.ipnb notebook.For demonstrations of how to create custom DATA0 files, and for running EQ3 calculations, see the notebooks in the tutorial folder.To install the module, navigate to the folder and runpip install .. The first time you create an instance of a DEW System in a notebook or script, the module will take some time to compile the ThermoEngine Coder generated code. Be patient!To use a binder instance of the code, go here:
Package: pyDewesoft
pyDewesoft modulePython module to work with Dewesoft files.Current capabilities:Reading native Dewesoft files (.d7d, .dxd, .d7z and .dxz)Appending multiple Dewesoft files in a single Python data object.Filling time gaps between multiple Dewesoft files, to create a continues time vector (useful when Dewesoft has error due to data lost)Data is stored in a Python object, where each channel is an attributeTime vectors are stored effectively for each channel. If a time vector is used for multiple channels it is only stored once.Saving to disk of the Python object is done with the highest compression rate
Package: pydewey
Dewey — a fast reproducible training automation tool for MLOps pipelines.Dewey is a machine learning automation tool written to create consistent reproducible ways to train models
in a framework agnostic way. It allows providing a training specification, and the Dewey training framework
takes care of all of the standard boilerplate code involving writing training loops, monitoring & metrics,
managing model checkpoints, and more. Please note that this tool is in early stages of development and is
prone to rapid updates and breaking API changes.
Package: pydex
Python Design of ExperimentsAn open-source Python package for optimal experiment design, essential to a modeller's toolbelt. If you are someone who develops a model of any kind, you will relate to the challenges of estimating its model parameters. This tool will help design maximally informative experiments for collecting data to calibrate your model. This package is a simple and powerful toolkit you must have. With an intuitive syntax and helpful documentation, it should take you little time to start designing optimal experiments for estimating the parameters of your model.InstallationPyPI$ pip install pydexQuick StartDemoof basic features.Exampleof experimental design for differential equation models.Features:Strive to be as simple as possible to use, but not simpler.Designs continuous experimental designs.Interfaces to optimization solvers through scipy, and cvxpy.Convenient built-in visualization capabilities.Supports virtually any model, as long as it can be written as a Python function.Dependencies:matplotlib: used for visualization.numdifftools: used for numerical estimation of parameter sensitivities.scipy: used for interfacing with numerical optimizers.cvxpy: used for interfacing with numerical optimizers.pickle: for saving objects (results, data, etc.).dill: for saving objects with weak-references.python 3.x: a core package.numpy: a core package for basic array manipulations.corner: a package for visualizing high-dimensional data points in a corner plotemcee: a package for Bayesian Inference using a Markov Chain Monte Carlo (MCMC) methodExamplesIn this repository, you will find examples of designing optimal experiments for a wide range of models, defined explicitly, and implicitly through the solution of a system of ordinary differential equations. Currently, there are examples for using scipy and pyomo for integrating the ODE models. Syntax for solution, visualization, and saving & loading progress are shown in the examples.Do you feel something is confusing? Something can be improved? Interested to contribute? Have a feature to request? Feel free to drop a line at:kennedy.putra.kusumo@gmail.com.
Package: pydexcom
A simple Python API to interact with Dexcom Share service. Used to getreal-timeDexcom CGM sensor data.QuickstartDownload theDexcom G6 / G5 / G4mobile app andenable the Share service.The Dexcom Share service requires setup of at least one follower to enable the share service, butpydexcomwill use your credentials, not the follower'sInstall thepydexcompackage.pip3 install pydexcomProfit.>>>frompydexcomimportDexcom>>>dexcom=Dexcom("username","password")# `ous=True` if outside of US>>>glucose_reading=dexcom.get_current_glucose_reading()>>>print(glucose_reading)85>>>glucose_reading.value85>>>glucose_reading.mmol_l4.7>>>glucose_reading.trend4>>>glucose_reading.trend_direction'Flat'>>>glucose_reading.trend_description'steady'>>>glucose_reading.trend_arrow'→'>>>print(bg.datetime)2023-08-0720:40:58>>>glucose_reading.json{'WT':'Date(1691455258000)','ST':'Date(1691455258000)','DT':'Date(1691455258000-0400)','Value':85,'Trend':'Flat'}Documentationhttps://gagebenne.github.io/pydexcom/pydexcom.htmlFrequently Asked QuestionsWhy is my password not working?The Dexcom Share API understandably reports limited information during account validation. If anything is incorrect, the API simply reports back invalid password (pydexcom.errors.AccountErrorEnum). However, there could be many reasons you are getting this error:Use the correct Dexcom Share API instance.If you are located outside of the United States, be sure to setous=Truewhen intializingDexcom.Use your Dexcom Share credentials, not the follower's credentials.Use the same credentials used to login to the Dexcom mobile application publishing the glucose readings.Ensure you have at least one follower on Dexcom Share.The Dexcom Share service requires setup of at least one follower to enable the service, as does this package.Check whether your account credentials involve usernames or emails.There are two account types the Dexcom Share API uses: legacy username-based accounts, and newer email-based accounts. Be sure to use the correct authentication method.Use alpha-numeric passwords.Some individuals have had problems with connecting when their Dexcom Share passwords are entirely numeric. If you have connection issues, try changing your password to something with a mix of numbers and letters.Report it!The Dexcom Share API sometimes changes. If you believe there is an issue withpydexcom, feel free tocreate an issueif one has not been created yet already.Why not use the official Dexcom Developer API?The official Dexcom API is a great tool to view trends, statistics, and day-by-day data, but is not suitable for real time fetching of glucose readings as it is a retrospective API.How can I let you know of suggestions or issues?By all means submit a pull request if you have a feature you would like to see in the next release. Alternatively, you maycreate an issueif you have a suggestion or bug you'd like to report.Where is this package being used?Primarily this package is used in theHome Assistant Dexcom integration, but it's fantastic to see community projects involvingpydexcom:Tracking glucose levels using a Raspberry Pi and e-ink displayGlucose Readings in a Terminal Prompt