Saravanan666/pypi-org huggingface dataset:
Package: hwhpykit
hwhpykit依据个人习惯封装的常用第三方库依赖的第三方库：RedisMain functionCacheRedis-clientstringlisthashsetzsetgeoserversubscribetransactionBufferKafka-clientRabbitMQ-clientRocketMQ-clientDataBaseMySQL-clientPostgreSQL-clientCacheRedis-clientfrom hwhpykit.cache.reids.RedisManager import RedisManagerRedisManager.config(host="127.0.0.1", db=0)stringRedisManager.string.set("reids", "value")RedisManager.string.set_keys({"a":1, "b": 2})RedisManager.string.set_range("redis", 6, "666")RedisManager.string.set_not_exist_key('11', "1222")RedisManager.string.append('redis', '---')key = 'redis'r = RedisManager.string.get(key)r = RedisManager.string.get_len(key)r = RedisManager.string.get_range(key, 0, -1)r = RedisManager.string.get_values(['11', "1222"])RedisManager.string.set('2', '0')RedisManager.string.increase('2')RedisManager.string.increase('2', -100000)r = RedisManager.string.get('2')hashkey = "redis-hash"RedisManager.hash.set_map(key, {"louis1": "1", "louis2": "2"})RedisManager.hash.set_value(key, "louis3", "3")RedisManager.hash.set_not_exits_value(key, "louis3", "4")r = RedisManager.hash.get_all(key)RedisManager.hash.delete_field(key, "louis1")RedisManager.hash.increase_field_int(key, "louis3", 100)RedisManager.hash.increase_field_float(key, "louis2", 100.000001)r = RedisManager.hash.get_all(key)r = RedisManager.hash.get_all_keys(key)r = RedisManager.hash.get_all_values(key)r = RedisManager.hash.get_all_key_count(key)r = RedisManager.hash.get_value_bytes_len(key, "louis2")r = RedisManager.hash.scan(key, cursor=0, pattern="louis2", count=10)setkey = "test_set"key1 = "test_set_1"key2 = "test_set_2"key3 = "test_set_3"RedisManager.set.add(key1, 1, 2, 3)RedisManager.set.add(key2, 1, 2, 3, 4, 5, 6)RedisManager.set.add(key3, 1, 2, 3, 7, 8, 9)RedisManager.set.remove(key, 1, 2, 3)RedisManager.set.count(key)RedisManager.set.difference(key2, key3)RedisManager.set.intersection(key2, key3)RedisManager.set.union(key2, key3)RedisManager.set.is_member(3, key3)RedisManager.set.get_all_value(key3)GEOkey = "test-geo-key"RedisManager.geo.add(key, 1, 1, 'a1')RedisManager.geo.add(key, 2, 1, 'a2')RedisManager.geo.get_location(key, 'a')distance = RedisManager.geo.distance(key, 'a1', 'a2')locations = RedisManager.geo.radius_locations(key, 0, 0,300, withdist=True, withcoord=True, sort='ASC')locations = RedisManager.geo.radius_locations_by_member(key, 'a1', 300, withdist=True, withcoord=True, sort='ASC')location_hash = RedisManager.geo.hash(key, 'a1', 'a2')Database
Package: hwi
Bitcoin Hardware Wallet InterfaceThe Bitcoin Hardware Wallet Interface is a Python library and command line tool for interacting with hardware wallets.
It provides a standard way for software to work with hardware wallets without needing to implement device specific drivers.
Python software can use the provided library (hwilib). Software in other languages can execute thehwitool.Caveat emptor: Inclusion of a specific hardware wallet vendor does not imply any endorsement of quality or security.PrerequisitesPython 3 is required. The libraries andudev rulesfor each device must also be installed. Some libraries will need to be installedFor Ubuntu/Debian:sudo apt install libusb-1.0-0-dev libudev-dev python3-devFor Centos:sudo yum -y install python3-devel libusbx-devel systemd-develFor macOS:brew install libusbInstallgit clone https://github.com/bitcoin-core/HWI.git
cd HWI
poetry install # or 'pip3 install .' or 'python3 setup.py install'This project uses thePoetrydependency manager. HWI and its dependencies can be installed via poetry by executing the following in the root source directory:poetry installPip can also be used to automatically install HWI and its dependencies using thesetup.pyfile (which is usually in sync withpyproject.toml):pip3 install .Thesetup.pyfile can be used to install HWI and its dependencies so long assetuptoolsis also installed:pip3 install -U setuptools
python3 setup.py installDependenciesSeepyproject.tomlfor all dependencies. Dependencies under[tool.poetry.dependencies]are user dependencies, and[tool.poetry.dev-dependencies]for development based dependencies. These dependencies will be installed with any of the three above installation methods.UsageTo use, first enumerate all devices and find the one that you want to use with./hwi.py enumerateOnce the device type and device path are known, issue commands to it like so:./hwi.py -t <type> -d <path> <command> <command args>All output will be in JSON form and sent tostdout.
Additional information or prompts will be sent tostderrand will not necessarily be in JSON.
This additional information is for debugging purposes.To see a complete list of available commands and global parameters, run./hwi.py --help.  To see options specific to a particular command,
pass the--helpparameter after the command name; for example:./hwi.py getdescriptors --helpDocumentationDocumentation for HWI can be found onreadthedocs.io.Device SupportFor documentation on devices supported and how they are supported, please check thedevice support pageUsing with Bitcoin CoreSeeUsing Bitcoin Core with Hardware Wallets.LicenseThis project is available under the MIT License, Copyright Andrew Chow.
Package: hwid
HWIDExtract the `hwid` on Windows, Linux, Mac. Cross-platform using Python, native OS detection.InstallationpipinstallhwidUsageModule:importhwidprint(hwid.get_hwid())# 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'CLI:hwid
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXWhy?I have created a bunch of desktop applications for Windows to sell. I needed a way to license my applications. I decided to use the hwid of the computer to license my applications. I needed a way to get the hwid of the computer, so I created this module. It has only one purpose: getting the hwid of the computer. It is cross-platform and does not require any external dependencies.I do not recommend using this module for licensing purposes by itself. You can use it as a part of your licensing system.If you are using server-client architecture, you can send the encrypted hwid to the server and check if it is valid. It's easy to intercept the request to the server. You can checkmitmproxyfor that.If you are using a local licensing system, you can encrypt the hwid and store it in a file. Then you can check if the encrypted hwid is valid. You can usepyarmorto obfuscate your code. It will make it harder to reverse engineer your code.DisclaimerThis module is not intended to be used for malicious purposes. The author is not responsible for any damage caused by this module. Use at your own risk.
Package: hwit-core
:author:    D Haynes:contact:   tundish@thuswise.orgThis is a package from the `hwit` namespace. It provides the core library.You will need this package to generate forms, check them and parse them.`Here's What I Think`_ is a set of components for information managementon the desktop and in the cloud.`HWIT` defines a microformat which is readable both by machines andhuman beings. It carries structured data in a form which can bechecked for validity, viewed on any platform, and indexed for searching.`HWIT` makes durable the artifacts of business processes. It gives youthe flexibility to build sophisticated workflows without requiring anyIT infrastructure...  _Here's What I Think: http://hwit.org
Package: hwit-edit
:author:    D Haynes:contact:   tundish@thuswise.orgThis is a package from the `hwit` namespace. It provides a graphical editor.You will need this package to edit HWIT files on your PC desktop.`Here's What I Think`_ is a set of components for information managementon the desktop and in the cloud.`HWIT` defines a microformat which is readable both by machines andhuman beings. It carries structured data in a form which can bechecked for validity, viewed on any platform, and indexed for searching.`HWIT` makes durable the artifacts of business processes. It gives youthe flexibility to build sophisticated workflows without requiring anyIT infrastructure...  _Here's What I Think: http://hwit.org
Package: hwit-examples
:author:    D Haynes:contact:   tundish@thuswise.org..  Titling##++::==~~--''``This is a package from the `hwit` namespace. It provides example formsand templates. You will need this package when you are learning howforms are made from templates, and then how they can be customised foryour application.`Here's What I Think`_ is a set of components for information managementon the desktop and in the cloud.`HWIT` defines a microformat which is readable both by machines andhuman beings. It carries structured data in a form which can bechecked for validity, viewed on any platform, and indexed for searching.`HWIT` makes durable the artifacts of business processes. It gives youthe flexibility to build sophisticated workflows without requiring anyIT infrastructure...  _Here's What I Think: http://hwit.org
Package: hwm93
HWM93 in PythonNASA Horizontal Wind Model HWM93 in Python ≥ 3.6Works with many Fortran compilers, including:Gfortran 5, 6, 7, 8IntelifortPGIpgf90NvidiaflangInstallpip install -e .test bypytest -svUsageHWM93 can be used from the command line or as an imported Python module in other programs.
Matlab ≥ R2014b also can use HWM93.Command lineRunHWM93 -hWrite data to NetCDF (HDF5) with-ooption.import moduleimporthwm93fromdatetimeimportdatetimewinds=hwm93.run(t=datetime(2017,11,12,8),altkm=150.,glat=65.,glon=-148.,f107a=150,f107=150,ap=4)windsis anxarray.Dataset<xarray.Dataset>
Dimensions:     (alt_km: 1)
Coordinates:
  * alt_km      (alt_km) float64 150.0
