Saravanan666/pypi-org huggingface dataset:
Package: pyswan
Pyswanis a Python library that offers a sensible and human-friendly approach to creating, manipulating, formatting and converting dates, times and timestamps. It implements and updates the datetime type, plugging gaps in functionality and providing an intelligent module API that supports many common creation scenarios. Simply put, it helps you work with dates and times with fewer imports and a lot less code.Quick StartInstallationTo install Pyswan:$pipinstall-UpyswanExample Usage>>>importpyswan>>>pyswan.digitize(u"梁山一百零八好汉")'梁山108好汉'>>>pyswan.digitize("今天是周日")'今天是周7'>>>pyswan.parse('十二点三十分',dim=['time','number'])"[{'type': 'time', 'body': '12点30分', 'value': '2022-01-09 12:30:56'}, {'type': 'number', 'start': 0, 'end': 2, 'value': '12'}, {'type': 'number', 'start': 3, 'end': 5, 'value': '30'}]">>>pyswan.parse('六加十三除以2再乘八等于多少',dim=['equation'])"[{'type': 'equation', 'start': 0, 'end': 8, 'value': '6+13/2*8'}]">>>pyswan.parse('徐汇区虹漕路461号58号楼5楼',dim=['place'])"[{'type': 'place', 'province': '上海市', 'city': '市辖区', 'area': '徐汇区', 'code': '310104'}]"
Package: pyswarm
Thepyswarmpackage is a gradient-free, evolutionary optimization package
for python that supports constraints.What’s NewIn this release, we’ve added Python3 compatibility.RequirementsNumPyInstallation and downloadSee thepackage homepagefor helpful hints relating to downloading
and installing pyswarm.Source CodeThe latest, bleeding-edge, but working,codeanddocumentation sourceare
availableon GitHub.ContactAny feedback, questions, bug reports, or success stores should
be sent to theauthor. I’d love to hear from you!LicenseThis package is provided under two licenses:TheBSD LicenseAny other that the author approves (just ask!)ReferencesParticle swarm optimizationon Wikipedia
Package: pyswarmsdk
pyswarmSDK is an active light-weight MDA-style code-generator for model-driven development (MDD) of database-centric n-tier server applications. Easily customizable business-logic with Python & PostgreSQL. Applications are modeled in UML 2.0 / XMI 2.1 (XML)(UPDATE: pyswarmSDK is a prototype built by the Aeonic project)
Package: pySWEETCat
A pure-Python package to download data fromSWEET-Cat.This small package was developed as an exercise in a Python course (seeCONTRIBUTORS).
It downloads all the data from the SWEET-Cat online catalogue of stellar parameters
and builds a (custom) dictionary with each column.
It is a pure-Python package with no extra dependencies (see below).How to useInstall it from pip (pySWEETCathas no extra depencies)pip install pySWEETCatand it’s ready to use from PythonimportpysweetcatpySWEETCathas one simple function,get_data(),
which downloads the data from the online archive and returns it in a dictionary.>>>data=pysweetcat.get_data()Downloading SWEET-Cat data
Saved SWEET-Cat data to $HOME/.pysweetcat/SWEET_cat.csv
Data in `SWEET_cat.csv` is recent.
There are 25 columns with 2627 entries each in `SWEET_cat.csv`where$HOMEwill  be your home directory.
The second time you callget_data()it will check if the data was downloaded recently,
and only conditionally download it again.>>>data=pysweetcat.get_data()Data in `SWEET_cat.csv` is recent.
There are 25 columns with 2627 entries each in `SWEET_cat.csv`Now,datais (basically) a Python dictionary with the each column as keys.
But it has a couple extra methods and properties. For exampledata.size2627returns the number of values in each column.The columns can be accessed as in a normal dictionary,
as indata['feh']# stellar metallicitydata['name']# name of the starand both of these will workdata['σ_vmag']data['sigma_vmag']Also, to drop the NaN values in a column (for some columns there will be quite a few)
we can usedata['teff_nonan']np.isnan(data['teff']).any()# Truenp.isnan(data['teff_nonan']).any()# Falsewhich allows us to more easily do histograms of the values.Finnally, the.to_numpy(inplace=True)method converts all the columns to
numpy arrays, either in place or not (this is the only function inpySWEETCatthat requires numpy).LicenseCopyright 2018 João Faria.pySWEETCatis free software made available under the MIT License. For
details see theLICENSEfile.
Package: pysweet-func
Whypysweet?Consider the following variants
of the same logic:acc=[]forxinrange(10):y=x+1ify%2==0:acc.extend([y,y*2])acc=[zforyin(x+1forxinrange(10))forzin[y,y*2]ify%2==0]fromitertoolsimportchainacc=list(chain.from_iterable(map(lambdax:[x,x*2],filter(lambdax:x%2==0,map(lambdax:x+1,range(10)),),)))The imperative style
can grow complex as requirements evolve;The comprehension style
can get complicated when nested;The functional style
is not very readable in Python.In JavaScript, the same logic can be written:acc=[...Array(10).keys()].map(x=>x+1).filter(x=>x%2===0).flatMap(x=>[x,x*2])Can we write analogous code in Python?Now you can withpysweet!frompysweetimportIterable_acc=(Iterable_(range(10)).map(lambdax:x+1).filter(lambdax:x%2==0).flat_map(lambdax:[x,x*2]).to_list())pysweetalso offers many other similar features.pysweetis:lightweight, with around 100 lines of code;mostly syntactic sugar, so it is
performant, easy to debug, and easy to learn;successfully used in production.Sweeten Python withpysweet!Sample featuresIterable with method chaining,
in the spirit of JavaScript and Scala:frompysweetimportIterable_(Iterable_([1,2]).map(lambdax:x+1).to_list())# [2, 3]Multi-expression lambda,
common in modern languages:frompysweetimportblock_val=lambda:block_(x:=1,x+1,)# val() == 2Statement as expression,
in the spirit of Scala and Haskell
(if_is also the ternary operator):frompysweetimportif_,try_,raise_if_(True,lambda:1,lambda:2,)# 1try_(lambda:raise_(Exception('test')),catch=lambdae:str(e),)# 'test'Next stepsInstallationDocumentation
Package: pyswEOS
A Python interface for swEOS - Salt-Water (H2O-NaCl) Equation of State.Documentation (development version)|Contact|Try OnlinePlease select a proper version fromDownload Filesaccording to python version (e.g. 2.7, 3.8, 3.9) and operation system (macosx, linux, windows). The download file pattern ispyswEOS-version-pythonVersion-none-OSVersion.whl. For example, if your python version is 3.7 (or maybe 3.7.x, 3.7m, …) and OS is windows 10, please copy the link ofpyswEOS-0.2.6-py3.7-none-win_amd64.whland then use pip to install,pip install https://files.pythonhosted.org/packages/02/e4/8867bb89020e24129c40b5847fb868f731fe829ffccdca51b6e9ba093130/pyswEOS-0.2.6-py3.7-none-win_amd64.whl.
Package: pyswf
PYSWF=====A Python library for reading and writing SWF files.PYSWF is a Python port of Claus Wahlers *great* SWF parser https://github.com/claus/as3swfCan't thank Claus enough!INSTALL-------$ pip install pyswf==1.5.4or:$ git clone git@github.com:timknip/pyswf.git$ cd pyswf$ python setup.py installor you might need do:$ sudo python setup.py installWINDOWS-------Install Pillow, lxml and pylzma from a binary distribution before running setup.- [Pillow 2.9.0](http://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow)- [lxml 3.4.0](https://pypi.python.org/pypi/lxml/3.4.0#downloads)- [pylzma 0.4.6](http://www.lfd.uci.edu/~gohlke/pythonlibs/#pylzma)Installing the *.whl files:$ pip install the-downloaded.whlUSAGE-----Basic example:--------------```pythonfrom swf.movie import SWF# create a file objectfile = open('path/to/swf', 'rb')# print out the SWF file structureprint SWF(file)```SVG export example:-------------------```pythonfrom swf.movie import SWFfrom swf.export import SVGExporter# create a file objectfile = open('path/to/swf', 'rb')# load and parse the SWFswf = SWF(file)# create the SVG exportersvg_exporter = SVGExporter()# export!svg = swf.export(svg_exporter)# save the SVGopen('path/to/svg', 'wb').write(svg.read())```
Package: pyswh
pyswh- a Python wrapper library for the Software Heritage APIpyswhaims to wrap interactions with theSoftware Heritage REST APIinto a comfortable Python API.Getting startedInstallpyswhvia pip:pipinstallpyswhIncludepyswhin your project by adding a respective dependency to your project, e.g.,# requirements.txtpyswh==0.1.0# Poetry pyproject.toml[tool.poetry.dependencies]pyswh="^0.1.0"You can now usepyswh:frompyswhimportswhfrompyswhimporterrorsasswh_errorstry:swh.save('https://github.com/sdruskat/pyswh',False,'SWH-API-AUTH-TOKEN')exceptswh_errors.SwhSaveErrorassse:raisesseRefer to thecomplete documentationto learn more about usingpyswh.Set up for developmentRequirements:Python >= 3.10.0.InstallPoetry.Clone the repository:gitclonegit@github.com:sdruskat/pyswh.gitCreate a virtual environment in.venv:python3.10-mvenv.venvActivate the Poetry shell and install project:poetryshell
poetryinstallTestingpyswhusespytestfor testing. To run all tests, do:poetryshell
poetryrunpytesttest/Building documentation locallyInitialize the Poetry virtual environment withpoetry shell, go into thedocs/folder and runmake html.LicensingSeeLICENSE.md
Package: pyswi
Python package allowing computation of the Soil Water Index from surface soil moisture observations by means of exponential filter.DescriptionThe package includes the following features:SWI time series calculation and error propagation from SSM time seriesa recursive approach to SWI and its noise with calculation routines in Cythonan equivalent SWI calculation in Python with an exponential-filter-based
error propagation schemeRecursive SWI approach to calculate SWI for a single or a set of T-values in near-real timealsoWeightedcalculation of the SWI, allowing for custom weight assignment to
individual observationsiterative_storageStorage of iteration data between processing runs.DescriptionIn a process that works iteratively and needs to store some data
between processing runs, the classes in this package can be used to store
that data as netCDF files of any format. The main functionality of this package
is in the building of the storage filenames and in reading the correct iteration
data from the disk when the process is started again.InstallationThis package should be installable through pip:pipinstallpyswiNoteThis project has been set up using PyScaffold 3.2.3. For details and usage
information on PyScaffold seehttps://pyscaffold.org/.
Package: pyswip_alt
PySWIP Alt 0.2.3================Disclaimer:This is a fork from https://github.com/yuce/pyswipIts only purpose is to publish the most updated version at pypi-----------------PySWIP is a Python - SWI-Prolog bridge enabling to query SWI-Prologin your Python programs. It features an (incomplete) SWI-Prolog foreignlanguage interface, a utility class that makes it easy querying with Prologand also a Pythonic interface.Since PySWIP uses SWI-Prolog as a shared library and ctypes to access it,it doesn't require compilation to be installed.Note that this version of PySWIP is slightly incompatible with 0.1.x versions.Requirements:-------------* Python 2.3 and higher.* ctypes 1.0 and higher.* SWI-Prolog 5.6.x and higher (most probably other versions will also work).* libpl as a shared library.* Works on Linux and Win (32 & 64), should work for all POSIX.News----* Importing ``pyswip`` automatically initializes SWI-Prolog.* Fixed a bug with querying lists with the new interface.Example (Using Prolog):----------------------->>> from pyswip import Prolog>>> prolog = Prolog()>>> prolog.assertz("father(michael,john)")>>> prolog.assertz("father(michael,gina)")>>> list(prolog.query("father(michael,X)"))[{'X': 'john'}, {'X': 'gina'}]>>> for soln in prolog.query("father(X,Y)"):...     print soln["X"], "is the father of", soln["Y"]...michael is the father of johnmichael is the father of ginaSince version 0.1.3 of PySWIP, it is possible to register a Python function as aProlog predicate through SWI-Prolog's foreign language interface.Example (Foreign Functions):----------------------------from pyswip import Prolog, registerForeigndef hello(t):print "Hello,", thello.arity = 1registerForeign(hello)prolog = Prolog()prolog.assertz("father(michael,john)")prolog.assertz("father(michael,gina)")list(prolog.query("father(michael,X), hello(X)"))Outputs:Hello, johnHello, ginaSince version 0.2, PySWIP contains a 'Pythonic' interface which allows writingpredicates in pure Python (*Note that interface is experimental.*)Example (Pythonic interface):-----------------------------from pyswip import Functor, Variable, Queryassertz = Functor("assertz", 2)father = Functor("father", 2)call(assertz(father("michael","john")))call(assertz(father("michael","gina")))X = Variable()q = Query(father("michael",X))while q.nextSolution():print "Hello,", X.valueOutputs:Hello, johnHello, gina
Package: pyswip-notebook
Pyswip-NotebookThis package makes the python-prolog-bridgepyswipuseable from within a jupyter notebook environment.
For each instance of the newIsolatedProlog-class will spawn it's own prolog-module (like a namespace) and multiple instances (also when a cell is executed multiple times)
will be isolated from one another.InstallationDependenciesFollow the installation instructions for pyswiphereto
install a prolog interpreter for your operating system.Using pippip install pyswip-notebookFrom sourcegit clone https://github.com/mortacious/pyswip-notebook.git
cd pyswip-notebook
python setup.py installUsageSeeexamples/example.ipynbfor usage examples.
Package: pyswisseph
Python extension to AstroDienst Swiss Ephemeris library.The Swiss Ephemeris is the de-facto standard library for astrological
calculations. It is a high-precision ephemeris, based upon the DE431
ephemerides from NASA’s JPL, and covering the time range 13201 BC to AD 17191.>>> import swisseph as swe
>>> # first set path to ephemeris files
>>> swe.set_ephe_path('/usr/share/sweph/ephe')
>>> # find time of next lunar eclipse
>>> jd = swe.julday(2007, 3, 3) # julian day
>>> res = swe.lun_eclipse_when(jd)
>>> ecltime = swe.revjul(res[1][0])
>>> print(ecltime)
(2007, 3, 3, 23.347926892340183)
>>> # get ecliptic position of asteroid 13681 "Monty Python"
>>> jd = swe.julday(2008, 3, 21)
>>> xx, rflags = swe.calc_ut(jd, swe.AST_OFFSET+13681)
>>> # print longitude
>>> print(xx[0])
0.09843983166646618Documentation:https://astrorigin.com/pyswissephRepository:https://github.com/astrorigin/pyswisseph
Package: pyswitchbee
pySwitchbeeA Python module library to controlSwitchBeesmart home devices.Example code usage:fromasyncioimportget_event_loopfromaiohttpimportClientSession,ClientTimeout,TCPConnectorfromswitchbee.apiimportCentralUnitAPIfromswitchbee.deviceimportApiStateCommand,DeviceTypeasyncdefmain():session=ClientSession(connector=TCPConnector(ssl=False),timeout=ClientTimeout(total=3),)cu=CentralUnitAPI("192.168.50.2","user","pass",session)awaitcu.connect()print(f"Central Unit Name:{cu.name}")print(f"Central Unit MAC:{cu.mac}")print(f"Central Unit Version:{cu.version}")devices=awaitcu.devicesfordeviceindevices:# set the dimmer lights to 50% brightnessifdevice.type==DeviceType.Dimmer:print("Discovered Dimmer device called{device.name}"" current brightness is{device.brigt}")awaitcu.set_state(device.id,50)# set the shutters position to 30% openedifdevice.type==DeviceType.Shutter:print("Discovered Shutter device called{device.name}"" current position is{device.position}")awaitcu.set_state(device.id,30)# turn off switchesifdevice.type==DeviceType.Switch:print("Discovered Switch device called{device.name}"" current state is{device.state}")awaitcu.set_state(device.id,ApiStateCommand.OFF)# set timer switch on for 10 minutesifdevice.type==DeviceType.TimedPower:print("Discovered Timed Power device called{device.name}"" current state is{device.state}with{device.minutes_left}""minutes left until shutdown")awaitcu.set_state(device.id,10)session.close()if__name__=="__main__":get_event_loop().run_until_complete(main())exit()Using the CLI tool:Alternatively, it is possible to controlSwitchBeedevices using the cli toolswitchbee_cli.pyas following:To list devices that currently on:python switchbee_cli.py -i 192.168.50.2 -u USERNAME -p PASSWORD get_states --only-on'_state': 'ON',
    'hardware': <HardwareType.Switch: 'DIMMABLE_SWITCH'>,
    'id': 311,
    'name': 'Ceiling',
    'type': <DeviceType.Switch: 'SWITCH'>,
    'zone': 'Outdoo Storage'}

