Saravanan666/pypi-org huggingface dataset:
Package: pymatunits
pyMatUnits - Python Materials and Units handling packagePackage for handling units systems and conversion, leveraging thepint package, as well as material property definition for use
with in physics-based modeling.Built-In/Saved Materials and Unit Systemsmat_propandunitsmodules havebuiltin_dirandbuiltin_pathsto lead to savedJSONfilesUnit SystemsModule name :unitsWorks on top of thepint package.UnitSystemclass allows for
storage of system of units (length, mass, time, etc.), as well as the ability to check for internal
consistency of said system usingcheck_consistencymethod. Logs consistency issues as well as returning
conversion factors to be used when converting inconsistent units.Unit systems can be stored or read from JSON file format using.to_json/.read_json, similar to Pandas.Main class :UnitSystemUnit conversion function :convertMaterialsModule name :mat_propAllows for material definitions, based on those defined in Abaqus. Can create materials in Abaqus CAE or
Nastran input file (bdf) if the appropriate dependencies are in place (Abaqus API or Nastran Utils package).Materials can be stored or read from JSON file format using.to_json/.read_json, similar to Pandas.AppsDash apps (units_app.pyandmat_app.py) for creating, reading, or writing unit systems or material
objects.
Package: py-maui
Python MAUIPython bindings for (rs-maui)[https://github.com/KrisNK/rs-maui].Installationpip install py-mauiBuilding the packageSetuppython -m venv .env
source .env/bin/activate
pip install maturinBuild in developmentsource .env/bin/activate
maturin developWhen coding within the environment, usingmaturin developwill build the package and it can be imported withimport py_maui.PublishingFor publishing, contact @KrisNK.
Package: pymavlink-ws-xrendan
A Python library for handling MAVLink protocol streams and log files. This allows for the creation of simple scripts to analyse telemetry logs from autopilots such as ArduPilot which use the MAVLink protocol. See the scripts that come with the package for examples of small, useful scripts that use pymavlink. For more information about the MAVLink protocol seehttps://mavlink.io/en/
Package: pymavlog
pymavlogA lightweight python library to parse log files from ArduPilot vehicles based on theMavLinkprotocol. It is built on top ofpymavlinkand usesNumPyunder the hood to vectorize messages.InstallationInstallation with pip:pipinstallpymavlogor via PoetrypoetryaddpymavlogDevelopmentInstall the package in editable mode:pipinstall-e.Pymavlog is built usingPoetry, so make sure to have it in your local development environmentpipinstallpoetryLastly, install the pre-commit hookspipinstallpre-commit
pre-commitinstallTestingpoetryrunpytesttests--covpymavlogormaketestsUsageMavlink log files are parsed usingMavLog, which iterates through the logged messages and saves them in-memory as NumPy arrays. You can parse a file like:frompymavlogimportMavLogfilepath="foo/bar.bin"mavlog=MavLog("foo/bar.bin")mavlog.parse()and access the messages like:imu_messages=mavlog.get("IMU")and do some calculations, for example calculating the average value:avg_gyr_x=imu_messages["GyrX"].mean()alternatively, you can access a specific attribute like:gyr_y=mavlog["IMU"]["Gyrx"]Pymavlog also supports telemetry log files. You can read a tlog file.tlogin a similar way as binary log files, like:frompymavlogimportMavTLogfilepath="foo/bar.tlog"tlog=MavTLog("foo/bar.tlog")tlog.parse()
Package: pymavswarm
What is pymavswarm?pymavswarmis a Python library implemented to enable interaction with drone
swarms using the MAVLink protocol. This library supports reading MAVLink
messages sent from multiple agents in a swarm and sending MAVLink messages to
agents within the swarm. Such functionality ultimately enables development of
new swarm applications such as ground control stations.Main featuresHere are some of the main features ofpymavswarm:Easily send MAVLink commands to multiple drones, simultaneouslyMonitor the state of swarm drone agentsImplement custom commands and swarm algorithmsDevelop applications for on-board companion computersImplement custom swarm ground control stationsLog incoming MAVLink messages for future evaluation and debuggingConstruct pre-planned missionsMulti-agent collision avoidance using reachability analysisInstallationpymavswarmmay be installed fromPyPIby running:$python3-mpipinstallpymavswarmTo buildpymavswarmfrom source, first ensure that at least Python 3.10 is
installed. Once this dependency has been met, refer to the steps below:Clone the projectrepositoryNavigate to thepymavswarm/base directory$cdpath/to/pymavswarm/Install thepymavswarmPython package$python3-mpipinstall.Quick startpymavswarmhas been implemented to enable easy interfacing with drone
swarms. Refer to the following code snippet for a simple example to get started
with the library. Additional examples may be found in the projectexamples.importtimefrompymavswarmimportMavSwarm# Create a new pymavswarm interfacemavswarm=MavSwarm()# Establish a connection with a USB telemetry devicemavswarm.connect('/dev/ttyUSB0',115200,255,0)# Wait for the swarm to be populatedwhilenotmavswarm.agents:pass# Arm each agent in the swarmmavswarm.arm()# Briefly delay to allow all agents to armtime.sleep(5.0)# Disarm each agent in the swarmmavswarm.disarm()# Close the pymavswarm connectionmavswarm.disconnect()Getting helpIf you have questions regardingpymavswarmusage or contribution please ask a
question on ourDiscussionsboard!ContributingAll contributions and ideas are welcome! Detailed guidelines regarding how to
contribute can be found in thecontribution guidelines.Licensepymavswarmis released under the GNU General Public License v3 or later
Package: pymaws
pymaws: Matsuno Analytical Wave Solution implemented in PythonA python module for evaluating the initial conditions used in:The Matsuno baroclinic wave test case(under review for GEOSCI. MODEL DEV.).Installationpymaws has minimal requirements of:Python 3.4 to 3.7numpy  1.16The package can be installed usingpip:$ pip install pymawsTestingThe testing procedure tests all the parts of pymaws and should take anywhere from a few seconds upto 20 seconds due to random elements in the tests.
To run the tests, use python3 in the command line:$ python test_pymaws.pyYou should getOKin the last line.Getting StartedIn the python environmnet, start by importing pymaws with the command:$ from pymaws import *The main functioneval_fieldwas loaded to your environment and a dictionary namedEarththat stores the planetary parameters used in this package. (if you want to runeval_fieldwith different parameters , see below)ExampleLet's begin with a regular grid of lat/lon on a 20 second time interval:$ import numpy as np
$ nlats = 100
$ nlons = 200
$ ntime = 50
$ lats = np.deg2rad(np.linspace(-80, 80, nlats))
$ lons = np.deg2rad(np.linspace(-180, 180, nlons))
$ time = np.linspace(0.0, 20, ntime)Now, let's evaluate the meridional velocity field of an Eastward propagating Inertia-Gravity (EIG) wave:$ v = np.zeros((ntime, nlats, nlons))
$ for t in range(ntime):
$     for j in range(nlats):
$         for i in range(nlons):
$             v[t, j, i] = eval_field(lats[j], lons[i], time[t], 
$                                           field='v', wave_type='EIG')

$ v.shape
$ (50, 200, 100)Note that the default arguments ofeval_fieldaren=1, k=5, amp=1e-5, wave_type='Rossby'andparameters=Earth.
This package does not include visualizations of any kind, but you can usematplotlib, e.g.$ from matplotlib import pyplot as plt
$ plt.contourf(np.rad2deg(lons), np.rad2deg(lats), v[0, :, :])
$ plt.xlim(-36,36)
$ plt.ylim(-30,30)Meridional velocity at t=0CaveatsThis version of pymaws does not solve Matsuno equations for n, k < 1,Planetary Parameters:The default parameters inpymawsare stored in a dictionary namedEarth:$  {'angular_frequency': 7.29212e-05,
      'gravitational_acceleration': 9.80616,
      'mean_radius': 6371220.0,
      'layer_mean_depth': 30.0}If you want to use different planetary parameters,  just copy the dictionaryEarthand replace the appropriate values. For example lets change thelayer_mean_depthparameter to 10 meters:$   Earth_1 = Earth.copy()
$   Earth_1['layer_mean_depth'] = 10.0When you runeval_field, remember to use the argumentparameters=Earth_1.How to cite pymawsIf you use pymaws in your academic work and publish a paper, we kindly ask that you cite pymaws using the following DOI:LicenseThis project is licensed under the MIT License - see theLICENSEfile for detailsAuthorsOfer Shamir-ofer.shamir@mail.huji.ac.ilShlomi Ziskin Ziv-shlomiziskin@gmail.com
Package: pymaxcul
# About pymaxculPymaxcul is a python package to talk to [MAX! devices by eQ-3](http://www.eq-3.de/produkte/max.html) through a [CUL stick](https://wiki.fhem.de/wiki/Selbstbau_CUL).This module is forked fromhttps://github.com/vogt31337/MaxCul-Pythonwhich in turn has been at some point been forked fromhttps://github.com/jokey2k/MoritzServer.
It refactored to use less dependencies and to be easyly used from other projects, especially as a dependency for [Home Assistant](https://github.com/home-assistant/home-assistant).It should be usable for thermostats but it is not well tested. As I don’t have other MAX! devices I can’t test and implement functionality to support them, though rudimentary support exists.
Please sent a PR if you want to add support for other devices.
Package: pymaxdb
pymaxdbProjeto que visa padronizar a comunicação com alguns bancos de dados.ObjetivoPadronizar a conexão com bancos de dados distintos;Utilizar métodos padronizados para realizar operações em bancos de dados;Melhorar controle de operações que envolvem atualizações em bancos de dados.InstalaçãopipinstallpymaxdbUtilizaçãoA comunicação é realizada através da instanciação da classeconexao, que recebe em um de seus parâmetros o nome do banco de dados que se deseja conectar. O parâmetronome_conexaorecebe nomes pré-definidos, que podem ser: Postgres, (conexão PostgreSQL), DBMakerODBC (necessário criação prévia de uma conexão DBMaker ODBC), SQLServerODBC (conexão SQL Server ODBC) e Firebird (conexão Firebird).frompymaxdbimportconexaotry:# Conexão PostgreSQLcon=conexao(nome_conexao='postgres',host='127.0.0.1',port='5432',db='nome_database',usr='usuário',pwd='senha')# Conexão DBMaker ODBC# con = conexao(nome_conexao='dbmakerodbc', db='nome_dsn', usr='usuário', pwd='senha')# Conexão SQL Server ODBC# con = conexao(nome_conexao='sqlserverodbc', db='nome_dsn', usr='usuário', pwd='senha')# Conexão Firebird# con = conexao(nome_conexao='firebird', host='127.0.0.1', port='3050', db='/caminho_database/nome_database.fdb', usr='usuário', pwd='senha')try:con.executar('insert into nome_database values(1)')con.efetivar()# commitrs=con.consultar('select * from nome_database')print(rs)proximo_registro=con.proxima_chave('nome_database','campo_chave')print(proximo_registro)exceptExceptionase:con.rollback()print(e)finally:con.fechar()# close connectionexceptExceptionase:print(e)O pacote também possui mais algumas classes e funções utilitárias:conexao_dbmakerPermite controlar a quantidade de tentativas de conexão ao banco de dados DBMaker, no caso do número de conexões permitidas exceder.frompymaxdbimportconexao_dbmakertry:con_dbmaker=conexao_dbmaker(tentativas_conexao=3,dsn='nome_dsn',usr='usuário',pwd='senha').conectar()try:print(con_dbmaker.consultar('select * from nome_database'))exceptExceptionase:con.rollback()print(e)finally:con_dbmaker.fechar()exceptExceptionase:print(e)
Package: pymaya
pymaya intract withhttps://maya.tase.co.il/https://api.tase.co.il/pip install pymaya
example:from datetime import date

from pymaya.maya import Maya


def main():
    maya = Maya()
    all_securities = maya.get_all_securities()
    print(all_securities)

    maya.get_details("739037")
    historical_prices = maya.get_price_history(security_id="739037", from_data=date(2017, 12, 31))
    for fund_object in historical_prices:
        print(fund_object)

    maya.get_details("5118393")
    historical_prices = maya.get_price_history(security_id="5118393", from_data=date(2017, 12, 31))
    for fund_object in historical_prices:
        print(fund_object)


if __name__ == "__main__":
    main()
Package: pymaybe
A Python implementation of the Maybe pattern.Installationpip install pymaybeGetting Startedfrom pymaybe import maybe
first_name = maybe(deep_hash)['account']['user_profile']['first_name'].or_else("<unknown>")DocumentationMaybe monad is a programming pattern that allows to treat None values that same way as non-none values.
This is done by wrapping the value, which may or may not be None to, a wrapper class.The implementation includes two classes:MaybeandSomething.Somethingrepresents a value whileNothingrepresents a None value.
There’s also a methodmaybewhich wraps a regular value and and returnsSomethingorNothinginstance.>>> maybe("I'm a value")
"I'm a value"

>>> maybe(None);
NoneBothSomethingandNothingimplement 4 methods allowing you to test their real value:is_some,is_none,getandor_else>>> maybe("I'm a value").is_some()
True

>>> maybe("I'm a value").is_none()
False

>>> maybe(None).is_some()
False

>>> maybe(None).is_none()
True

>>> maybe("I'm a value").get()
"I'm a value"

>>> maybe("I'm a value").or_else(lambda: "No value")
"I'm a value"

>>> maybe(None).get()
Traceback (most recent call last):
...
Exception: No such element

>>> maybe(None).or_else(lambda: "value")
'value'

>>> maybe(None).or_else("value")
'value'In addition,SomethingandNothingimplement the Python magic methods allowing you to treat them as dictionaries:::>>> nested_dict = maybe(nested_dict)
>>> nested_dict['store']['name']
'MyStore'>>> nested_dict['store']['address']
None>>> nested_dict['store']['address']['street'].or_else('No Address Specified')
'No Address Specified'All other method calls onSomethingare forwarded to its realvalue:>>> maybe('VALUE').lower()
'value'

>>> maybe(None).invalid().method().or_else('unknwon')
'unknwon'Examples & Use CasesThe Maybe pattern helps you avoid nasty try..except blocks.
Consider the following code:::try:url = rss.load_feeds()[0].url.domainexcept (TypeError, IndexError, KeyError, AttributeError):url = “planetpython.org”With Maybe you could simply do:url = maybe(rss).load_feeds()[0]['url'].domain.or_else("planetpython.org")Getting the current logged in user’s name.
Without maybe:def get_user_zipcode():
    address = getattr(request.user, 'address', None)
    if address:
        return getattr(address, 'zipcode', '')

    return ''With maybe:def get_user_zipcode():
    return maybe(request.user).address.zipcode.or_else('')Further ReadingOption (Scala)Maybe (Java)Maybe pattern (Python recipe)Data.Maybe (Haskell)Maybe (Ruby)Copyright and LicenseCopyright 2015 -Eran KampfFree software: BSD licenseDocumentation:https://pymaybe.readthedocs.org.Code is hosted onGitHubHistory0.1.0 (2015-01-11)First release on PyPI.
Package: pymbdata
PymbdataA toy library that includes some complex data types seen in mathematics, engineering and statistics.Getting StartedThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.PrerequisitesNumpy is used in the matrix, but it will be automatically installed when you install pymbdata.InstallingTo install the library you need to have PIP installedInstalling the librarypip install pymbdataTo import it in a python scriptimport pymbEnd with an example of getting some data out of the system or using it for a little demoRunning the testsNo tests are present yetAuthorsGeorge Sima-Initial work-GamirouLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for detailsAcknowledgmentsHat tip to numpyHat tip to myself :))Inspiration
Package: pymbfl
pymbfl provides Python bindings for libmbfl. libmbfl is used to determine
encoding of the files; it tries to guess the right encoding depending on the
list of the encodings which user wants to check.Typical pymbfl usage:>> import pymbfl