Data variables:
    meridional  (alt_km) float64 4.827
    zonal       (alt_km) float64 -20.5
Attributes:
    time:     2017-11-12T08:00:00
    glat:     65.0
    glon:     -148.0If you want just a single variable, sayprint(winds.zonal.values)MatlabYou can import this Python module from Matlab ≥ R2014b as inhwm93.mNotes[Optional] Fortran-only useMost users don't need this.cdbin
cmake..
cmake--build.
ctest-Vorf2py-csrc/hwm93_sub.f-mhwm93only:gws5:ReferenceOriginal A. E. Hedin Fortran 77 HWM93code
Package: hwpapi
HwpApi여기서Tutorials을 볼 수 있습니다.Install이 패키지는 win32com을 통해 좀더 쉽게 한글 자동화를 하기 위한 패키지
입니다. 따라서, 한글 오피스가 설치된 Windows에서만 작동합니다. 리눅스나
한컴 오피스가 설치된 Mac OS에서는 작동하지 않습니다.다른 일반적인 패키지와 같이 아래 명령어를 입력하면 설치할 수 있습니다.pipinstallhwpapiHow to use기본적으로는 wi32com을 통한 한컴 오피스 자동화를 보다 쉽게 사용하기 위해
개발한 패키지 입니다.기존의 연동성을 최대한 유지하면서도 파이써닉하게 코드를 짤 수 있도록
개선하고자 하였습니다.nbdev에서 권장하는 스타일로 작성되다보니
jupyter notebook이나 jupyter lab에서는 자동완성이 잘 작동되지만, VS
Code에서는 자동완성이 작동 안할 수 있습니다.기존 코드와 연동성 비교하기회사원 코딩에 가보시면 아래와
같이 자동화 코드가 있습니다.importwin32com.clientaswin32hwp=win32.gencache.EnsureDispatch("HWPFrame.HwpObject")hwp.XHwpWindows.Item(0).Visible=Trueact=hwp.CreateAction("InsertText")pset=act.CreateSet()pset.SetItem("Text","Hello\r\nWorld!")act.Execute(pset)이 코드는 기본적으로 장황하다고 볼 만한 상황입니다. 이 코드를HwpApi를
사용하면 아래와 같이 간결하게 정리가 됨을 볼 수 있습니다.fromhwpapi.coreimportAppapp=App()action=app.actions.InsertText()p=action.psetp.Text="Hello\r\nWorld!"action.run()True이렇게 자주 사용하는 기능은 함수로 만들었습니다.app.insert_text("Hello\r\nWorld!")글자 모양을 바꾸는 것은 자주 있는 함수 입니다. win32com을 사용하면
아래와 같이 작성해야 합니다.Act=hwp.CreateAction("CharShape")Set=Act.CreateSet()Act.GetDefault(Set)Set.Item("Italic")Set.SetItem("Italic",1)Act.Execute(Set)이렇게 자주 사용되는 기능은 함수로 만들어 사용할 수 있게 했습니다.app.set_charshape(italic=True)True코드를 보시면 hwp를 세팅하는 부분이 간략해졌습니다. 또한 파라미터 설정이
파이썬 객체처럼 설정할 수 있게 변경 되어 있는 것을 볼 수 있습니다.이런 식으로 파이썬에서 사용하기 쉽게 만들었습니다.왜 HwpApi를 만들었나요?가장 큰 이유는 스스로 사용하기 위해서 입니다. 직장인으로 많은 한글
문서를 편집하고 작성하곤 하는데 단순 반복업무가 너무 많다는 것이
불만이었습니다. 이런 문제를 해결하는 방법으로 한글 자동화에 대한
이야기를 파이콘에서 보게 되었습니다. 특히 ‘회사원 코딩’ 님의 블로그와
영상이 많은 참조가 되었습니다.다만 그 과정에서 설명자료가 부족하기도 하고 예전에 작성했던 코드들을
자꾸 찾아보게 되면서 아래아 한글 용 파이썬 패키지가 있으면 좋겠다는
생각을 했습니다. 특히 업무를 하면서 엑셀 자동화를 위해 xlwings를 사용해
보면서 파이썬으로 사용하기 쉽게 만든 라이브러리가 코딩 작업 효율을 엄청
올린다는 것을 깨닫게 되었습니다.제출 마감까지 해야 할 일들을 빠르게 하기 위해서 빠르게 한글 자동화가
된다면 좋겠다는 생각으로 만들게 되었습니다.기본적인 철학은 xlwings을 따라하고 있습니다. 기본적으로는 자주 쓰이는
항목들을 사용하기 쉽게 정리한 메소드 등으로 구현하고, 부족한 부분은App.api형태로win32com으로 하는 것과 동일한 작업이 가능하게 하여 한글 api의 모든
기능을 사용할 수 있도록 구현하였습니다.메소드로 만드는 것에는 아직 고민이 있습니다. chain과 같은 형태로
여러가지 콤비네이션을 사전에 세팅을 해야 하나 싶은 부분도 있고 실제로
유용하게 사용할 수 있는 여러가지 아이템 등도 있어서 어떤 부분까지 이
패키지에 구현할지는 고민하고 있습니다.다만 이런 형태의 작업을 통해서 어쩌면 hwp api wrapper가 활성화 되어서
단순 작업을 자동화 할 수 있기를 바라고 있습니다.
Package: hwpwn
hwpwnA user-friendly tool designed to facilitate hardware security attacks. The aim is to provide a simple interface with
commands that cover multiple steps typically involved in hardware security attacks. Plus, it makes repeating attacks
or changing details very easy, so you can quickly see what happens when you tweak something.QuickstartFirst install the package with pip:$ pip install hwpwn --userThe hwpwn has multiple commands which can be called in chain, using shell pipe. Alternatively, you can write a flow
YAML file which has the commands described in textual format and run the flow with hwpwn client.Create a dummy data file:$ cat <<EOF > test.csv
t,a,b,c
1,3,3,4
2,3,4,5
3,9,2,1
EOFTo use in piped commands one can, for example:$ hwpwn data load test.csv | hwpwn data subtract a b ab --append | cat
{"x_axis": [1.0, 2.0, 3.0], "signals": [{"name": "a", "vector": [3.0, 3.0, 9.0]},
{"name": "b", "vector": [3.0, 4.0, 2.0]}, {"name": "c", "vector": [4.0, 5.0, 1.0]},
{"name": "ab", "vector": [-1.0, -2.0, 8.0]}], "triggers": [], "ts": 1}If we wanted to execute these commands in a flow, we needed to create a flow YAML, let's say,my_flow.yaml:---
options:
  scale: 1e-6
  ts: 4e-9
  description: |
    My long description. It can take a single line or multiple lines.
    Line number two.
