Saravanan666/pypi-org huggingface dataset:
Package: py-quantaq
py-quantaqA python wrapper for the QuantAQ RESTful APIInstallationInstall directly from PyPI:$pipinstall-Upy-quantaqOr, install the library directly from GitHub:$pipinstallgit+https://github.com/quant-aq/py-quantaq.gitDocsDocumentation is in progress, but can be foundhere.AuthenticationTo use the API, you must first have an API key. You can obtain an API key from theuser dashboard. Once you create a new API key, make sure to keep it secret! The easiest way to do this is to save your key as an environment variable. This process is unique to each OS, but many tutorials exist online. For Mac, do the following:Using your editor of choice, open up your.bash_profile:# open up your bash profile$nano~/.bash_profileNext, save the API key as an environment variable:# add a line with your API KeyexportQUANTAQ_APIKEY=<your-api-key-goes-here>Finally, source your.bash_profile:$source~/.bash_profileNow, you shouldn't ever have to touch this again or remember the key!TestsTo run the unittests:$poetryrunpytesttestsor, with coverage$poetryrunpytesttests--cov=quantaq--cov-reportterm-missing-sTests are automagically run via github actions on each build. Results and coverage are tracked via Code Coverage which can be viewed by clicking on the badge above.
Package: pyQuASAR
pyQuASARWrap quasar for pipelinesInstallationFirst make sure you have followed the installation procedure forpydbsnp. Then installpyQuASARwithpip3:pip3installpyQuASARorpip3install--userpyQuASAROnce pyQuASAR is installed, runpyQuASAR-downloadto download QuASAR and
the SNPs file.pyQuASAR-downloadNowpyQuASARis ready to go!
Package: pyQuASAR-genotype
pyQuASAR_genotypeCommand line tool for genotyping with QuASAR. Infer genotypes from ChIP-seq or
ATAC-seq data.InstallationFirst, follow the installation steps forpyQuASARandwasp_map. Then:pip3installpyQuASAR_genotypeorpip3install--userpyQuASAR_genotype
Package: pyquatlib
pyquatlibJust another library for quaternions.
With focus on usability.InstallationAssuming you usepipto manage your python installation,
you can install this package simply aspipinstallpyquatlibIn order to install a virtual environment,
change to the code directory, and runmakeinitBasic usageThe full documentation can be generated withmakedocsThe following are mostly for the purposes of example.There are several ways to create a Quaternion:>>>fromquaternionsimportQuaternion>>>importnumpyasnp>>>Quaternion(np.array([1,-2,3]))Quaternion:((0,array([1,-2,3])))>>>Quaternion((0,np.array([1,2,3])))Quaternion:((0,array([1,2,3])))Left and right operations with compatible data structures are supported.>>>data=np.full((4,3),[1,2,3])>>>dataarray([[1,2,3],[1,2,3],[1,2,3],[1,2,3]])>>>data-Quaternion([2,1,1,1])[Quaternion:((-2,array([0,1,2]))),Quaternion:((-2,array([0,1,2]))),Quaternion:((-2,array([0,1,2]))),Quaternion:((-2,array([0,1,2])))]>>>Quaternion([1,0,-1,0])+data[Quaternion:((1,array([1,1,3]))),Quaternion:((1,array([1,1,3]))),Quaternion:((1,array([1,1,3]))),Quaternion:((1,array([1,1,3])))]>>>data*Quaternion(np.array([1,2,3,4]))[Quaternion:((-20,array([0,4,2]))),Quaternion:((-20,array([0,4,2]))),Quaternion:((-20,array([0,4,2]))),Quaternion:((-20,array([0,4,2])))]>>>Quaternion([0,1,-1,-1])/data[Quaternion:((-0.2857142857142857,array([0.07142857,0.28571429,-0.21428571]))),Quaternion:((-0.2857142857142857,array([0.07142857,0.28571429,-0.21428571]))),Quaternion:((-0.2857142857142857,array([0.07142857,0.28571429,-0.21428571]))),Quaternion:((-0.2857142857142857,array([0.07142857,0.28571429,-0.21428571])))]Several conversion functions from compatible data structures are also included.
For example, to convert an (n,3) array to a list of Quaternions, useto_quaternion:>>>vectors=np.random.rand(100,3)>>>vectorsarray([[0.02219696,0.61847575,0.68714365],[0.56104393,0.3529833,0.8188565],...[0.38190174,0.59151826,0.37396559]])>>>Quaternion.to_quaternion(vectors)[Quaternion:((0.0,array([0.02219696,0.61847575,0.68714365]))),Quaternion:((0.0,array([0.56104393,0.3529833,0.8188565]))),Quaternion:((0.0,array([0.84834741,0.02304604,0.33619428]))),...Quaternion:((0.0,array([0.38190174,0.59151826,0.37396559])))]Bug reports and feature requestsBug reports and feature requests are entirely welcome.
The best way to do this is to open anissue on this code's github
page.  For bug reports,
please try to include a minimal working example demonstrating the
problem.Pull requestsare also entirely welcome, of course, if you have an idea where the
code is going wrong, or have an idea for a new feature that you know
how to implement.This code is routinely tested on recent versions of Python 3.*
Test coverage is quite complete.
Package: pyquats
pyquats packagePython implementation of quaternions is presented.Modulespyquats.quats - Quat classpyquats.numpyquats - Quat class using numpy (slow)pyquats.qmath - mathematical functions for quaternions
[sgn(q), exp(q), log(c), sin(q), cos(q), sinh(q), cosh(q)]pyquats.qtools - rotations, random unit quaternionsDownloadTo install an official release dopython3 -m pip install pyquatsTo get the git version dogit clone https://github.com/ufkapano/pyquats.gitUsageSee doc/quickstart.txt>>>frompyquats.quatsimportQuat>>>ii=Quat(0,1)>>>jj=Quat(0,0,1)>>>kk=Quat(0,0,0,1)>>>ii*jj==kkTrue>>>ii**2==jj**2==kk**2==-1True>>>all(q.is_unit()forqin(Quat(1),ii,jj,kk))True>>>p=Quat(5.0,2.5,-3.6,4.9)>>>p.conjugate()Quat(5.0,-2.5,3.6,-4.9)>>>~pQuat(0.0732922896511287,-0.03664614482556435,0.052770448548812667,-0.07182644385810613)>>>p*~pQuat(1.0,0.0,-2.7755575615628914e-17,5.551115123125783e-17)>>>list(p)[5.0,2.5,-3.6,4.9]ContributorsAndrzej Kapanowski (project leader)Jan Ferdyan (quaternion functions)References[1]http://en.wikipedia.org/wiki/Quaternion[2] Real Quaternionic Calculus Handbook,
João Pedro Morais, Svetlin Georgiev, Wolfgang Sprößig,
Birkhäuser Basel 2014.EOF
Package: pyquay
# InstallationGo to the source` cd pyquay python setup.py sdist pip installdist/pyquay-<VERSION>.tar.gz`# UsageDo the following to instantiate a Client class that will allow you to communicate with a Quay API:` from pyquay import Client c = Client(token) `Params:
- token (str): Refers to the token used in the Authorization header## security
This grabs a json blob of all vulnerabilities associated with an image.` tenants = c.security(repo, imageid) `# CLI
quaycli.py security get_vulnerability_list –token=token –repo=repo –image=image id
Package: pyqubits
pyqubitsA Python module for quantum computing simulations.Setup$ git clone https://github.com/tombch/pyqubits.git
$ cd pyqubits/
$ conda env create -f environment.yml
$ conda activate pyqubits
$ pip install .UsageCreating aQuantumState>>>frompyqubitsimportQuantumState>>>s=QuantumState(3)>>>t=QuantumState.from_bits('00')Viewing aQuantumState>>>sQuantumState([-0.29615118+0.50152956j,0.37355584-0.06041027j,0.40094705-0.13785654j,-0.17540328-0.25628919j,-0.26399075+0.28541768j,0.11632225-0.12028472j,0.08627474-0.14452522j,0.04189382+0.17920989j])>>>s.vectorarray([-0.29615118+0.50152956j,0.37355584-0.06041027j,0.40094705-0.13785654j,-0.17540328-0.25628919j,-0.26399075+0.28541768j,0.11632225-0.12028472j,0.08627474-0.14452522j,0.04189382+0.17920989j])>>>print(s)=(-0.29615+0.50153j)|000>+(0.37356-0.06041j)|001>+(0.40095-0.13786j)|010>+(-0.1754-0.25629j)|011>+(-0.26399+0.28542j)|100>+(0.11632-0.12028j)|101>+(0.08627-0.14453j)|110>+(0.04189+0.17921j)|111>>>>print(s.circuit)1---2---3--->>>print(s.dist)0000.34|=================0010.14|=======0100.18|=========0110.1|=====1000.15|========1010.03|=1100.03|=1110.03|==>>>tQuantumState([1.+0.j,0.+0.j,0.+0.j,0.+0.j])>>>t.vectorarray([1.+0.j,0.+0.j,0.+0.j,0.+0.j])>>>print(t)=(1+0j)|00>>>>print(t.circuit)1---2--->>>print(t.dist)001.0|==================================================010.0|100.0|110.0|Manipulating aQuantumState>>>t.H(1)QuantumState([0.70710678+0.j,0.+0.j,0.70710678+0.j,0.+0.j])>>>t.CNOT(1,2)QuantumState([0.70710678+0.j,0.+0.j,0.+0.j,0.70710678+0.j])>>>print(t)=(0.70711+0j)|00>+(0.70711+0j)|11>>>>print(t.circuit)1---H---O---|2-------X--->>>print(t.dist)000.5|=========================010.0|100.0|110.5|=========================>>>t.measure(1)QuantumState([1.+0.j,0.+0.j,0.+0.j,0.+0.j])>>>result=t.bit>>>result0>>>print(t)=(1+0j)|00>
Package: pyqubole
# IntroductionSimple script to turn on qubole clusters## UsageTo access qubole’s API, you’ll have to obtain an API key`bash exportQUBOLE_TOKEN=<APIKEY> `To get the status of cluster`bash qubole state--clusterUSERNAME `Example`bash qubole state--clusterwesley Cluster wesley UP Ganglia:https://us.qubole.com/ganglia-metrics-19436/`Toggle cluster betweenUPandDOWNstate` qubole toggle--clusterUSERNAME `## Installation` pip install pyqubole `# License
Package: pyquchk
pyquchk- random and serial testingpyquchk(abbreviated from Python QuickCheck) is the most comprehensive
and extensible, altrough easy-to-use, random and serial testing framework.
As you see from the name, it’s inspired byHaskell QuickCheck,
but aims to provide much more capabilities.Full documentation, including usage examples, is available atpythonhosted.org/pyquchk.FeaturesAlready implementedpyquchkcombines two approaches to the arguments values generation in a
single framework:QuickCheck-like (random)Random (fuzzy) testing runs a function for many randomly generated arguments
values to make sure it’s generally correct. Some features (both from the
original QuickCheck and unique topyquchk)SmallCheck-like (serial)Serial testing means that values are generated starting with some edge cases and
small ones. This exhausts all possible values up to some “size” and is
deterministic, in contrast to the random approach. Serial testing nicely
complements the random one and so gives more confidence that the function tested
is correct.Other notable features include:a lot of configurable built-in generators for different value types
(seearbitrariesfor the list of currently implemented generators)custom generators are supported, both for built-in types and user-created oneseasy-to-write and read syntax for simple property checking as well as for full
tests to be run with a framework (noseorpy.testfor example)pyquchkattempts to give you the smallest available counterexample,
always performing shrinkg of the generated value (and if a value is found with
serial testing, it’s probably already minimal)assumefunction (allows so-called conditional properties and much more)Easy creation of Arbitraries combinationsExamples: string from list; tuple with equally-sized strings.Plannedpyquchkis in active development, and I have many features to implement
here:Option to check forexists, notfor_allTests timingShow time spent in pyquchk code and in tested functionSupport generators arguments depending on other generators valuesSomething likeforAllin original QuickCheck, but everything is to be defined as the function
default arguments.
Example: integer from the range[0:len(list)].Size supportGeneration function takessizeparameter which increases(from 0 to 1?)from the first to
the last test. Exploresized,resizeand so on from QuickCheck - whether they will fit here.Look for best way to express:Modifiers like positive/negative/nonempty/…Different numbers distributions like uniform/exponential/…Structures likedeff(a={int:[str_(...)]},b=[float],c={'x':int, 'y': list})Any use for Python 3 annotations?Better testing pyquchk itselfSmart shrink from QuickCheck, SmartCheckCollect, classify, coverNot only boolean parameters (label/no label), but numerical as well.
Example: difference between approximate function result and the exact one.Verbosity settingsPrint seed and allow to change itDon’t fail fastAdd timeout
Package: pyqudit
PyQuditPyQudit is a Python package for using generalised and universal versions of quantum gates, in N-dimensions. Enables building simple quantum circuit simulations on qudit logic using higher dimensional gates.Getting StartedConceptMainstream QuantumComputing uses qubits which operate in a two dimensional
Hilber space. Qudits are their higher dimensional equivalents with better
informaiton density and potential for hgher efficiency.
PyQudit includes the qudit versions of fundamental quantum gates,
useable over any dimension*as specified by the user.
It can be used to understand the behaviour of qudit gates as also to build
higher dimensional circuits for experimentation.*refer gate functionsInstallThe latest stable version of PyQudit is available on PyPI and can be installed with pip.
It is recommeded to install in your quantum computing python environment, alongside existing packages.pipinstallpyquditBuild LocallyAlternatively, you can build the package wheel from source and then install it via pip.pip3 install --upgrade pip
pip3 install --upgrade setuptools
git clone https://github.com/Ordoptimus/pyqudit.git
cd pyqudit
python3 setup.py bdist_wheelReplace [version] with the latest version as seen in the wheel file in /bdist_wheelpip3 install dist/pyqudit-[version]-py3-none-any.whlUseimportpyqudit.quditaspqUsedir(pq)to show all package methods.Sample>>> import pyqudit.qudit as pq
>>> d = int(input('Enter Dimensions: '))
Enter Dimensions: 3
>>> print("\n---CX's Pauli Matrix---")
>>> print(pq.CXd_pauli(d))
---CX's Pauli Matrix---
[[1 0 0 0 0 0 0 0 0]
 [0 1 0 0 0 0 0 0 0]
 [0 0 1 0 0 0 0 0 0]
 [0 0 0 0 0 1 0 0 0]
 [0 0 0 1 0 0 0 0 0]
 [0 0 0 0 1 0 0 0 0]
 [0 0 0 0 0 0 0 1 0]
 [0 0 0 0 0 0 0 0 1]
 [0 0 0 0 0 0 1 0 0]]DocumentationRefer theofficial documentationfor detailed examples and syntax.