# Collect information about encoding
>> encoding = pymbfl.Encoding("ascii")
>> bool(encoding.flags & pymbfl.MBCS)
False
>> encoding.mime
'US-ASCII'
>> encoding.aliases
['ANSI_X3.4-1968', 'iso-ir-6', 'ANSI_X3.4-1986', 'ISO_646.irv:1991',
'US-ASCII', 'ISO646-US', 'us', 'IBM367', 'IBM-367', 'cp367', 'csASCII']

# Determine possible encoding
>> language = "ru"
>> encodings = ["UTF-8", "UTF-16", "UTF-32LE"]
>> detector = pymbfl.Detector(language, encodings)
>> detector.detect(data, strict) # enable/disable strict check and detectSee docs/pymbfl.html file for more detailed description.
Package: pymbolic
Pymbolic is a small expression tree and symbolic manipulation library. Two
things set it apart from other libraries of its kind:Users can easily write their own symbolic operations, simply by deriving
from the builtin visitor classes.Users can easily add their own symbolic entities to do calculations
with.Pymbolic currently understands regular arithmetic expressions, derivatives,
sparse polynomials, fractions, term substitution, expansion. It automatically
performs constant folding, and it can compile its expressions into Python
bytecode for fast(er) execution.If you are looking for a full-blown Computer Algebra System, look atsympyorPyGinac. If you are looking for a
basic, small and extensible set of symbolic operations, pymbolic may
well be for you.Resources:documentationdownload(via the package index)source code via git(also bug tracker)
Package: pymbr
PyMBR is a simple module that allows the user to parse, manipulate or
create MBR/Bootsectors easily.Parse full MBR dumpParse parts of the MBR such as the partition table.Change the bootcode or the artition table values.Compose the changes made into a a new MBR binary string.Installationpythonsetup.pyinstallorpipinstallpymbrSample usage - Creating a simple MBRimportpymbrmbr=pymbr.MBR()mbr.bootcode=pymbr.Bootcode.ZOIDBERGmbr.partitionTable=pymbr.PartitionTable.parse('\x00'*64)mbr.signature=0xaa55bin=mbr.compose()withopen('mbr.bin','wb')asfile:file.write(bin)TODOs:Add more common filesystems to the Filesystem classAdd common MBR bootcode to he Bootcode classAdd LBA to CHS converionAdd overlapping partition preventionTests?
Package: pymbs
PyMBS is a Python library for use in modeling Mortgage-Backed Securities.This is a modern Python library that requiresPython>=3.10ObjectivesCreate a modern, stable Python library with a clearly-defined APIProvide as close to 100% Test Coverage as possible[1]Provide clear documentation with full coverage of the API and example code.InstallingInstall usingconda:condainstall-cbtfpymbsInstall usingpip:pipinstallpymbsLinksDocumentation:https://brianfarrell.gitlab.io/pymbs/License:https://www.gnu.org/licenses/agpl.htmlAnaconda Cloud:https://anaconda.org/btf/pymbs/PyPi Releases:https://pypi.org/project/pymbs/Code:https://gitlab.com/brianfarrell/pymbsFootnotes[1]This project started-out as a Proof of Concept (POC).At that point, no automated testing was involved.Going forward, all new development and bug fixes will be test-driven.
Package: pymbta3
pymbta3Python wrapper for the MBTA v3 APIInstallpip install pymbta3UsageTo get data from the MBTA API, import the library and call the object with your API key. The API Key may also be stored in the environment variableMBTA_API_KEY.frompymbta3importAlertsat=Alerts(key=YOUR_API_KEY_HERE)# Find all alerts affecting Alewifealerts=at.get(stop='place-alfcl')# Find the short header for the alertforalertinalerts['data']:print(alert['attributes']['short_header'])Multiple values can be passed in for most filters.Alerts affecting Orange and Red linesalerts=at.get(route=['Orange','Red'])Alerts affecting parking or Wheelchair usealerts=at.get(activity=['PARK_CAR','USING_WHEELCHAIR'])Include other dataReturn the stop data along with routesfrompymbta3importRoutesrt=Routes(key=YOUR_API_KEY_HERE)# Find all Route data for the Red Lineroutes=rt.get(route='Red',include='stops')API Methods ImplentedAlertsRoutesStopsVehiclesPredictionsSchedulesTripsFacilities
Package: pymbtc
Mercado Bitcoin - API de Dados e NegociaçõesDocumentação OficialAPI de Dadostickerorderbooktradesday_summaryAPI de Negociaçõeslist_system_messagesget_account_infoget_orderlist_orderslist_orderbookplace_buy_orderplace_sell_orderplace_market_buy_orderplace_market_sell_ordercancel_orderget_withdrawalwithdraw_coinExemplo de Usofrom pymbtc import Api, TradeApi
import os