{   '_state': 'ON',
    'hardware': <HardwareType.Switch: 'DIMMABLE_SWITCH'>,
    'id': 142,
    'name': 'Spotlights',
    'type': <DeviceType.Switch: 'SWITCH'>,
    'zone': 'Porch'}To set shutter with device id 392 position 50%:python switchbee_cli.py -i 192.168.50.2 -u USERNAME -p PASSWORD set_state --device-id 392 --state 50To turn on Power Timed Switch with device id 450 for 30 minutes:python switchbee_cli.py -i 192.168.50.2 -u USERNAME -p PASSWORD set_state --device-id 450 --state 30To turn off light with device id 122:python switchbee_cli.py -i 192.168.50.2 -u USERNAME -p PASSWORD set_state --device-id 122 --state OFF
Package: pyswitchcontroller
pyswitchcontrollerArduino と FT232RL を使って Switch を Python から操作するライブラリ必要なものArduino Leonardo もしくは互換品USBシリアル変換モジュール (FT232RL 等)上を接続する物セットアップ(Windows)Arduino に arduino/ft232.ino を書き込むFT232RLにドライバをインストールzadigをダウンロードOptions -> List All Devices をクリックlibusb-win32を選択して Reinstall Driver全部つなぐ
Package: pyswitcheo
pyswitcheois a simple python client to interact withSwitcheo Decentralized ExchangeCurrent Alpha Version0.1.1Installationpip$pipinstallpyswitcheoGetting StartedClient exampleimportjsonfromhttpimportHTTPStatusfrompyswitcheo.apiimportSwitcheoApiif__name__=='__main__':client=SwitcheoApi(base_url="https://test-api.switcheo.network")resp=client.list_contracts()ifresp.status_code==HTTPStatus.OK:print(json.loads(resp.text.encode("UTF-8")))More examples are located atexamplesDevelopment InstallationThis project usespipenvfor python environment management.Download/Installpipenvlike thispip install--userpipenvClone the project.Inside the project directory runpipenv install.This will create a python virtualenv which can be activated usingpipenv shell.Now install the application in editable mode and you are ready to
start development$ pip install -e .TestTo run the tests:make testDocumentation theme is highly inspired byAiohttp.
Package: pyswitchvox
About-----This package contains a Python client library for the Switchvox Extend API.This library is only a very thin wrapper around the Extend API Methods, and seeks primarily to provide a Pythonic way of invoking the API.For more information on the Extend API, see the developer documentation: http://developers.digium.com/switchvox/Installation-----```python setup.py install```Notes-----Due to a quirky bug in Switchvox's HTTP server's 401 Challenges, a very recent version of the ```requests``` library is needed. So recent, in fact, that it isn't released yet.As such, PySwitchvox maintains that it needs requests 2.8.1, when in reality we will need the eventually released 2.8.2. When that release is made, the library dependency in ```setup.py``` will be updated appropriately. Until then, ```requests``` will need to be installed from Github: https://github.com/kennethreitz/requests
Package: pysword
A native Python reader of the SWORD Project Bible ModulesThis project isnotan officialCrossWireproject. It merely provides an alternative way to read the bible modules
created by CrossWiresSWORDproject.FeaturesRead SWORD bibles (not commentaries etc.)Detection of locally installed bible modules.Supports all known SWORD module formats (ztext, ztext4, rawtext,
rawtext4)Read from zipped modules, like those available fromhttp://www.crosswire.org/sword/modules/ModDisp.jsp?modType=BiblesClean text of OSIS, GBF or ThML tags.Supports both python 2.7 and 3.3+[*](CI tested with 2.7 to 3.10)[*]pysword makes use of io.open (introduced in python 2.6 and the unicode literal (available in pyhton 2 and
reintroduced in python 3.3 - PEP 414)LicensePySword is and can be distributed under theMIT licenseInstallationPySwords source code can be downloaded from PySwordsrelease list,
but it is also available fromPyPIfor install usingpip:pip install pyswordIt also available forArchLinux (AUR)andFedoraandDebian.Run testsTo run the testsuite, first run the script that download the files used
for testing, and then use pytest to run the testsuite:$pythontests/resources/download_bibles.py$pytest-vtests/The tests should run and pass using both python 2 and 3.Using PySwordRead thedocumentationfor how to use pysword and to see the API docs.ContributingIf you want to contribute, you are most welcome to do so!
Feel free to report issues and create merge request athttps://gitlab.com/tgc-dk/pyswordIf you create a merge request please include a test the proves that your code actually works.
Package: pyswot
PySwotPython wrapper forJetBrains/swot.Free software: Apache Software License 2.0FeaturesThis library is a wrapper aroundJetBrains/swotand provides two
methods:>>>frompyswotimportis_academic>>>is_academic("user@ox.ac.uk")True>>>is_academic("user@gmail.com")False>>>frompyswotimportfind_school_names>>>find_school_names("user@ox.ac.uk")['University of Oxford']>>>find_school_names("user@gmail.com")[]
Package: pySWXF
pySWXFCode for calculating reflectivity and standing wave x-ray reflectivityget_prof  Routine to get electron density profile from list of amplitudes centers and roughnesses* get_prof:		Gets profile
* get_dprof:		Gets profile derivativeget_realspace	Routine to get realspace profile for bilayer.  Probably obselete* get_realspace 
* half	routine to do a 1/2 boxcar average of data set and halve length of datasetrefl_funs  Routines to calculate specular reflectivity* mlayer_rough:		Calculates reflectivity from a multilayer substrate.  Approximates roughness as gaussian
* mlayer_conv		Convolutes mlayer_rough with a gaussian resolution functionspec_utils  Routines to read data from spec files* readscan		read a data scan
* readmcascan		read a data scan where mca data saved to spec file 
* merge_scans		combine spec scans from a sequence
* merge_duplicates	take combined scans and average points at same location
* getscan			uses readscan to specifically read theta two-theta data
* getscan_bg		reads a scan and two backgrounds and returns background subtracted data
* list_scans		lists scans in spec file
	* dt_correct:		corrects MCA dead time from CLS mca