operations:
  - data.load:
      filepath: test.csv
  - data.subtract:
      pos: a
      neg: b
      dest: ab
      append: trueNow run hwpwn with:$ hwpwn --verbose flow run test.yaml | cat
INFO: trying to load file test.csv ...
INFO: loaded 3 datapoints from test.csv.
INFO: found signal a
INFO: found signal b
INFO: found signal c
INFO: using sampling period of 4.0e-09 [s].
INFO: calculating signal subtract ab = a - b (append=True)
{"x_axis": [1.0, 2.0, 3.0], "signals": [{"name": "a", "vector": [3.0, 3.0, 9.0]}, 
{"name": "b", "vector": [3.0, 4.0, 2.0]}, {"name": "c", "vector": [4.0, 5.0, 1.0]}, 
{"name": "ab", "vector": [0.0, -1.0, 7.0]}], "triggers": [], "ts": 4e-09}I've used the--verboseflag which will make it show what is happening. If you don't pipe the output of hwpwn,
it will not show the final data to avoid flooding the console. Thus, I've used a pipedcatcommand.DocumentationThe documentation is built with Sphinx and deployed in Github Pages. The URL ishttps://jemos.github.io/hwpwn.Final WordsThis project is currently in its early stages of development, and as such, it may not be as comprehensive or
polished as desired. However, it is a work in progress, and future enhancements are expected to improve
its functionality and usability in hardware security analysis. Users are encouraged to provide feedback
and contribute to the project's growth and refinement.Next Features...Things I'd like to add in the future...scopecommands for interacting with USB osciloscopesspacommands for simple power analysisdpacommands for differential power analysiscpacommands for correlation power analysis
Package: hwpx
파이썬-아래아한글 자동화 모듈pywin32 패키지를 활용하여아래아한글을 다루는hwpx 모듈을 만들어보았습니다.hwpx 모듈 안에는 아직 Hwp라는 클래스만하나 정의해놓았습니다.해당 클래스 안에 HwpAutomation에서 제공하는모든 저수준 API메서드의 사용법과파라미터, (필요한 경우) 예시코드 등을docstring으로 추가하는 중입니다.틈틈이 유용한 커스텀 메서드를추가할 예정입니다.아직은 오픈소스라고 부르기엔다소 초라한 수준이지만,hwp 문서업무 자동화에 많이 쓰이는 패턴들을추가하다보면?나름 유용한 모듈이 되지 않을까생각해봅니다.두서없이 디스크립션을 적어보았습니다.행복한 하루 되세요!일코, 2023. 11. 30.사용법fromhwpximport*# 아래아한글이 바로 실행됨.# 편의를 위한 커스텀 인스턴스는 hwpx로,# 기존 win32com (로우레벨) 인스턴스는 hwp로 생성됨.# (직관적이지 않은 부분이 있음을 인정함..)# (한/글 스크립트매크로와의 호환을 위해 어쩔 수 없었음. 향후 개선 예정)# 기존에 한/글 프로그램이 열려 있는 경우 해당 문서를 제어# 텍스트 삽입hwpx.insert_text("Hello world!")# 위의 코드는 아래처럼 hwp 인스턴스로도 실행 가능pset=hwp.HParameterSet.HInsertTexthwp.HAction.GetDefault("InsertText",pset.HSet)pset.Text="Hello world!"hwp.HAction.Execute("InsertText",pset.HSet)# (ver.0.4.0 이상에서는 스크립트매크로 방식으로 사용 가능)HAction.GetDefault("InsertText",HParameterSet.HInsertText.HSet)HParameterSet.HInsertText="Hello world!"HAction.Execute("InsertText",HParameterSet.HInsertText.HSet)# 다른이름으로 저장hwpx.save_as("./helloworld.hwp")# 한/글 종료hwpx.quit()이밖에 구체적인 hwpx 모듈 사용법은https://martinii.fun/블로그에틈틈이 포스팅으로 남기겠습니다.방문해 주셔서 감사합니다.행복한 하루 되세요!!
Package: hwpy
install(python2.7 and python3.6)lastest psutil maybe required# yum install -y gcc python-devel dmidecode
# pip install -U setuptools 
# pip install -U psutil# pip install hwpyusage# python -m hwpyfrom hwpy import info
info.main()
info.hwlistinfo.cpu
info.net    
info.disk
info.part   
info.host
info.mem
Package: hws
Hartmann Wavefront software (HWS)The HWS is software designed to process and operate the Hartmann Wavefront Sensing system at the LIGO and Virgo detectors.As of 19th May 2022 (v2.1.0) the HWS source code was made open source by Peter Veitch.Please direct packaging questions todaniel.d.brown@adelaide.edu.au.Fixing HWSChanges should be submitted via merge requests. Merge requests should pass all tests and
requires approval. Version number must be bumped up manually. Each time a new a Wheel package
version is needed the version number must be bumped manually insetup.py.Releasing new version to PypiGeneral advice can be found for releasing a package here:https://packaging.python.org/en/latest/tutorials/packaging-projectsrm -rf dist/hws-* # delete all existing distributions that have been built
python -m build
python -m twine upload dist/*This will require access to a pypi account hosting the project.
Package: hwtest
Setuppip install hatchRunning Testshatch run covRunning Exampleshatch run examples/network.pyUsing InfluxDBhwtestincludes an InfluxDB telemetry logger. If you choose to use this, make sure you have InfluxDB configured by following thesetup guide. Be sure to install version 2+, as that's the API the logger uses.You'll also need to create an org and access token inside the InfluxDB UI (accessible viahttp://localhost:8086/if running locally). The logger creates the InfluxDB client usingenvironment variablesfor configuration. Specifically, you'll need to set at leastINFLUXDB_V2_ORGandINFLUXDB_V2_TOKEN.To test your configuration, run:hatch run examples/influxdb.pyThis should write 10 datapoints to the bucket namednetwork-example.You can also try the subprocess driver example, which runs the same test as theinfluxdb.pyexample, but attempts to log telemetry at 50 Hz in the background while running the test.DistributinghwtestYou may need to distribute a copy ofhwtestto customers so they can run tests against your hardware. In order to create packages you can distribute, runhatch buildThis will create ahwtest-*.whlfile under adist/directory. This will include just the source code, not any examples, tests, or documentation. This.whlfile can be installed on another machine withpip install filename.whl. You don't needhatchto use the.whlfile.
Package: hwtGraph
hwtGraphLibrary for conversion of HWT hardware representation to graph formats for visualization purposes.Usesudo pip3 install hwtGraphor download this repo and runpython3 setup.py installto install this library.FeaturesConvert HWT hardware description toELK jsonfor visualization.suppor for additional graph transofrmations in all transformation phases (conversion is specified as sequence of transofrmations and user can modify it)Similar softwaremyhdl2dot
Package: hwtSimApi
hwtSimApiThis library contains an implementation of DES (Discrete Event Simulation) for communication with RTL simulators and a backup RTL simulator written in python.
In addition there is a UVM like environment with some example interface agents.
This means that this library can be used to handle synchronization, data exchange and verification related staff.
The simulation is an object without any special requirements which greatly simplifies automatization and debugging.examples of usage inhwtLiband otherHWTbased projectsInstallationrunpython3 setup.py install --useror from gitgit clone https://github.com/Nic30/hwtSimApi.git && cd hwtSimApi && python3 setup.py install --userSimilar softwarecocotb- there is also WIP version of cocotb-verilator integrationcocotb-coverage- Functional Coverage and Constrained Randomization Extensions for Cocotbchisel-testersfiresimfli- using ModelSim Foreign Language Interface for c – VHDLkratos- hardware generator/simulatormidaspy-hpi- Python/Simulator integration using procedure callsPyVSCPython package providing a library for Verification Stimulus and Coverageuvm-python- cocotb based python UVMPySpice- Python binding for Ngspice / Xyce Simulators
Package: hx711
HX711DescriptionThis library allows to drive a HX711 load cess amplifier with a Raspberry Pi. It just provides the capabilities:to set channel an gain andto read raw valuesThis package requires RPi.GPIO to be installed in Python 3.Getting startedJust install bypip3 install HX711. A basic usage example is given below:#!/usr/bin/python3fromhx711importHX711try:hx711=HX711(dout_pin=5,pd_sck_pin=6,channel='A',gain=64)hx711.reset()# Before we start, reset the HX711 (not obligate)measures=hx711.get_raw_data(num_measures=3)finally:GPIO.cleanup()# always do a GPIO cleanup in your scripts!print("\n".join(measures))LicenseFree software: MIT licenseCreditsI usedhttps://github.com/gandalf15/HX711/as base.This package was created with Cookiecutter_ and theaudreyr/cookiecutter-pypackage_ project template.
Package: hx711-gpiozero
HX711 driver libraryDescriptionThis library allows to drive a HX711 load cess amplifier with a Raspberry Pi by usinggpiozerolibrary.to set channel and gainto read raw valueThis package requiresgpiozeroto be installed in Python 3.Examplefromhx711_gpiozeroimportHX711fromtimeimportsleepspi=HX711()print("Initiatin ...")init_reading=spi.valuesleep(1)input("Put a known mass on the scale, then press `enter`.")try:rel_weight=float(input("What is the weight of the known mass?\n"))exceptValueErroraserr:print(err)print("(The input of weight can only be numbers)")exit(1)rel_reading=spi.valuescale_ratio=rel_weight/(rel_reading-init_reading)sleep(1)whileTrue:weight=(spi.value-init_reading)*scale_ratioprint(weight)sleep(1)
Package: hx711-micropython-impementation
hx711-mpythonMicropython driver for the HX711 24-Bit Analog-to-Digital ConverterLatest version supports:retrieving data from the channel 'A' with gain 128 and 64,
the channel 'B' with gain 32 in a raw form and a form
converted from the two's complement.sending "power off" sequence to switch device to the power-saving mode.sending "power on" sequence with the gain saved before the "power off".checking if the device is ready for the data retrieval.Example for the ESP8266:Refer to the example folder. It can permorm tare and set a ratio to change the raw input.
D_OUT pin is connected to the GPIO 5PD_SCK pin is connected to the GPIO 4Using internal HX711 oscillator, so ESP8266's frequency is set to 160000000from scales import Scales

scale = Scales(d_out=4, pd_sck=5)
scale.reset()
scale.tare()
while True:
    if scale.is_ready():
        val = scale.stable_value()
        print(val)
        sleep_us(500)