api = Api()
print(api.ticker())
print(api.ticker("BTC"))

tapi = TradeApi(
    tapi_id=os.getenv("tapi_id"),
    tapi_secret=os.getenv("tapi_secret")
)
print(tapi.list_system_messages())
print(tapi.list_system_messages(level="INFO"))
print(tapi.get_account_info())
print(tapi.list_orders(coin_pair="BRLBTC"))
Package: pymbtiles
Mapbox MBtiles UtilitiesA Python 2.7 and 3 library for working withMabox mbtiles v1.1FeaturesProvides a lighweight Python API for reading and writing mbtiles files.Mabox mbtiles v1.1allow you to store geographic data as rendered image tiles or as vector tiles, along with associated metadata.Installationpip install pymbtilesTo install from master branch on GitHub using pip:pip install git+https://github.com/consbio/pymbtiles.git#egg=pymbtiles --upgradeUsagePython APIopen for reading and read a tile:from pymbtiles import MBTiles
with MBtiles('my.mbtiles') as src:
    tile_data = src.read_tile(z=0, x=0, y=0)returns tile data in bytes.open for writing (existing file will be overwritten):with MBtiles('my.mbtiles', mode='w') as out:
    out.write_tile(z=0, x=0, y=0, tile_data)or write a bunch of tiles at once:from pymbtiles import MBTiles, Tile