Package: pyque
pythonic devops toolbelt.consider this beta.
its dogfed and somehow tested, but shipped without warrantyAPI MIGHT CHANGE UNTIL V 1.0 (yes i am serious)Requirementsfor MySQL support:MySQL-python>=1.2.4mysqldumpfor PostgreSQL support:psycopg2>=2.5pg_dumpInstallationwith pip:$ pip install pyqueor:$ easy_install pyqueor checkout from github:$ git clone https://github.com/bmaeser/pyque.git
$ cd pyque
$ python setup.py installExampleCreate a gziped MySQL dump of every database on localhost for user ‘backupuser’.
chmod backup to 400 and rotate it away and keep 7 versions of this backup:import os

from pyque.db.mysql import db_list, dump
from pyque.sh import gzip, chmod
from pyque.utils import rotate

username = 'backupuser'
password = 'test'
tmppath = '/tmp'
backupdir = '/tmp/backups'
excludes = ['performance_schema', 'information_schema']

for db in db_list(username = username, password=password):
    if db in excludes:
        continue
    dumpfilename = os.path.join(tmppath,db) + '.sql'
    dump(dumpfilename, dbname=db, username=username, password=password)
    retcode, output, newfilepath = gzip(dumpfilename)
    chmod(newfilepath, '400')
    rotate(newfilepath, backupdir, max_versions=7)Contributecontributions welcomepull-request please and/or create a issue on githubLICENCEThe MIT License (MIT)
