Saravanan666/pypi-org huggingface dataset:
Package: pymapr-kafkarest
pymapr-kafkarestIntroductionThe aim of the project is to create a super-simple wrapper for MAPR Kafka REST proxy.
We're trying to allow users to interact with MAPR Kafka in an elementary way and writing
less code as possible.The original documentation of the REST calls can be foundhere.InstallationSoonavailable via pip:pipinstallpymapr-kafkarestRuntime configurationsKAFKAREST_LOG_LEVEL: allows to set the log level... default toDEBUGTBCUsageImport the libfrompymapr_kafkarestimportMaprKlientDefine basic attributesbase_url='http://my-endopoint:8082'user_group='foo'topics=['/streams/foo:bar']and instantiate the clientmk=MaprKlient(base_url,user_group,topics=topics)Connect, subscribe and consume messages as follows:base_url='http://my-endopoint:8082'if__name__=='__main__':mk=MaprKlient(base_url,user_group,headers=headers,topics=topics)mk.connect(clear=True)mk.subscribe()messages=mk.consume()print(messages)Connect and produce messages:frompymapr_kafkarestimportMaprKlientfrompymapr_kafkarest.kafkarestimportMaprKProducerbase_url='https://localhost:8082'headers={}user_group='me'if__name__=='__main__':# producingmp=MaprKProducer(base_url,user_group,headers=headers)msgs=[dict(key='0099',value=dict(color='red',shape='square'))]mp.produce(messages=msgs,topic='/streams/foo')TODOa lot of methods are not yet implementedfull read the docschainconnect,subscribeandconsumein a new method namedstream
Package: pyMapVBVD
pyMapVBVDPython port of the Matlab mapVBVD tool for reading Siemens raw data 'twix' (.dat) files.Installationconda install -c conda-forge pymapvbvdorpip install pymapvbvdUseI have attempted to replicate the syntax of the original matlab code, but there are a few differences due to differing variable types.This package contains a demo Jupyter notebook 'Demo.ipynb' which can be run on the demo data found in tests/test_data. There is unsuppressed water SVS MRS, from both a 7T VB scanner and a VE Prisma. There is also imaging data (3D GRE and EPI) from theISMRMRD test dataset.Run using the following:import mapvbvd
twixObj = mapvbvd.mapVBVD(filename)For multi raid files (VD+) twixObj is a list, for single files it is a AttrDict containing data with keys relating to the MDH flags and a header object. The MDH flags present can be retrieved as a list usingtwixObj.MDH_flags(), whilst the header is found attwixObj.hdr.DataData can be accessed using e.g. for image MDHdata = twixObj.image['']
data = twixObj.image[:,:,:]
data = twixObj.image[0::2,0,:]To remove singleton dimensionstwixObj.image.squeeze = True.To retrieve the data in an unsorted format (i.e. Col,Cha,NAcq) usetwixObj.image.unsorted().HeadersHeader information is contained in a dicttwixObj.hdrtwixObj.hdr.keys()provides a list of the data containers.
Access them manually using e.g.twixObj.hdr['MeasYaps']ortwixObj.hdr.MeasYaps.
These objects are in turn a final level of dictionaries. The actual data values can be accessed either manually using tuples of key values e.g.twixObj.hdr.MeasYaps[('sTXSPEC','asNucleusInfo','0','tNucleus')]or you can search for keys and values by custom methods.matching_keys = twixObj.search_header_for_keys(('sTXSPEC', 'asNucleusInfo'))
key_value = twixObj.search_header_for_val('MeasYaps',('sTXSPEC', 'asNucleusInfo', '0', 'tNucleus'))search_header_for_keystakes the keyword argument regex (default True) to either search via case insensitive regular expressions or via exact matches only. Specify top_lvl to restrict to just some parameter sets.Other infoThanks to Mo Shahdloo the latest version now implements OS removal, ramp sample regridding, averaging and line reflection.Set the appropriate flags to enable these featurestwixObj.image.flagRemoveOS = True
twixObj.image.flagRampSampRegrid = True
twixObj.refscanPC.flagIgnoreSeg = True
twixObj.refscanPC.flagDoAverage = TrueSome of the auxiliary parts of mapVBVD remain unimplemented. Please feel free to contribute these parts! As this is a port the code is intended to resemble the original matlab code, it is not "good" python code.Credit where credit is dueThis code is a port of Philipp Ehses' original Matlab code. I am incredibly grateful to him for releasing this code to the MR community. There are a number of other names in the original code comments and log, these are: Felix Breuer, Wolf Blecher, Stephen Yutzy, Zhitao Li, Michael VÃlker, Jonas Bause and Chris Mirke.More recent thanks to Mo Shahdloo and Aaron Hess for edits, and Alex Craven for performance enhancements.This port is released under the MIT licence and no credit is sought for its use.
Package: pymarchenko
PyMarchenkoThis Python library provides a bag of Marchenko algorithms implemented on top ofPyLops.Whilst a basic implementation of theMarchenkoalgorithm is available directly in PyLops, a number of variants have been developed over the years. This library aims at collecting
all of them in the same place and give access to them with a unique consistent API to ease switching between them and prototyping new
algorithms.ObjectiveCurrently we provide the following implementations:Marchenko redatuming via Neumann iterative substitution (Wapenaar et al., 2014)Marchenko redatuming via inversion (van der Neut et al., 2017)Rayleigh-Marchenko redatuming (Ravasi, 2017)Internal multiple elimination via Marchenko equations (Zhang et al., 2019)Marchenko redatuming with irregular sources (Haindl et al., 2021)Alongside the core algorithms, these following auxiliary tools are also provided:Target-oriented receiver-side redatuming via MDDMarchenko imaging (combined source-side Marchenko redatuming and receiver-side MDD redatuming)Angle gather computation (de Bruin, Wapenaar, and Berkhout, 1990)Getting startedYou needPython 3.6 or greater.From PyPipip install pymarchenkoFrom GithubYou can also directly install from the main repository (although this is not reccomended)pip install git+https://git@github.com/DIG-Kaust/pymarchenko.git@mainDocumentationThe official documentation of PyMarchenko is availablehere.Visit this page to get started learning about the different algorithms implemented in this library.Moreover, if you have installed PyMarchenko using thedeveloper environmentyou can also build the documentation locally by
typing the following command:make docOnce the documentation is created, you can make any change to the source code and rebuild the documentation by
simply typingmake docupdateOur documentation is hosted on Github-Pages and created with a Github-Action triggered every time a commit is made
to the main branch.
Package: pymarcspec
pymarcspecSummaryAn implementation ofMarcSpecon top ofpymarcfor searching
MARC records.UsageThe idea is to easily use strings to search over MARC without writing complicated
code to handle data.importsysfrompymarcspecimportMarcSearchParserfrompymarcimportMARCReaderparser=MarcSearchParser()spec=parser.parse('650$a$0')withopen(sys.argv[1],'rb')asf:forrecordinMARCReader(f):subjects=spec.search(record)print(subjects)TheTextStyleclass governs how results are combined into strings (or not).
You can subclassTextStyleorBaseTextStyleto do anything you want with combining
the results, or you can handle it yourself.There is also aMarcSearchobject that memoizes each search expression, so that
you can conveniently run a number of different searches without creating several
parsed specs. For example:importcsvimportsysfrompymarcspecimportMarcSearch,TextStylefrompymarcimportMARCReaderwriter=csv.writer(sys.stdout,dialect='unix',quoting=csv.QUOTE_MINIMAL)writer.writerow(['id','title','subjects'])style=TextStyle(field_delimiter=':')marcsearch=MarcSearch(style)withopen(sys.argv[1],'rb')asf:forrecordinMARCReader(f):control_id=marcsearch.search('100',record)title=marcsearch.search('245[0]$a-c',record)subjects=marcsearch.search('650$a',record)writer.writerow([control_id,title,subjects])DevelopmentBuilding the ParserTo build the parser, run:python-mtatsu-omarcparser/parser.pymarcparser/marcparser.ebnfNote that this builds a classMarcSpecParser, which implements the full specification fromMarcSpec, theMarcSearchParseris a subclass
that builds an instance ofMarcSpec; building this structure has some
restrictions for what I needed when I wrote it.Testing for freshnessThe test intest/test_ebnf.pycompiles the parser from the EBNF into a temporary path, which makes sure
that coffee driven programmers like me remember to compile the parser and check in the changes.PerformanceIt is not obvious this is needed.  It may be fine for instance to use XPath expressions.
Suppose we are going to do a lot of these conversions - if XPath is fast enough, the work of converting
from apymarc.Recordto MARCXML will be amoritized by many searches.  Jupyter Notebooks have a %timeit
magic that allows us to check this:Let us check the performance of the simplest such XPath expression:In[34]:%timeit''.join(doc.xpath('./controlfield[@tag="001"]/text()'))19.4µs±1.07µsperloop(mean±std.dev.of7runs,100000loopseach)And compare it to parsing a spec and searching:In[37]:frompymarcspecimportMarcSearchParserIn[38]:parser=MarcSearchParser()In[39]:spec=parser.parse('001')In[40]:spec.search(record)Out[40]:'1589530'In[41]:%timeitspec.search(record)7.89µs±253nsperloop(mean±std.dev.of7runs,100000loopseach)So, from a performance perspective this is clearly a win, and the expression is much closer
to library IT.
Package: pymarine
pymarineA collection of functions and classes for marine sea state modellingThis packages supplies several wave field models which can be used for marine applications.InformationThis projects gives a collection of spectral functions. It comes with the following moduleswave_spectra : A set of functions to create wave spectra and distribution functionswave_fields : Create and simulate 1D and 2D waves based on thewave_spectramoduleNoteThis project has been set up using PyScaffold 4.5. For details and usage
information on PyScaffold seehttps://pyscaffold.org/.
Package: pyMARIO
MARIO: single-cell proteomic data matching and integration pipelineDescriptionThis github repo includesmario-pyandmario-R, which is a Python package for matching and integrating multi-modal single cell data with partially overlapping features. The method is specifically tailored toward proteomic datasets, and for detailed description on the algorithm, including the core methodology, mathmetical ingredients, application on various biological samples, and extensive benchmarking, please refer to thepaper.This work has been lead by Shuxiao Chen fromZongming Lab@Upenn and Bokai Zhu fromNolan lab@Stanford.Getting StartedDependenciesFor easy usage, we suggest builing acondavirtualenv withpython = 3.8.conda create -n mario python=3.8InstallingTo installMARIO, we can easily install it withpipfunction (package namepyMARIO):python -m pip install pyMARIOHow to useQuick example:To use inMARIOinpython:from mario.match import pipelined_mario
final_matching_lst, embedding_lst = pipelined_mario(data_lst=[df1, df2])Wheredf1anddf2are two dataframes for match and integration, with row as cells, columns as features. Remember for shared features, the column names should be identical. Input list can be multiple dataframes, asMARIOaccomodates for multiple dataset match and integration.The result contains the a matching list (matching), and a embedding list (integration). For detailed usage please refer to the Full tutorial section.Similarly, to use inMARIOinR(with packagereticulate) :library(reticulate)
myenvs=conda_list() # get conda virtualenv list
envname=myenvs$name[12] # specify which virtualenv to use, should use the one for MARIO
use_condaenv(envname, required = TRUE)
mario.match <- import("mario.match") # import main mario-py module

