Saravanan666/pypi-org huggingface dataset:
Package: moat
The MoaT"MoaT" is an acronym of "Master of all Things", which is either
aspirational or just plain pretentious. Take your pick.If you assume that this repository contains the same stuff as a regular
moat, i.e. a lot of water of questionable quality (plus whatever the
castle's inhabitants wanted to get rid off), you might not be too far off
the mark.Well, except for the water.Seriously …The MoaT code comprises a lot of somewhat-opinionated code to control
various IoT devices. Among those are photovoltaics, irrigation, door
intercoms, and whatnot.The core of MoaT is written in anyio-compatible asynchronous Python3,
written with Structured Concurrency principles in mind.Satellite microcontrollers typically run MicroPython, again heavily using
structured async code: MicroPython supports taskgroups if you patch it
lightly.Structured what?Structured Concurrency.There's aWikipedia articleabout it.A good Pythonic introduction ishere.Repository StructureThe MoaT code is built using git submodules, corresponding to separatemoat-XXXpackages.The top module contains the command-line front-end of MoaT. Any
MoaT code that can reasonably be controlled by a command line hooks into
it, by way of a_mainmodule with acliobject, which should be anasyncclickgroup (or command).The only mandatory submodule is "util". It contains a heap of
semi-structured helper code which the rest of the MoaT infrastructure
depends on. "moat-util" also has a command line; it serves as a convenient
example for building your own extension, and exports a
time-until-absolute-date calculator and a msgpack codec.ModulesLibrariesdbus: an async DBus client.gpio: a library to read and write GPIO lines.modbus: an opinionated Modbus client and server library.mqtt: a MQTT broker, client library, and client command line front-ends.wire: a bidirectional link exchanging structured messages,
with backends for serial and TCP.micro: Support for MoaT sattelites running MicroPythonMoaT partsmain, util: See above.kv: distributed masterless eventually-consistent key-value storage.ems: Battery management, photovoltaics, …src: MoaT source code managementMoaT-KV componentsMoat-KV is a master-less distributed key-value storage system. It is
resistant to partitioning and intended to be always-on. It will not block
or lose updates in a partitioned network; inconsistent entries are
re-synchronized upon reconnection."moat.kv" is currently named "distkv". Conversion to MoaT is planned.kv-akumuli: Data storage toAkumuli, an
efficient light-weight time series databasekv-gpio: Connecting Moat-KV and MoaT-GPIOkv-hass: Use MoaT-KV as the MQTT back-end to Home Assistantkv-inv: Network inventory management (hosts, networks, VLANs, links between hosts)kv-knx: Link with KNX building automation networkskv-owfs: Connecting 1wire sensorskv-wago: A rudimentary interface for WAGO 330 controllersMoaT-EMS componentsEMS is an acronym for "Energy Management System".ems-battery: Battery managementems-inv: Inverter managementems-sched: Energy storage schedulingMore will follow.
Package: moat-ble
Moat BLEManager Moat BLE DevicesInstallationInstall this via pip (or your favourite package manager):pip install moat-bleContributors ✨Thanks goes to these wonderful people (emoji key):This project follows theall-contributorsspecification. Contributions of any kind welcome!CreditsThis package was created withCookiecutterand thebrowniebroke/cookiecutter-pypackageproject template.
Package: moat-gpio
MoaT-GPIO allows easy access to the GPIO pins on your Raspberry Pi or
similar embedded computer.It is based on libgpiod and its CFFI adapter by Steven P. Goldsmith
<sgjava@gmail.com>, as downloaded fromgithub.To run examples, make sure to installtriofirst.Testing MoaT-GPIO requires a Linux distribution that enables the mock-GPIO module.
As of mid-2020, Debian’s kernel does not include this module, but Raspbian’s does.If you can compile your own kernel: the option is named CONFIG_GPIO_MOCKUP,
in Device Drivers / GPIO support / Memory mapped GPIO drivers / GPIO
Testing Driver.Writing an actual test suite is TODO. There is a more elaborate test script
inDistKV-GPIO.
Package: moat-kv
Welcome toMoaT-KV!MoaT-KV is a master-less distributed key-value storage system. It
circumvents the CAP theorem (you can’t have all of consistency, availablilty,
and fault tolerance) using the assumption that a key is typically changed
by one node only. It is thus resistant to partitioning and intended to be
always-on; it will not block or lose updates, even in a partitioned
network.MoaT-KV comes with several batteries included:Basic user management, pattern-based ACLsStrong typing, code- and/orJSON Schema-basedData manglingBackground code executionSeamless recovery even if only one master is runningThe underlying communication is based on MQTT. A Serf back-end is also
available. Others are easy to implement.MoaT-KV was originally called “distkv”.APIMoaT-KV offers an efficient msgpack-based interface to access data and to
change internal settings. Most configuration is stored inside MoaT-KV
itself.Stored data arenotforced to be strings or binary sequences, but can
be anything thatMsgPacksupports. Keys to storage are multi-level and
support string, integer/float, and tuple keys.Non-FeaturesMoaT-KV does not support data partitioning. Every node stores the whole
data set and can instantly deliver mostly-uptodate data.MoaT-KV does not have a disk-based storage backend. Periodic snapshots and
event logs can be used to quickly restore a system, if necessary.StatusMoaT-KV is mostly stable. There are a lot of corner cases that don’t
have tests yet.TODOs:
* some services (esp. command line tools and runners) are under-tested
* there’s no good API for errorsTODOclean up some of the more egregious command line mistakescreate a page for showcase-ing subprojects (knx owfs akumuli …)improve Home Assistant integration
Package: moat-kv-ha
This is a link between Home Assistant and Moat-KV.It willset up standard config for Home Assistant in MoaT-KVhave command-line support to register (or not) devicesPrinciple of OperationHome Assistant talks via MQTT. MoaT-KV has a quite versatile MQTT adapter.
Thus we can store Home Assistant’s entitiy configuration, plus their state,
plus the commands Home Assisant issues to get things to change their state,
in MoaT-KV.MQTT can only transmit binary data. DistHASS thus creates a few codecs that
support binary data (translating them to on/off), integers/floats, and JSON.Thus, bottom to top:Mosquitto on port 51883basic installation, does not need persistence or retained messagesSerf would work, but it imposesadditional delaysMoaT-KV, using Mosquitto as a backbonea special user with conversion rules for JSON etc.DistMQTTretained messages are stored in MoaT-KVtransparent channels to forward MQTT messages unmodified, if requiredanything else is broadcast as a MoaT-KV messageuses port 1883Home Assistant, or anything else MQTTish for that mattermust use MQTT 3.11If you have devices that only can use MQTT 3.1, you can teach them to talk
directly to Mosquitto, via a transparent range.SetupRunmoat kv ha init-iAdd a MoaT-KV user for Home Assistant and set itsconvparameter tohassco:moat kv auth user param NAME conv hasscoStart Moat-MQTT with something like this configuration:kv:
    server:
        host: '127.0.0.1'
        port: 27586
        auth: "password name=NAME password=PASSWORD"
    topic: [mqtt, msg]
    transparent:
    - [home,ass,event]
    - [home,ass,state]
    retain: [home, ass]
listeners:
    default:
        max-connections: 500
        type: tcp
    local-tcp:
        bind: 127.0.0.1:1883
    remote-tcp:
        bind: 10.107.3.18:1883
timeout-disconnect-delay: 2
plugins: ['auth_anonymous']
auth:
    allow-anonymous: trueIf you have devices that use MQTT directly, modify thetransparentlist to include your current MQTT prefixes.Modify Home Assistant’s MQTT integration to do autodiscovery.
If you’ve set it up via the GUI, the file you need is.storage/core.config_entries. Find the entry with"domain": "mqtt"and modify itsdataentry to read:"data": {
    "broker": "127.0.0.1",
    "discovery": true,
    "discovery_prefix": "home/ass/dyn",
    "port": 1883,
},Runmoat kv ha conv.This teaches MoaT-KV to auto-convert the Home Assistant data so that
everything in MoaT-KV sees binary states as booleans, temperatures are
floats, the configuration’s JSON is a real data structure, and so on.Without this conversion, it’s all strings. We don’t want that.Restart Home Assistant.Runmoat kv ha add light foo bar.A new light should show up in the Home Assistant GUI.You can try to turn it on, but it will go off by itself a second or two
later because there’s no device yet.Runmoat kv ha state light foo bar True.This command changes the state manually.In Home Assistant, the light’s indicator turns on.Adding an actual device that monitors the light’s MoaT-KV command entry / its
[MoaT-KV-]MQTT command topic, actually affects the hardware, and changes the
state, is your job.
Package: moat-kv-knx
MoaT-KV-KNX is a link between KNX buses and MoaT-KV.It willquery and monitor inputs as specifiedwrite values that it reads from them to some entry in MoaT-KVmonitor a MoaT-KV entry and write any updates to KNXwork with MoaT-KV’s runner system, either centrally or distributedWarningCurrently this will only work with MoaT’s fork of XKNX because we’re using
AnyIO and some other improvements.
Package: moat-kv-ow
This is a link between 1wire and MoaT-KV.It willadd all discovered 1wire devicespoll these devices as specifiedwrite values that it reads from 1wire to some MoaT-KV entrymonitor a MoaT-KV entry and write any updates to 1wirework with MoaT-KV’s runner system, either centrally or distributed
Package: moat-lib-diffiehellman
diffiehellmanThe Python Diffie-Hellman key exchange library.Usagefromdiffiehellman.diffiehellmanimportDiffieHellmanalice=DiffieHellman()bob=DiffieHellman()alice.generate_public_key()# automatically generates private keybob.generate_public_key()alice.generate_shared_secret(bob.public_key,echo_return_key=True)bob.generate_shared_secret(alice.public_key,echo_return_key=True)InstallpipinstalldiffiehellmanFeaturesImplements Diffie-Hellman key exchangePretty fastAdjustable key sizeIncludes primes for groups 5 and 14-18Currently works only with Python 3 (requires ssl). An OpenSSL compatible version is in the works.Code of MisconductBy using this package, you pledge to use it for good, not for evil. In particular, you pledge never to use this code to limit the human mind or its natural rights, in particular freedom of expression.
Package: moat-lib-pid
moat-lib-pidAn advanced PID controller in Python. The derivative term can also be used in
practice thanks to built-in first-order filter. Detailed information can be
foundhere.Usage is very simple:frommoat.lib.pidimportPID# Create PID controllerpid=PID(Kp=2.0,Ki=0.1,Kd=1.0,Tf=0.05)# Control loopwhileTrue:# Get current measurement from systemtimestamp,measurement=system.get_measurement()# Calculate control signal by using PID controllerreference=1.0control=pid(timestamp,reference-measurement)# Feed control signal to systemsystem.set_input(control)This module was vendorized from the advanced-pid module by Erkan Adalierkanadali91@gmail.com.Complete API documentation can be foundhere.UsageBiggest advantage of advanced-pid, the derivative term has a built-in first-order
filter.advanced-pid package includes a toy mass-spring-damper system model for testing:frommoat.lib.pidimportPIDfromexamples.mass_spring_damperimportMassSpringDamperfrommatplotlibimportpyplotaspltfromnumpyimportdiff# Create a mass-spring-damper system modelsystem=MassSpringDamper(mass=1.0,spring_const=1.0,damping_const=0.2)system.set_initial_value(initial_position=1.0,initial_velocity=0.0)# Create PID controllerpid=PID(Kp=1.0,Ki=0.0,Kd=2.0,Tf=0.5)# Control looptime,meas,cont=[],[],[]foriinrange(800):# Get current measurement from systemtimestamp,measurement=system.get_measurement()# Calculate control signal by using PID controllercontrol=pid(timestamp,-measurement)# Feed control signal to systemsystem.set_input(control)# Record for plottingtime.append(timestamp)meas.append(measurement)cont.append(control)# Plot resultfig,(ax1,ax2,ax3)=plt.subplots(3,1)fig.suptitle('Mass-Spring-Damper system')ax1.set_ylabel('Measured Position [m]')ax1.plot(time,meas,'b')ax1.grid()ax2.set_ylabel('Force [N]')ax2.plot(time,cont,'g')ax2.grid()ax3.set_xlabel('Time [s]')ax3.set_ylabel('Derivative Term')ax3.plot(time[1:],diff(meas)/diff(time),'r')ax3.grid()plt.show()As It can be seen in the figure, derivative term cannot be use without a filter:InstallationTo install, run:pip3 install moat-lib-pidTestsTo run tests, run:pytest testsLicenseLicensed under theMIT License.
Package: moat-modbus
This is an anyio-enabled async frontend for pymodbus.UsageCheck the example client and server for rudimentary usage.Documentation patches gladly accepted.Backgroundmoat-modbusdiverges frompymodbusin that it does not expose a “data
store” context to the user. Instead, every bus value is a separate object,
with arbitrary length and encapsulating its own encoding and decoding rules.A Modbus server exposing writeable registers only needs toregister the value in questionwait for it to be written toThe rest happens behind the scenes.Device ServerAs some Modbus devices only allow ine server at a time, MoaT’s Modbus
supports a simple bidirectional gateway.How to get there:Write a generic device description. Put it in the modbus-data repository.Add an interface overlay that describes which topic to send the data to /
which topic to read.Runmoat modbus dev poll FILE.yaml. You can use a generic systemd
service if you copy the file to/etc/moat/modbus.The values can be modified (factor+offset); the gateway works in both
directions (command/state).TODOconfigurable codecsget/set attributespack multiple values into a messageread-after-write if no slot
Package: moat-util
This is a Python “util” submodule with code that I habitually use in so
many projects that I decided to split it off into its own git archive.Feel free to extend and embrace. Patches welcome.FeaturesA few. Read the code and the subpackages’ documentation; I didn’t get
around to documenting all of that yet.LicenseNo restrictions. CC0 / public domain / MIT / GPLv3 / whatever, as long as
you don’t want anybody (i.e. the author(s)) to pay for the effects of any
bugs, features or “features” which this code might or might not have.Please contribute any enhancements.DependenciesA few. Notable:anyio, version 3. Required forValueEvent,spawn(obviously) andas_service.ruyaml. This is a fork of ruamel.yaml which is a fork of pyyaml.
Fixes some bugs and has a more reasonable API. Required foryload/yprint/yformat.msgpack, obviously required forpack/unpackandMsgReader/MsgWriter.asyncclick, required formain_/wrap_main.
Package: mobagel-python-sdk
# mobagel-python-sdk## IntroduceMoBagel is a real-time cloud analytics platform that helps IoT companies monitor and analyze hardware usage, speed up research and development, forecast sales and marketing strategies, and proactively engage with customers to prevent product returns. As a result, companies can also save up to millions in cost reductions.[More detail](https://mobagel.com/features)[Documentation](https://mobagel.github.io/docs/site/integrations/python/)
Package: moban-ansible
InstallationYou can install moban-ansible via pip:$pipinstallmoban-ansibleor clone it and install it:$gitclonehttps://github.com/moremoban/moban-ansible.git$cdmoban-ansible$pythonsetup.pyinstallChange log0.0.2 - 04.09.2020added#1: three parameters
supported in lineinfile module of ansible0.0.1 - 02.09.2020first releasewhat a feat! files tests are available.
Package: moban-anyconfig
It allows moban to use more data formats than yaml and json.Given the following toml file, sample.toml:title = "TOML Example"
[owner]
name = "Tom Preston-Werner"You can do:$moban-csample.toml"{{name}} made {{title}}"Templating{{owner.na...tomoban.outputTemplated1file.$catmoban.outputTomPreston-WernermadeTOMLExampleNOTEFor any of the following data formats, you elect to install by yourself.Supported formats by pluggable backend modulesFormatTypeRequired backendAmazon Ionionanyconfig-ion-backendBSONbsonanyconfig-bson-backendCBORcboranyconfig-cbor-backendoranyconfig-cbor2-backendConifgObjconfigobjanyconfig-configobj-backendMessagePackmsgpackanyconfig-msgpack-backendOr you could choose to install all:$pipinstallmoban-anyconfig[all-backends]InstallationYou can install moban-anyconfig via pip:$pipinstallmoban-anyconfigor clone it and install it:$gitclonehttps://github.com/moremoban/moban-anyconfig.git$cdmoban-anyconfig$pythonsetup.pyinstallChange log0.0.1 - Nonefirst releasewhat a feat!
Package: moban-handlebars
IntroductionWithpybars3, this library allow moban users to
have handlebars template in their next documentation endeavour.Quick start$moban"<p>{{firstname}} {{lastname}}</p>"--template-typehandlebars-dfirstname=hellolastname=worldNested input objectsGiven a data.json file with the following content{
  "person": {
    "firstname": "Yehuda",
    "lastname": "Katz",
  },
}$moban--template-typehandlebars-cdata.json"{{person.firstname}} {{person.lastname}}"Handlebars-ing<p>{{first...tomoban.outputHandlebarsed1file.$catmoban.outputYehudaKatzForhandlebars.jsusers, yes, the example was copied from handlebarjs.com. The
aim is to show off what we can do.Let’s continue with a bit more fancy feature:$moban--template-typehandlebars-cdata.json"{{#with person}}{{firstname}} {{lastname}} {{/with}}"Moban’s way ofpybar3 usage:Let’s save the following file ascript.pyunderhelper_and_partialfolder:frommoban_handlebars.apiimportHelper,register_partialregister_partial('header','<h1>People</h1>')@Helper('list')def_list(this,options,items):result=[u'<ul>']forthinginitems:result.append(u'<li>')result.extend(options['fn'](thing))result.append(u'</li>')result.append(u'</ul>')returnresultAnd givendata.jsonreads as the following:{
    "people":[
        {"name": "Bill", "age": 100},
        {"name": "Bob", "age": 90},
        {"name": "Mark", "age": 25}
    ]
}Let’s invoke handlebar template:$moban--template-typehbs-pdhelper_and_partial-cdata.json"{{>header}}{{#list people}}{{name}} {{age}}{{/list}}"Handlebars-ing{{>header}...tomoban.outputHandlebarsed1file.$catmoban.output<h1>People</h1><ul><li>Bill100</li><li>Bob90</li><li>Mark25</li></ul>InstallationYou can install moban-handlebars via pip:$pipinstallmoban-handlebarsor clone it and install it:$gitclonehttps://github.com/moremoban/moban-handlebars.git$cdmoban-handlebars$pythonsetup.pyinstallAuthorCharlie LiuContributorsIn alphabetical order:C. W.John VandenbergPRAJWAL MChange log0.0.5 - 07.06.2020UpdatedName the moban actions when this template is used#12: provide
apis for end user to use their own block helper and partials0.0.4 - 14.10.2019Updated#10: support
moban v6.50.0.3 - 10.09.2019Updated#7: support moban
v4.1#9: support moban
v60.0.2 - 22-01-2019Updated#1: support moban
v0.3.8#2: add license
file#3: support moban
v0.3.90.0.1 - 18-11-2018First releaserender .hbr .handlebars files for moban
Package: moban-jinja2-github
InstallationYou can install moban-jinja2-github via pip:$pipinstallmoban-jinja2-githubor clone it and install it:$gitclonehttps://github.com/moremoban/moban-jinja2-github.git$cdmoban-jinja2-github$pythonsetup.pyinstallChange log0.0.4 - 17.10.2020addedexclude a list of user names instead of a single user name0.0.3 - 02.09.2020addedmoban.plugins.jinja2.filters.github is moved here0.0.2 - 28.08.2020first releasecope with new born project where github link is not ready. contributors list
will be empty.0.0.1 - 23.08.2020first releasefirst moban jinja2 globalsgetcontributors(minusauthor)fromgithub.Whatafeat!
Package: moban-slim
Withslimish-jinja2 for Python 3, this library allow moban users to
have slim template in their next documentation endeavour.Quick startGiven a data.json file with the following content{
  "person": {
    "firstname": "Smith",
    "lastname": "Jones",
  },
}$moban--template-typeslim-cdata.json"{{person.firstname}} {{person.lastname}}"Slimming<p>{{first...tomoban.outputSlimmed1file.$catmoban.outputSmithJonesInstallationYou can install moban-slim via pip:$pipinstallmoban-slimor clone it and install it:$gitclonehttps://github.com/moremoban/moban-slim.git$cdmoban-slim$pythonsetup.pyinstallAuthorCharlie LiuContributorsIn alphabetical order:C. W.John VandenbergPRAJWAL MChange log0.0.2 - 16-06-2020Updated#1: support moban
v0.3.8#3: support moban
v0.3.9#5: support moban
v.0.4.1#6: support moban
v6.0.00.0.1 - 30-11-2018First releaserender slim files for moban
Package: moban-velocity
Withairspeedfor Python 3, this library allows moban users to have velocity
template in their next documentation endeavour.Given the following data.json:{"people":
    [
        {"name": "Bill", "age": 100},
        {"name": "Bob", "age": 90},
        {"name": "Mark", "age": 25}
    ]
}And given the following velocity.template:Old people:
#foreach ($person in $people)
 #if($person.age > 70)
  $person.name
 #end
#end

Third person is $people[2].namemobancan do the template:$moban--template-typevelocity-cdata.json-tvelocity.templateVelocity-templatingvo.ttomoban.outputVelocity-templated1file.$catmoban.outputOldpeople:BillBobThirdpersonisMarkInstallationYou can install moban-velocity via pip:$pipinstallmoban-velocityor clone it and install it:$gitclonehttps://github.com/moremoban/moban-velocity.git$cdmoban-velocity$pythonsetup.pyinstallAuthorAyan BanerjeeContributorsIn alphabetical order:C. W.John VandenbergPRAJWAL MChange log0.0.2 - 03.06.2020AddedSupport moban v0.6.0+0.0.1 - 02.02.2018First releaseRender .velocity, .vtl files for moban
Package: mobase-stubs
Mypy stubs for the mobase Python APIThis repository holds the stubs of themobasepython module, which contains the Python plugin
interface forMod Organizer 2plugins.
It uses the stub files that are produced byhttps://github.com/ModOrganizer2/pystubs-generation/.InstallationSimply installmobase-stubswith pip:$ pip install mobase-stubs
Package: mobel
MobelDescriptionMobel is a library that provides some improvements for the standard Python decorator pattern. It includes the following features:A utility function to generate entities that combine decorator and decorator Factory in one easy to use functionA method to annotate functions similar to Java. This does not affect the function itself but provides a way to mark them as having certain propertiesA method to pipe decorators and create a combined decorator ( or decorator factory )for details on how to implement these features you can check out thedocs