Copyright © 2013 Bernhard Mäser,http://bmaeser.ioPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Package: pyquebec
Helper to consume a database from the REPL.Dependencies:pypyodbctabulateConfiguration file database.ini. A template is included in the source.Full documentation available inhttps://github.com/sebasmonia/pyquebec/wikiSample:>>> from pyquebec import pyquebec
>>> from pyquebec import formatters as pf
>>> pyquebec.add('SampleDB', 'connection string here', 'MSSQL') # first use
>>> db = pyquebec.open('SampleDB') # after using add, the db config and schema is cached
>>> db.dbo.<TAB KEY>
db.dbo.Table1  db.dbo.Table2
db.dbo.Table3  db.dbo.Table4
>>>result = db.dbo.Table1.From().go()
>>> pf.to_html(result)
Creating and opening temp file C:\Users\smonia\AppData\Local\Temp\tmpn3g43ppp.htm
>>> pf.to_csv(result)
Creating and opening temp file C:\Users\smonia\AppData\Local\Temp\tmpe68shxd9.csv
>>> result[0]
row(column1=datetime.datetime(2015, 5, 13, 23, 34, 58, 77000), column2=59, column3=29, column4='Sample')Pypyodbc returns tuples. This library converts them to namedtuples for increased readability and to make it easier to keep playing with the data using filter, map, sorted, etc.There’s a third option in the formatters that uses tabulate for output to_console().
Both HTML and CSV options create a temp file and use os.startfile (in Windows you get the default browser and, usually, Excel).Roadmap (help/guidance appreciated!):Tested with MSSQL and SQLite. With some configuration should support other engines, and ideally the config should be included in the package.The API for querying might need a few tweaks. Suggestions are welcome.Decide on other SQL features to support beyond basic querying. UPDATES, INSERTS, GROUP BY, etc, would it make sense? Would this make supporting other products more difficult?Needs more unittest!Contributors:
SebastiÃ¡n MonÃ­a -http://github.com/sebasmoniaFernando Antivero -http://github.com/ferantivero
Package: py-querybuilder
Py-QueryBuilderQuery builder forPythonapplications, designed to work with the same data structure generated byMUI-QueryBuilder.InstallationPy-QueryBuilder is available as apypi package.pipinstallpy-querybuilderUsageHere is a quick example to get you started.
First you'll need atemplatesfolder in your module, containingJinja2templates with a{{ where }}placeholder:SELECT*FROMmy_tableWHERE{{where}}You can now rely on theQueryBuilderclass to render queries:frompy_querybuilderimportQueryBuilderqb=QueryBuilder("app.articles",[{"label":"Article","options":[{"label":"Title","value":"title","type":"text",},{"label":"URL","value":"url","type":"text",},],},])sql_query,sql_params=qb.render("query.sql",{"combinator":"and","rules":[{"field":"title","operator":"contains","value":"Brazil",},],})The query is generated withJinjaSQL, a template language for SQL statements and scripts.
Since it's based inJinja2, you have all the power it offers: conditional statements, macros, looping constructs, blocks, inheritance, and more.
We usesqlparseto format the queries.SELECT*FROMmy_tableWHEREtitle~*?AS"Title"The default operators used for generating queries are:{"after":">","after_equal":">=","before":"<","before_equal":"<=","contains":"~*","greater":">","greater_equal":">=","equal":"=","in":"in","less":"<","less_equal":"<=","not_contains":"!~*","not_equal":"!=","not_in":"not in","not_null":"is not null","null":"is null",}In case the database you're targeting uses different operators, it's possible to customize those atQueryBuilder's instantiation:qb=QueryBuilder(my_module,my_query,operators={# Custom operators.})SQL parameters are returned fromrender()in a list of values corresponding to the placeholders that need to be bound to the query.print(sql_params)# ["Brazil"]Finally, you can now use the SQL query and its bind parameters to fetch data.
For example, in Django, you would do something like this:fromdjango.dbimportconnectionwithconnection.cursor()ascursor:cursor.execute(sql_query,sql_params)forrowincursor.fetchall():# Do something with the results.passAPICheck out the Py-QueryBuilder's APIhere!
To learn more about the query's data structure, and how filters and operators work, please refer toMUI-QueryBuilder's documentation.LicenseThis project is licensed under the terms of theMIT license.
Package: pyquerylist
pyquerylistExtension of base Pythonlistthat you can query. Queries are chainable and invertable with logical operators (& | ~). Simple operations such as.where(...), to filter,.select(...)to choose fields, and.aggregate(...)to e.g. sum over a field are supported..groupby(...)can be also used to.count()and.aggregate(...)QueryLists as well.InstallationpipinstallpyquerylistDocumentationDocumentation is available athttp://markmuetz.github.io/pyquerylist/.example.pyfromdataclassesimportdataclassfrompyquerylistimportQueryasQ,QueryList@dataclassclassBook:name:strprice_pence:intcategory:strdefprice(self):returnself.price_pence/100defvat_price(self):returnself.price()*1.2books=QueryList([Book('Three crows',500,'fantasy'),Book('Molly had a little calf',200,'child'),Book('Time for another',150,'bargain'),Book('Of stars and mud',700,'highbrow'),Book('The Fruggalo',300,'child'),Book('Three women in a canoe',120,'classic'),Book('Who turns the page',700,'mystery'),Book('The sword of silver',300,'fantasy'),Book('Murder at 30000 ft',150,'mystery'),Book('Once I saw a little mouse',50,'child'),Book('The Leonardo code',20,'bargain'),Book('The place we are at',900,'highbrow'),])if__name__=='__main__':print(books.count())# books can be filtered on one of their fields.print(books.where('name=="The Fruggalo"').count())# This can also be done using a query.print(books.where(Q('name=="The Fruggalo"')).count())# Queries can be inverted.print(books.where(~Q('name=="The Fruggalo"')).count())# books is a list -- can be indexed or sliced:print(books[:3])# books can be filtered on multiple fields, showing price <= 3.# if a field is a function (is callable) - it will be called (i.e. price).print(books.where('(category=="fantasy")&(price<=3)'))# Equivalent to above using combined queries.print(books.where(Q('category=="fantasy"')&Q('price<=3')))# These are equivalent, but not considered equal due to different definition.print(Q(lambdax:x.price<=5)!=Q('price <= 5'))# Queries can be combined using logical operators, and ordered by field(s).print(books.where(Q('category in ["fantasy", "mystery"]')|Q('price <= 3')).orderby('price',order='descending').select(fields=['category','price']))# `lambda`s can be used, and fields can be chosen using `.select(...)`.print(books.where(Q('category == "fantasy"')|Q(lambdax:x.price()*2<=6)).select(fields=['category','price']))# Select can also take a function/lambda:print(books.select(func=lambdab:b.price()*2))# Simple aggregate operations available.print(books.aggregate(sum,'price'))print(books.aggregate(sum,['price','vat_price']))# Simple group by operator (returns a dict subclass), with group operations count and aggregate.print(books.groupby('category')['mystery'])print(books.groupby('category').count())print(books.groupby('category').aggregate(sum,'price'))# QueryLists can be formatted for tabular display.print(books.where('category=="fantasy"').tabulate(['name','price']))