pipelined_res = mario.match$pipelined_mario(data_lst=list(df1, df2))Where the result also contains the matching list and embedding list.Full tutorial:For step by step tutorials on how to useMARIO, with fine-tuned parameters for optimal results and full functionality, please refer to the documents we provided here:Python - Jupyter notebook: Match and Integration of Human Bonemarrow datasetsPython - Jupyter notebook: Match and Integration of multiple Xspecies datasetsR - Rmarkdown: Match and Integration of Human Bonemarrow datasetsLicense and CitationMARIOis under theAcademic Software License Agreement, please use accordingly.
Package: pymarkdown_minisite
Usage:parse_and_list_markdown_files.py [options] “YOUR WEBSITES NAME” PATH_TO_YOUR_FILES_DIRhttp://YOUR_WEBSITES.URLfor default usage, orparse_and_list_markdown_files.py –helpfor getting helpOptions:–help - get help–force-update - reparse all sites and update all date tags.Examples:parse_and_list_markdown_files.py “pyMarkdown Minisite” .http://draketo.de/proj/pymarkdown_minisite/index.htmlParse the site of this script.Plans:If an index.mdwn is present use that instead of parsing one ourself.Ideas:Too many, so I keep them out just now :)Website: U{http://draketo.de/proj/pymarkdown_minisite/}Source URL (Mercurial): U{http://freehg.org/u/ArneBab/pymarkdown_minisite/}PyPI URL: U{http://pypi.python.org/pypi/pymarkdown_minisite}Changelog:pymarkdown_minisite 0.2Added the option to create a table of content (“[TOC]” as marker).Requires at least python-markdown 2.0 (because of the [TOC]).Only build an index, if no index.mdwn file is present (allows for customizing the index at some place).Added the option to parse files with several different suffixes - currently .mdwn and .txtUpdated help/usage output.Added simple_usage and improved readme.Added copyright entry in Python style.Added static website information for PyPI.Moved project tohttp://draketo.de/proj/pymarkdown_minisite/FIX: Now it takes utf-8 content correctly.FIX: Usage as Mercurial hook failed with relative source dir.pymarkdown_minisite 0.1.2Added the –force-update option which tells the script to parse ALL files again and update all date lines.Added date lines which automatically get updated when the content changes.pymarkdown_minisite 0.1.1Smaller fixes for things which showed themselves after the upload.pymarkdown_minisite 0.1Added Python implementation and uploaded it to PyPI.
Package: pymarkdownsax
OverviewThis module provides SAX-like functionality for reading MarkDown syntax.
Uses reading of tokens separately. Therefore the text below will be confusing for it.ThisText[Name](link)Addiotionally support for embedding was added. It is translated into iframe.$[Name](link)There is also a special case of embedding YouTube. YT has to be specified before the brackets. A YouTube video name can be specified inside of the first brackets. The YouTube video id has to be specified later.$YT[](id)Notice: It is still under heavy development.APIclass PyMarkDownSaxReading a filedef parse(self, file_name):Parses a file name.def parse_data(self, data = None):Parses string of data.Parse functionsdef startElement(self, tag, attributes):Indicates start of a block.def endElement(self, tag):Indicates end of a block.def characters(self, token):Indicates that characters were processed. Every word is called separately. Whitespaces are called separately.class PyPanDoc2HtmlReading a filedef __init__(self, from_file, to_file):The class goal is to translate MarkDown files to HTML.LimitationsThe implementations uses regular expressions here and there, which might not necessarily be
the best way to process the text.PyMarkDownSaxUses reading of tokens separately. Therefore the text below will be confusing for it.ThisText[Name](link)PyMarkDownSax2HtmlAn image inside of link is supported, however it only uses link name from link and link name from image.[ ![](img_link) ](a_link)
Package: pymarkdown-video
pymarkdown-videoExtension forpython-markdown, that will convert markdown picture that are vide
file into the HTML5videotag instead of theimgtag.Example![Big Buck Bunny](http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 "Big Buck Bunny video")will be rendered as<p><videoalt="Big Buck Bunny"controls="controls"title="Vidéo de Big Buck Bunny">Your browser does not handle the video<ahref="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4">http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4</a><sourcesrc="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"type="video/mp4"></source></video></p>Usagepipinstallpymarkdown-videofrommarkdownimportMarkdowntext='![Big Buck Bunny](http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 "Big Buck Bunny video")'md=Markdown(extensions=['pymarkdown-video'])print(md.convert(text))You can also use it withMkDocs.After installing the package with pip, in yourmkdocs.yml, add:markdown_extensions:-pymarkdown-video
Package: pymarker
PyMarkerA python package to generate AR markers and patterns based on input images.InstallationPyMarker is available through pip andPypi.python3-mpipinstallpymarker--user
//or
pip3installpymarker--userUsagePymarker provides two features for a marker-based AR, generating Pattern files (.patt) and Markers (.png). The marker will be used by the user to visualize some augmented reality, the pattern file for the system to be able to recognize the marker.An example input image:Expected output patt:Expected output marker:CommandsBy default pymarker receives an image and generate both patt and marker$pymarkertests/input/hiro.jpgHowever, if needed the flag-por--pattcan gerate only the patt file for the input:$pymarker-ptests/input/hiro.jpg
//or
$pymarker--patttests/input/hiro.jpgThe same can happen for markers using the-mor--markerwhich generates only the marker:$pymarker-mtests/input/hiro.jpg
//or
$pymarker--markertests/input/hiro.jpgThe marker border size can be adjusted with-b, the default value being 50%.$pymarker-b40tests/input/hiro.jpgModulesYou can use the functions directly from your python code to generate markers and patts.from pymarker.core import generate_patt, generate_marker