* get_mca_data_CLS: 	reads MCA data from Canadian Light Source Brockhouse Beamline
* get_mca_data_DND:	reads MCA data from DND cat
* plot_mca_sum:		Sums all mca data from a scan and plots intensity vs energy 
* peak_label:		Plots a label for a peak on an MCA plot
* K_label:		Labels all K-lines from an element
* L_label:		Labels all L-lines from an element
* get_br_amps		Fits bromine peak to gaussian and nearby gold peak.  Returns only Br amplitude
* plot_br_fluor		Fits all bromine amplitudes from scan and returns plot of intensity vs. angle
* get_edge_absorb		Finds the absorbtion probability of an edge by brute force (e.g. 
				calculates values on either side of edge and subtracts
* Au_L_peak:		Simulates intensity from Au L peaks.  Input to get_br_amps
* Br_K_peak:		Simulates intensity from Br K peak.  Input to get_br_amps
* Br_peak_sim:		Combines Br and Au peaks into total intensity.  Input to get_br_amps
	* cbwe: combine two sets of data with error bars
* cbwe_s: same as cbwe but for two scalers rather than two vector
* get_reflectivity_CLS(fname, datadir, scan):
* get_refl_sequence_CLS(fname, datadir, firstscan):
* plot_refl_sequence_CLS(fname, datadir, firstscan):standing_wave	Routines to calculate x-ray standing wave properties* reflection_matrix 	returns reflection and transmission data from multilayer array.  Uses mlayer_rough
* eden_to_rho		converts between electron density and mass density
* rho_to_n		converts between mass density and index of refraction
* rho_to_rhoe		converts between mass density and electron densitySome of these are still a work in progress, proceed with cautionPlease contact Larry Luriollurio@niu.edufor more information