Saravanan666/pypi-org huggingface dataset:
Package: pyobservable
pyobservableDescriptionpyobservableprovides a simple event system for Python with weak reference support.
This ensures that the event handlers do not stay in memory when they aren't needed anymore.Installationpyobservablecan be installed usingpip:$ pip install pyobservableAlternatively, you can download the repository and run the following command from within the source directory:$ python setup.py installUsageFor a quick start, a minimal example is:frompyobservableimportObservableobs=Observable()obs.add_event('foo')obs.add_event('bar')# Event keys can be any object that is hashableevent=object()obs.add_event(event)# Binding with decorator usage@obs.bind('foo')deffoo_handler(foo_number):print('foo_handler called:',foo_number)# Binding with function usagedefbar_handler(bar_list):print('bar_handler called:',bar_list)obs.bind('bar',bar_handler)obs.notify('foo',1)obs.notify('bar',[1,2,3])The rationale behind the requirement to add events before binding to them is to ensure the code is less error-prone from mistyping event names.
Also, if a duplicated event key is present,ValueErrorwill be raised.However, the next example shows that event registration can be simplified using the special_events_attribute:frompyobservableimportObservableclassEventEmitter(Observable):_events_=['foo',2]deftriggers_foo(self):self.notify('foo',1,2,3)event_emitter=EventEmitter()@event_emitter.bind('foo')deffoo_handler(*args):print(*args)event_emitter.triggers_foo()Also note that_events_can be defined multiple times in an inheritance tree.Observablescans the MRO for this attribute and adds every event it finds.
Again, aValueErrorwill be raised if a duplicate event key is present.Finally, here's an advanced and clean example usingenum:fromenumimportEnum,autofrompyobservableimportObservableclassEventType(Enum):FOO=auto()BAR=auto()classEventEmitter(Observable):_events_=EventType# Enums are iterabledeftriggers_foo(self):self.notify(EventType.FOO,'foo happened!')classEventListener:defon_foo(self,message):print("Here's a message from foo:",message)event_emitter=EventEmitter()event_listener=EventListener()event_emitter.bind(EventType.FOO,event_listener.on_foo)# pyobservable also supports bound methodsevent_emitter.triggers_foo()For more information, please refer to theObservableclass docstrings.TestsThe simplest way to run tests:$ python tests.pyAs a more robust alternative, you can installtox(ortox-condaif you useconda) to automatically support testing across the supported python versions, then run:$ toxIssue trackerPlease report any bugs and enhancement ideas using theissue tracker.Licensepyobservableis licensed under the terms of theMIT License(seeLICENSE.txtfor more information).
Package: py-obsidianmd
py-obsidianmdA python library for modifyingObsidiannotes in batch.See thefull documentation:warning:Consider backing up your vaultbefore using the library, to avoid any risk of data loss.Presentation videoQuickstartpipinstallpy-obsidianmdfrompathlibimportPathfrompyomdimportNotesfrompyomd.metadataimportMetadataTypepath_dir=Path('/path/to/obsidian/folder')notes=Notes(path_dir)You can test the library on thisexample vaultmove metadata between frontmatter and inlinenotes.metadata.move(fr=MetadataType.FRONTMATTER,to=MetadataType.INLINE)notes.update_content(inline_inplace=False,inline_position="top",inline_tml="standard")#type: ignorenotes.write()regroup inline metadata inside a calloutnotes.update_content(inline_inplace=False,inline_position="top",inline_tml="callout")#type: ignorenotes.write()add and remove metadatanotes.filter(has_meta=[("tags","type/book",MetadataType.INLINE)])notes.metadata.add(k="type",l="[[book]]",meta_type=MetadataType.INLINE)notes.metadata.remove(k="tags",l="type/book",meta_type=MetadataType.INLINE)notes.update_content(inline_inplace=False,inline_position="top",inline_tml="callout")#type: ignorenotes.write()LicenseBSD 3ContributingContributions are welcome ! Different ways you can contribute:Write an issue: report a bug, suggest an enhancement, ...Submit a pull requestto solve an open issueFor more details, see thecontribution guidelines.SupportIf you found this library useful and wish to support it's development, you can do so using the links below (paypal or Ko-fi). Thanks a bunch !
Package: pyobsplot
pyobsplotpyobsplotallows to useObservable Plotto create charts inJupyternotebooks,VSCodenotebooks,Google ColabandQuartodocuments. Plots are created from Python code with a syntax as close as possible to the JavaScript one.It allows to do things like :importpolarsasplfrompyobsplotimportPlotpenguins=pl.read_csv("https://github.com/juba/pyobsplot/raw/main/doc/data/penguins.csv")Plot.plot({"grid":True,"color":{"legend":True},"marks":[Plot.dot(penguins,{"x":"flipper_length_mm","y":"body_mass_g","fill":"species"}),Plot.density(penguins,{"x":"flipper_length_mm","y":"body_mass_g","stroke":"species"})]})Installation and usagepyobsplotcan be installed withpip:pipinstallpyobsplotFor usage instructions, see thedocumentation website:Seegetting startedfor a quick usage overview.Seeusagefor more detailed usage instructions.If you just want to try this package without installing it on your computer, you can open an introduction notebook in Google Colab:Features and limitationsFeatures:Syntax as close as possible to the JavaScript oneTwo renderers available:widget, which generates plots as Jupyter widgets, andjsdom, which generates SVG or HTML outputsPandasandpolarsDataFrame and Series objects are serialized usingArrowIPC format for improved speed and better data type conversionsWorks offline, no iframe or dependency to Observable runtimeCaching mechanism of data objects if they are used several times in the same plotCustom JavaScript code can be passed as strings with thejsmethodPythondateanddatetimeobjects are automatically converted to JavaScriptDateobjectsWorks with Jupyter notebooks and Quarto HTML documents. Plots without legends are also supported in PDF and docx outputs with thejsdomrenderer.Plots can be saved to SVG or HTML filesLimitations:Plot interactions (tooltips, crosshair...) are not available with thejsdomrenderer (https://github.com/juba/pyobsplot/issues/16).Plots with legends don't work in Quarto in formats other than HTML. (https://github.com/juba/pyobsplot/issues/9)Very limited integration with IDE (documentation and autocompletion) for Plot methods. (https://github.com/juba/pyobsplot/issues/13)CreditsObservable Plot, developed byMike BostockandPhilippe Rivièreamong others.The widget is developed thanks to theanywidgetframework.Some code from thejsdomrenderer has been adapted fromaltair_saver.The documentation website is generated byQuarto.
Package: pyocc
PyOCCA wrapper for OpenCC (The Chinese convert solution)License: Apache-2.0UsagefrompyoccimportPyOCCocc=PyOCC()print(occ.configs)# => ['hk2s', 's2hk', 's2t', 's2tw', 's2twp', 't2hk', 't2s', 't2tw', 'tw2s', 'tw2sp']print(occ.translate('中国','s2t'))# => 中國CreditsThis package was created withCookiecutterand thePyPackageTemplateproject template.History0.0.2 (2018-06-04)First release on PyPI.
Package: pyoccad
pyoccadA geometrical modeler based on the wrapping ofocct(OpenCascade) open-source CAD package and helpers for a simplified use.Historyv0.5.02022-09-13BREAKINGFix import errors due to API changes inOCCT7.6release (thus alsopythonocc-core) (MR#10)remove deleted handlerssupport API change to iterate overPoly_Triangulationnodesset dependency topythonocc-core>= 7.6v0.4.22021-08-31Set dependency topythonocc-core>= 7.4, instead of exactly 7.4.0 (MR#2)New factorypyoccad.create.CreateCylinder(MR#3)Replacecondabymambain CI scripts (MR#4)Minor refactoring pass (MR#5)v0.4.12021-03-19First open source release.
No code change compared to v0.4.0Unreleasedv0.4.02020-11-09ChangedRename pyoccad.types into pyoccad.typingUpdate projects AUTHORS, LICENSE filesv0.4.0.dev42020-09-08Changedfix camera_position not configurable in 2d pythreejs rendererv0.4.0.dev32020-09-08Changedpythreejs is now an optional dependency for pyoccad.render modulev0.4.0.dev22020-09-04Addedbuild the documentation using SphinxChangeduse pythonocc-core instead of pyoccad-core to take benefit of occt 7.4.0minor internal changes to fit pyoccad-core 7.4.0v0.4.0.dev12020-09-01Changedmajor performance improvement of ThreeJS renderer for Jupyterrefactoring (includes major API changes)improve code coveragev0.4.0.dev02020-07-30Changedmajor refactoring and API changes (add tests, create factories, add docstrings)v0.3.0rc12020-02-05Changedfix dependency and tests errors on rendererv0.3.0rc02020-02-05Addedvarious helpers for point, line, curve, surface, transformationdocstrings and unit tests for cpp and python codev0.2.52020-01-17Fixedlattice in jupyter rendererv0.2.42020-01-17Changedimproved geometry viewer with more customization, docs and testsv0.2.32019-12-10Changedfix pythreejs renderers due to import erroradd capability to disable automatic renderThreeJsPy show as a class constructor argumentv0.2.22019-12-10Changedfix pythreejs renderers due to import collision in renderThreeJsPy (remove import *)v0.2.12019-12-10Changedfix import error on cpp helper on poly explore (imported name not consistent with binaries)v0.2.02019-11-27Addedrolling ball (bi-tangent circle) algorithmGordon surface algorithmrefactoring and API changes in thecreatetoolboxChangedimprove and unify the docstring documentationv0.1.0.dev12019-10-17Added1d interpolationsewing capability in healing toolboxnotebook examples on casingsdocstringsv0.1.0.dev02019-09-18Addedpackage creation by importing/refactoring helpers from archivedpyoccpackage and adding new helpers
Package: pyoccur
pyoccurPython Occurrence Operations on ListsAbout PackageA simple python package with 3 functionshas_dup()get_dup()remove_dup()Currently the duplicate operation functions can operate on list of elements with below data typesstrintfloatdictlistpandas.DataFrameExamplefrom pyoccur import pyoccur
l1 = ['abc',123,'def','abc',22,10]
l2 = [{'abc':100},'wee',123,{'abc':100},'abc',123,{'a':1,'b':2}]
pyoccur.has_dup(l1)
# Output: True
pyoccur.get_dup(l2)
# Output: [{'abc':100},123]ContributingFeel free to raise PR to add your contributionsDo raise issues if found any, in the Github Issues
Package: pyocd-bitbang
pyOCD RemoteBitbang DebugProbe pluginThis pyOCD plugin provides a debug probe that allows connection to a remote bitbang interface
via a TCP socket.  It is design to be used with targets running in simulation.  The remote
end must provide a TCP server that accepts a socket connection.  The debug probe sends an ASCII
encoding of the bitbang interface.Installation$ pip install pyocd-bitbangBackgroundThis plugin is designed to be used to connect, via SWD, to a Verilator model of a Cortex-M based MCU.
This is the pyOCD equivalent to the OpenOCD JTAG remote_bitbang interface, and in fact, uses the same
ASCII encoding.Implementation DetailDebugProbeThe classbitbang_probe:RemoteBitbangProbeimplements the minimum subset required by the
pyOCDpyocd.probe.debug_probe:DebugProbeclass.  Any SWD commands are translated to a series of
read and write calls that drive the remote SWD interface via a TCP socket.  The protocol used is the
same as defined in the OpenOCDremote_bitbangspecification.  Each character sent over the socket corresponds to a request
to set the bus to a particular state or to read the value currently being driven on SWDI.Unlike debug probes connected via USB, pyOCD cannot auto-detect the probe.  Instead, a unique ID must be
specified when launching pyOCD that specifies the probe to use and the IP address and port to use.  See below.TCP Server and SV DPIIn addition to this plugin, the testbench must implement a TCP server to which the probe connects as well
as a DPI interface that drives the SWD pins of the DUT.  A good example of such an implementation can be
found in the OpenTitan repositoryhere.Modifying the above example to drive a SWD interface is fairly simple.  Instead of the 3 bit Write encoding
driving {tck, tms, tdi}, they should drive {swclk, swdoen, swdo}.The following snippet shows the character decoding in the main loop of the DPI C function:// parse received command byteif(cmd>='0'&&cmd<='7'){charcmd_bit=cmd-'0';ctx->swclk=(cmd_bit>>2)&0x1;ctx->swdoen=(cmd_bit>>1)&0x1;ctx->swdo=(cmd_bit>>0)&0x1;}elseif(cmd=='R'){act_send_resp=true;}elseif(cmd=='Q'){act_quit=true;}else{fprintf(stderr,"SWD DPI Protocol violation detected: unsupported command '%c'\n",cmd);exit(1);}Inside theremote_bitbang:BitBangerclass the character encoding for writing a zero or one
on the bus as well as a read is defined:ZERO=b'62'ONE=b'73'READ=b'40R'UsageAssuming you have pip installed the pluggin, you should be able to connect to the target using:$ pyocd commander -u remote_bitbang:localhost:5555which would connect to TCP port 5555 on localhost.  No further configuration is necessary.
Package: pyocd-pemicro
Python PyOCD_PEMicro plugin debug probes supportThe simple PyOCD debug probe plugin for PEMicro debug probes - Multilink/FX, Cyclone/FX. The purpose of this plugin is
keep separately this support because is using PyPemicro package which is designed for Python 3.x without backward compatibility for Python2.x.
The PyOCD use this support only with Python 3.x and higher, for Python 2.x the PeMicro won't be supported.The package is tested only with Multilink/FX and Cyclone/FX probes on NXP ARM microcontrollers.The PEMicro company helps with this development, so big Thanks to them (www.pemicro.com).Author: Petr Gargulak,petr.gargulak@nxp.com(NXP 2020,www.nxp.com)NoteThis package is just plugin to full PyOCD package - It doesn't work standalone!Dependenciessix
pypemicro
logging
timeInstallationDirectly fromwww.pypi.org:$pipinstallpyocd_pemicro
Package: pyocd-remote
pyocd_remoteRemote execution wrapper forPyOCD.This tool runspyocdon a remote SSH server and does additional copying / tunneling, so it looks likepyocdis running locally.
Usage:pyocd_remote user@host:port [--cmd pyocd_executable] [pyocd_args ...]PrerequisitesFor this tool to work, the local SSH client needs to be authorized at the remote server using a public key, and the remote server needs to be in the list of known hosts.Examplespyocd_remote user@host:port erase --chipErases the chip connected to the remote host.pyocd_remote user@host:port flash image.binCopiesimage.binto the remote host, then flashes it there.pyocd_remote user@host:port gdbserver --port 50000Starts a gdbserver on the remote host and creates a tunnel, so it looks like a local gdbserver to the debugger.
Package: pyocd-wireless
[![](https://img.shields.io/pypi/v/pyocd-wireless.svg)](https://pypi.org/project/pyocd-wireless/)A wireless programming and debugging tool based on pyocdpyocd-wirelessuses [Pitaya Go](https://github.com/makerdiary/pitaya-go) as a Bluetooth LE debug probe,
which is just like a CMSIS-DAP probe using BLE instead of USB.## Requirements
+ [pyocd](https://github.com/mbedmicro/pyOCD/)
+ [bleak](https://github.com/hbldh/bleak)
+ Python 3.6 if using Windows 10 (version 16299 or greater)## Install` pip installpyocd-wireless`## Run`pyocd-wireless-h`
Package: pyocf
pyocfpyocfis a Python library to read and createOpen Cap Table Formatfiles.Documentation is available atRead the Docs.ContributorsLennart Regebro,lennart.regebro@fidelity.comChanges1.0.2 (2023-10-24)Latest versions of Pydantic raises errors, temporarily restrict to 1.x.1.0.1 (2023-07-06)Made all properties have a Field with a description, to improve documentation.
No actual schema changes.1.0.0 (2023-05-10)Added all the classes to api.py, so you can more easily import them.1.0b1 (2023-03-15)First beta
Package: pyocfagent
This is a Python OCF Cluster Resource Agent Framework for implementing OCF Resource Agents in Python. It allows you to implement a OCF compatible resource agent for Pacemaker with pure Python logic. Most Resource agents are implemented as Shell Scripts (see Debian Package resource-agents for examples). The pyocfagent allows you to implement such resource agents directly in Python. The framework creates resource agent meta-data on the fly from your source code by introspection of your derived Pyhon class.
Package: pyocient
Ocient Database Python APIThis python database API conforms to the Python Database API
Specification 2.0 and can be used to access the Ocient database.This module can also be called as a main function, in which case
it acts as a CLI for the database.When called as main, it a connection string in DSN (data source name)
format, followed by zero or more query strings that will be executed.
Output is returned in JSON format.The Ocient DSN is of the format:ocient://user:password@[host][:port][/database][?param1=value1&...]userandpasswordmust be supplied.hostdefaults to localhost,
port defaults to 4050, database defaults tosystemandtlsdefaults
tounverified.Currently supported parameters are:tls: Which can have the values "off", "unverified", or "on"force: Which can have the values "true"handshake: Which can have the value "cbc", "gcm", or "sso"For the handshake protocols, "cbc" (Cipher Block Chaining) denotes a previous password encryption protocol which
should be avoided. "gcm" (Galois/Counter Mode), which pyocient will default to, is recommended. If single sign
on is desired, then "sso" should be used.Release notes are available athttps://github.com/ocient/pyocient_release/
Package: pyocker
DescriptionDocker images haveBase Images, and a Base Image also has another
Base image.You may want to re-build ImageA before building ImageB which will be
built based on ImageA.Pyockerenables static
definition of Dockerfile dependencies and selective build/push of docker
images.TODO[ ] Enable use of Dockerfiles in user-selected directories for each
image[ ] Integration withdockerfile_composer[ ] Registry authentication[ ] Check if actual dependency described in Dockerfiles match
dependency definitions[ ] Add comments[ ] Loggin into filesRequirementsDockerInstallationpip install pyockerUsageBuildpyocker build --file docker-dependency.yml            # Basic
pyocker build --file docker-dependency.yml --dry-run  # Dry-RunOptionsUsage: pyocker build [OPTIONS]

Options:
  --file TEXT          Path to config file [default="docker-dependency.yml"]
  --verbose / --quiet  Make lots of noise or not [default=verbose]
  --dry-run            Dry Run
  -h, --help           Show this message and exit.Config# Built-in variables:
# * $date - current date in format `yyyy.mm.dd`
---
registry:                 # name of public|private registry
images:                   # Required
  -
    name: fluentd         # Required
    tags:                 # Tags to build with
      - latest
      - production
      - development
    use_cache: yes        # Disable `--no-cache` option  [default: yes]
    build: no
    push: no
  -
    name: my-image
    tags:
      - $date-dev         # Using a built-in variable
    use_cache: no
    build: yes
    push: yes
    dependencies:         # Images required by `my-image`
      -
        name: base-image1
        tags:
          - latest
        use_cache: yes
        build: yes
        push: no
      -
        name: base-image2
        tags:
          - latest
        use_cache: yes
        build: yes
        push: noComposeUpcoming.
Package: pyoclk
OpenCL Kernel Python WrapperInstallRequirementsOpenCL GPU hardwarenumpycmake(if compile from source)Install from wheelpipinstallpyoclkor download wheel fromreleaseand installCompile from sourceClone this repoclone by httpgitclone--recursivehttps://github.com/jinmingyi1998/opencl_kernels.gitwith sshgitclone--recursivegit@github.com:jinmingyi1998/opencl_kernels.gitInstallcdopencl_kernels
pythonsetup.pyinstallDO NOT move this directory after installUsageKernel File:a file namedadd.clkernelvoidadd(globalfloat*a,globalfloat*out,intint_arg,floatfloat_arg){intx=get_global_id(0);if(x==0){printf(" accept int arg: %d, accept float arg: %f\n",int_arg,float_arg);}out[x]=a[x]*float_arg+int_arg;}Python CodeOOP Styleimportnumpyasnpimportoclka=np.random.rand(100,100).reshape([10,-1])a=np.ascontiguousarray(a,np.float32)out=np.zeros(a.shape)out=np.ascontiguousarray(out,np.float32)runner=oclk.Runner()runner.load_kernel("add.cl","add","")timer=oclk.TimerArgs(enable=True,warmup=10,repeat=50,name='add_kernel')runner.run(kernel_name="add",input=[{"name":"a","value":a,},{"name":"out","value":out,},{"name":"int_arg","value":1,"type":"int"},{"name":"float_arg","value":12.34}],output=['out'],local_work_size=[1,1],global_work_size=a.shape,timer=timer)# check resulta=a.reshape([-1])out=out.reshape([-1])print(a[:8])print(out[:8])Kernel Benchmarkwrite a config likebench_add.yamlrunpython -m oclk benchmark -f examples/bench_add.yamlExamplepython-moclkbenchmark-fexamples/bench_add.yamloutput:[Timer bench_add.add] [CNT: 1] [AVG: 0.539ms] [STDEV 0.000ms] [TOTAL 0.539ms]
[Timer bench_add.add_constant] [CNT: 1] [AVG: 0.576ms] [STDEV 0.000ms] [TOTAL 0.576ms]
[Timer bench_add.add_batch] [CNT: 1] [AVG: 0.150ms] [STDEV 0.000ms] [TOTAL 0.150ms]python-moclkbenchmark-fexamples/bench_add.yaml-stableoutput:benchmark results             
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ timer name             ┃   avg time(ms) ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ bench_add.add          │ 0.538525390625 │
│ bench_add.add_constant │ 0.581396484375 │
│ bench_add.add_batch    │ 0.149169921875 │
└────────────────────────┴────────────────┘python-moclkbenchmark-fexamples/bench_add.yaml-sjson-obench_add.jsonoutput to json filebench_add.json[{"name":"bench_add.add","time(ms)":0.54248046875},{"name":"bench_add.add_constant","time(ms)":0.5767089843750001},{"name":"bench_add.add_batch","time(ms)":0.15048828125000002}]Kernel Tunegiven a OpenCL kernel fileadd.clrunpython -m oclk new tune add, then generate a new filetune_add.pyedittune_add.pyrunpython -m oclk tune -f tune_add.py -o add_tune_result.jsonresults are stored inadd_tune_result.jsonExamplepython-moclktune-fexamples/tune/tune_add.py-k3then outputoutput.json[{"name":["examples.tune.tune_add","AddTuner"],"k":3,"topk_results":[{"kwargs":{"local_work_size":[512],"vector_size":4,"tile_size":4,"method":"naive"},"time_ms":0.67691162109375},{"kwargs":{"local_work_size":[128],"vector_size":4,"tile_size":4,"method":"naive"},"time_ms":0.6769140625},{"kwargs":{"local_work_size":[64],"vector_size":4,"tile_size":4,"method":"naive"},"time_ms":0.677001953125}]}]
Package: py-ocpi
IntroductionThis Library is a Python implementation of the Open Charge Point Interface (OCPI)Getting StartedInstallationinstall Py-OCPI like this:pipinstallpy-ocpiHow Does it Work?Modules that communicate with central system will use crud for retrieving required data. the data that is retrieved from central system may
not be compatible with OCPI protocol. So the data will be passed to adapter to make it compatible with schemas defined by OCPI. User only needs to
modify crud and adapter based on central system architecture.Examplehttps://github.com/TECHS-Technological-Solutions/ocpi/blob/830dba5fb3bbc7297326a4963429d7a9f850f28d/examples/v_2_2_1.py#L1-L205DocumentsCheck theDocumentationLicenseThis project is licensed under the terms of the MIT license.
Package: pyoctave
PyOctavePyOctave is a simple python wrapper for running octave code from python.frompyOctaveimportOctavewithOctave()asoct:oct.zeros(3)# returns array([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]])See docstring ofpyOctave.Octavefor more examples.Inspired byhttps://github.com/blink1073/oct2py.