tiles = (
    Tile(z=1, x=0, y=0, tile_data=first_tile),
    ...
)

with MBtiles('my.mbtiles', mode='w') as out:
    out.write_tiles(tiles)User+mode to read and write.Metadata is stored in themetaattribute of the mbtiles instance:with MBtiles('my.mbtiles') as src:
    metadata = src.metaThis metadata is stored in themetadatatable in the mbtiles file, and contains
a number of records required or optional under thembtiles specification.To update metadata:with MBtiles('my.mbtiles', 'r+') as out:
    out.meta['some_key'] = 'some_value'You can set several values at once by passing in a newdictobject:with MBtiles('my.mbtiles', 'w') as out:
    out.meta = my_metadata_dictListing available tilesTo list available tiles in the tileset:with MBtiles('my.mbtiles') as src:
    for tile_coords in src.list_tiles():  # [TileCoordinate(z, x, y)...]
        ...WARNING:for large tilesets, this can exceed available memory.To list available tilesets for large tilesets, use:with MBtiles('my.mbtiles') as src:
    for batch in src.list_tiles_batched():
        for tile_coords in batch: # [TileCoordinate(z, x, y)...]
            ...Set operationsTheopsmodule providesextend,union, anddifferencefunctions to perform set operations on tilesets.Extend a tileset with new tiles from a second:extend(source_filename, target_filename)Create a new tileset with unique tiles combined from both left and right tilesets:union(left_filename, right_filename, out_filename)Create a new tileset from the tileset in the left tileset not present in the right tileset:difference(left_filename, right_filename, out_filename)Tile SchemeTiles are output to mbtiles format in xyz tile scheme.Possibly useful:mbtileserver: a lightweight Go tile servertpkutils: a library for converting ArcGIS tile cache to mbtilesChanges :0.5.0addedzoom_range,row_range,col_rangeto provide basic information about tiles available in the tileset0.4.0addedlist_tilesto list tiles andlist_tiles_batchto list tiles in batchesaddedopsmodule withextend,union,differencefunctions0.3.0all write-like operations for metadata and tiles are now overwrite by defaultCredits:Inspired by:mbutilnode-mbtilesSQL for creating mbtiles database derived fromnode-mbtilesLicense:See LICENSE.md