def main():
    filename = "tests/input/hiro.jpg"
    border_size = 50 // size in percentage

    generate_patt(filename)
    generate_marker(filename,border_size)
Package: pymarket
PyMarketPyMarket is a python library designed to ease the simulation and
comparison of different market mechanisms.Marketplaces can be proposed to solve a diverse array of problems. They
are used to sell ads online, bandwith spectrum, energy, etc.
PyMarket provides a simple environment to try, simulate and compare different
market mechanisms, a task that is inherent to the process of establishing a new
market.As an example, Local Energy Markets (LEMs) have been proposed to syncronize energy consumption
with surplus of renewable generation. Several mechanisms have been proposed for such a market:
from double sided auctions to p2p trading.This library aims to provide a simple interface for such process, making results reproducible.Getting Startedimportpymarketaspmimportnumpyasnpr=np.random.RandomState(1234)mar=pm.Market()bids=pm.datasets.uniform_bidders.generate(20,20,1,1,r)forbinbids:mar.accept_bid(*b)mar.plot()Access the bidsbids=mar.bm.get_df()bids.head()quantity   price  user  buying  time  divisible
0    0.2374  1.0234     0    True     0       True
1    0.1784  1.1770     1    True     0       True
2    0.6301  1.5789     2    True     0       True
3    0.1600  1.8008     3    True     0       True
4    0.7920  1.5478     4    True     0       TrueRun a market algorithmtransactions,extra=mar.run('p2p',r=r)transactions=transactions.get_df()transactions.head()bid  quantity   price  source  active
0   16    0.0000  0.0000      34    True
1   34    0.0000  0.0000      16    True
2    0    0.0000  0.0000      23    True
3   23    0.0000  0.0000       0    True
4   12    0.0786  1.3828      26   FalseDocumentation and ExamplesDocs can be found here (click me!)Installationpipinstallpymarket
Package: pymarketcap
pymarketcappymarketcap is a library for retrieve data fromcoinmarketcapAPI and website. Consist
of a cythonized scraper and and API wrapper built with libcurl, but is
posible to compile a lightweight version with standardurllibInstallYou need to installcythonbefore pymarketcap. Try:pip3 install Cythonand then:pip3 install pymarketcapOn Windows,urllibwill be used library by default to make synchronous requests whereas that on Linux/Mac will be built usinglibcurlC library. You can control this (see below):From sourcegit clone https://github.com/mondeja/pymarketcap.git
cd pymarketcap
pip3 install -r requirements.txt
python setup.py installTo force installation with libcurl, use--force-curlin last command.To install with urllib, use--no-curl.DocumentationStatic documentation at Readthedocs.Live running notebook hosted at Binderhub.ContributingTestingChangelogLicenseSupportIssue Tracker:https://github.com/mondeja/pymarketcap/issuesmondejar1994@gmail.com
Package: pymarketstack
pymarketstackPymarket is a simple python library for theMarketstackAPI. It’s a requirement to have a valid API token, the free version or a paid alternative, seePricing. Needless to say, this is not an official library.Available featuresThe different features marketstack supports can be found on marketstack’sdocumentation.End of DataGets the stock data after the market has closed.
Supports 3 alternatives:All: Downloads all data.Latest: Downloads the data corresponding to the last date.Date: Downloads a specific range of data.Intraday dataNot yet implemented.Splits dataNot yet implemented.Dividends dataNot yet implemented.TickersNot yet implemented.ExchangesNot yet implemented.CurrenciesNot yet implemented.TimezonesNot yet implemented.UsagefrompymarketstackimportEndOfDay,downloadquery=EndOfDay.query(token="your api token")data,failed=download(query,"AAPL","XEL",...)Here the first line will just create the request with the appropriate fields, the download function will return a tuple with a Response object and a list of strings corresponding to failed tickers. The query function has several options such as the usage of HTTPS, etc.
If you want to check how much quota downloading the symbols will take, you can use the quota function as follows:frompymarketstackimportEndOfDay,quotaquery=EndOfDay.query(token="your api token")q:int=quota(query,"AAPL","XEL",...)An end of data request will return 2 things, aPaginationobject and a list ofDataobjects. Both of which are wrapped
in aResponseobject.ResponsesclassResponse:pagination:Paginationdata:List[Data]The data field is overall the most interesting one and contains a single date of data for each ticker. The fields include things like date, symbol, open, close, high, low, among others. All the fields are listed in thedocumentation.In case of an error the library will raise an exception corresponding to the common API error codes.
An example API response could be:{"pagination":{"limit":100,"offset":0,"count":100,"total":9944},"data":[{"open":129.8,"high":133.04,"low":129.47,"close":132.995,"volume":106686703.0,"adj_high":133.04,"adj_low":129.47,"adj_close":132.995,"adj_open":129.8,"adj_volume":106686703.0,"split_factor":1.0,"dividend":0.0,"symbol":"AAPL","exchange":"XNAS","date":"2021-04-09T00:00:00+0000"},[...]]}which would be equivalent toResponse(pagination=Pagination(limit=100,offset=0,count=100,total=9944),data=[Data(open=129.8,high=133.04,low=129.47,close=132.995,volume=106686703.0,adj_high=133.04,adj_low=129.47,adj_close=132.995,adj_open=129.8,adj_volume=106686703.0,split_factor=1.0,dividend=0.0,symbol="AAPL",exchange="XNAS",date=datetime.datetime(2021,4,29)),...])due to the usage of dataclasses-json, Response, Pagination, and Data are serializable to/from dicts and json strings.DependenciesThe dependencies used are listed in the requirements.txt package file but the main ones are:aiohttpdataclasses-jsonmarshmallowLicenseApache 2.0, see the LICENSE file for more details.
Package: pymarketwatch
pymarketwatchA Python libary to interact with the MarketWatch Stock Market Game
Based on code fromhttps://github.com/kevindong/MarketWatch_API/Examplefrom pymarketwatch import MarketWatch

api = MarketWatch("email", "password", "game-name-from-url", True)
api.buy("AAPL", 100)

print(api.get_pending_orders())
print(api.get_positions())