Saravanan666/pypi-org huggingface dataset:
Package: peewee-seed
# peewee_seedpeewee_seed is a seed library which provides initial data to database using peewee.With reference to the [Django fixture](https://docs.djangoproject.com/en/2.1/howto/initial-data/)[![CircleCI](https://circleci.com/gh/takehaya/peewee_seeds.svg?style=svg)](https://circleci.com/gh/takehaya/peewee_seeds)[![PyPI version](https://badge.fury.io/py/peewee-seed.svg)](https://badge.fury.io/py/peewee-seed)## usage### simple seeds- file envs```/myapp__init__.pyseeds_entry.pymodels.py/fixturesaccounts.yaml`````` yaml# accounts.yaml- model : myapp.models.Accountid: 1fields:first_name: Johnlast_name: Smithage: 20``````python# models.pyfrom peewee import CharFieldfrom peewee import IntegerFieldfrom peewee import Modelfrom peewee import SqliteDatabasedatabase = SqliteDatabase(":memory:", pragmas={"foregin_keys": 1})class BaseModel(Model):class Meta(object):database = databaseclass Account(BaseModel):first_name = CharField(null=False)last_name = CharField(null=False)age = IntegerField(null=True)```- seeds entry file``` python# seeds_entry.pyfrom peewee_seeds import PeeweeSeedfrom myapp.models import databasedef main():path = '/path/to/fixtures'# seeds instanceseeds = PeeweeSeed(database, path, ['accounts.yaml'])# load fixture for create tableseeds.create_table_all()# load fixture for db inputseeds.db_data_input()if __name__ == '__main__':main()```- Run command```python seeds_entroy.py```### other example```pythonfrom peewee_seed import PeeweeSeedfrom myapp.models import database# seeds instanceseeds = PeeweeSeed()# set pathseeds.set_path('/path/to/fixtures')# set use fixture nameseeds.set_fixture_files(['accounts.yaml', 'pictures.yaml'])# loading fixture file datafixtures_row_data = seeds.load_fixture_files()# fixture  purificationfields, models_namelist = seeds.load_fixture(fixtures_row_data[0])# fixtures purificationfields, models_namelist = seeds.load_fixtures(fixtures_row_data)# set database sessionseeds.set_database(database)# base on fixtures, create tablesseeds.create_table_all()# fixtures data to db inputseeds.db_data_input(fixtures_row_data)# base on fixtures, drop tablesseeds.drop_table_all()```### direct inputdata seed``` python# body is dict data# create & seedseed = PeeweeSeed(db)_, models = seed.load_fixtures([body])seed.create_table_all(models)seed.db_data_input([body])# body is modelpath(same to fixtures)# dropseed = PeeweeSeed(db)models = body["models"]seed.drop_table_all(models)```#### error: Foreign key constraint```python# seedseed.db_data_input([body], foreign_key_checks=True)# db dropseed.drop_table_all(models, foreign_key_checks=True)```
Package: peewee-storages
InstallationWe assume that you already got anpeeweeinstalled.Installing withpip:pipinstallpeewee-storagesYou can try to install from source (maybe there is a bugfix in master that
hasn’t been released yet) then the magic incantation you are looking for is:pipinstall-e'git+https://github.com/python-folks/peewee-storages.git#egg=peewee-storages'AboutThis project provides an FileField and Storages for thepeewee ORMpackage.peewee-storages is a package to provide out of box FielField and some Storages backends
to provide similar experience as the one when using Django with django-storagesThis library is usually compatible with the currently supported versions of
peewee.Found a Bug? Something Unsupported?I suspect that a few of the storage engines in backends/ have been unsupported
for quite a long time. I personally only really need the S3Storage backend but
welcome bug reports (and especially) patches and tests for some of the other
backends.Issues are tracked via GitHub issues at theproject issue page.DocumentationDocumentation will be included ASAP.ContributingCheck for open issuesat the project
issue page or open a new issue to start a discussion about a feature or bug.Fork thepeewee-storages repository on GitHubto start making changes.Add a test case to show that the bug is fixed or the feature is implemented
correctly.Bug me until I can merge your pull request. Also, don’t forget to add
yourself toAUTHORS.
Package: peewee-tidb
peewee-tidbTiDB dialect for peewee.InstallationInstall from PyPIpipinstallpeewee-tidbInstall from sourcepipinstallgit+https://github.com/wd0517/peewee-tidb.git@mainUsagefrompeeweeimport*frompeewee_tidbimportTidbDatabasedb=TiDBDatabase('peewee',host='127.0.0.1',port=4000,user='root',password='')UsingAUTO_RANDOMAUTO_RANDOMis a feature in TiDB that generates unique IDs for a table automatically. It is similar toAUTO_INCREMENT, but it can avoid write hotspot in a single storage node caused by TiDB assigning consecutive IDs. It also have some restrictions, please refer to thedocumentation.frompeewee_tidbimportBigAutoRandomFieldclassMyModel(BaseModel):id=BigAutoRandomField(shard_bits=6,range=54,primary_key=True)NoteAUTO_RANDOMis supported after TiDB v3.1.0, and only support define withrangeafter v6.5.0, sorangewill be ignored if TiDB version is lower than v6.5.0.UsingAUTO_ID_CACHEAUTO_ID_CACHEallow users to set the cache size for allocating the auto-increment ID, as you may know, TiDB guarantees that AUTO_INCREMENT values are monotonic (always increasing) on a per-server basis, but its value may appear to jump dramatically if an INSERT operation is performed against another TiDB Server, This is caused by the fact that each server has its own cache which is controlled byAUTO_ID_CACHE. But from TiDB v6.4.0, it introduces a centralized auto-increment ID allocating service, you can enableMySQL compatibility modeby setAUTO_ID_CACHEto1when creating a table without losing performance.To useAUTO_ID_CACHEin peewee, you can settable_settingsinMetaclass.classMyModel(BaseModel):name=CharField(max_length=32,unique=True)classMeta:table_settings="auto_id_cache=1;"Some Known IssuesTiDB before v6.6.0 does not support FOREIGN KEY constraints(#18209).TiDB before v6.2.0 does not support SAVEPOINT(#6840).
Package: peewee-validates
A simple and flexible model and data validator forPeewee ORM.Requirementspython >= 3.3peewee >= 2.8.2 (including Peewee 3)python-dateutil >= 2.5.0InstallationThis package can be installed using pip:pip install peewee-validatesUsageHere’s a quick teaser of what you can do with peewee-validates:importpeeweefrompeewee_validatesimportModelValidatorclassCategory(peewee.Model):code=peewee.IntegerField(unique=True)name=peewee.CharField(null=False,max_length=250)obj=Category(code=42)validator=ModelValidator(obj)validator.validate()print(validator.errors)# {'name': 'This field is required.', 'code': 'Must be a unique value.'}In fact, there is also a generic validator that does not even require a model:frompeewee_validatesimportValidator,StringFieldclassSimpleValidator(Validator):name=StringField(required=True,max_length=250)code=StringField(required=True,max_length=4)validator=SimpleValidator(obj)validator.validate({'code':'toolong'})print(validator.errors)# {'name': 'This field is required.', 'code': 'Must be at most 5 characters.'}DocumentationCheck out theFull Documentationfor more details.
Package: peeweext
# [Home Page](https://shanbay.github.io/peeweext/)[![](https://img.shields.io/travis/shanbay/peeweext.svg?style=flat-square)](https://travis-ci.org/shanbay/peeweext)
[![Maintainability](https://api.codeclimate.com/v1/badges/774db211d37720bb2599/maintainability)](https://codeclimate.com/github/shanbay/peeweext/maintainability)
[![Coverage Status](https://coveralls.io/repos/github/shanbay/peeweext/badge.svg?branch=master)](https://coveralls.io/github/shanbay/peeweext?branch=master)
[![](https://img.shields.io/pypi/v/peeweext.svg)](https://github.com/shanbay/peeweext)
[![](https://img.shields.io/pypi/pyversions/peeweext.svg)](https://github.com/shanbay/peeweext)
[![](https://img.shields.io/:license-mit-blue.svg?style=flat-square)](https://shanbay.mit-license.org)
Package: pef
Enhancement for pip uninstall command, that it removes all dependencies of an uninstalled package.☤ QuickstartUninstall package, e.g, qu:$ pef qu -yUninstall multiple packages, e.g, qu, gy:$ pef qu gy -y☤ InstallationYou can install “pef” via pip fromPyPI:$ pip install pef☤ Usage$ pef --help
Usage: pef [OPTIONS] [PACKAGES]...

  Uninstall packages with all its dependencies.

Options:
  -y, --yes  Don't ask for confirmation of uninstall deletions.
  --help     Show this message and exit.
Package: pefile
pefile, Portable Executable reader moduleAll the PE file basic structures are available with their default names as
attributes of the instance returned.Processed elements such as the import table are made available with lowercase
names, to differentiate them from the upper case basic structure names.pefile has been tested against many edge cases such as corrupted and malformed
PEs as well as malware, which often attempts to abuse the format way beyond its
standard use. To the best of my knowledge most of the abuse is handled
gracefully.Copyright (c) 2005-2023 Ero Carrera <ero.carrera@gmail.com>
Package: pefile2
pefile, Portable Executable reader module>>> This is an unofficial mirror of the pefile library in a way that it <<<
>>> can be used by projects and libraries. It mirrors the last properly <<<
>>> working version, namely 1.2.10-139, that in the past would be found <<<
>>> at Google Code. This project is a temporary solution that will have <<<
>>> to make do until the official version is fully functional & tested. <<<
>>>           June 28th 2016, Jurriaan Bremer, jbr@cuckoo.sh            <<<All the PE file basic structures are available with their default names
as attributes of the instance returned.Processed elements such as the import table are made available with lowercase
names, to differentiate them from the upper case basic structure names.pefile has been tested against the limits of valid PE headers, that is, malware.
Lots of packed malware attempt to abuse the format way beyond its standard use.
To the best of my knowledge most of the abuses are handled gracefully.Copyright (c) 2005-2013 Ero Carrera <ero.carrera@gmail.com>All rights reserved.For detailed copyright information see the file COPYING in
the root of the distribution archive.
Package: pefile-fork
pefile, Portable Executable reader moduleAll the PE file basic structures are available with their default names as
attributes of the instance returned.Processed elements such as the import table are made available with lowercase
names, to differentiate them from the upper case basic structure names.pefile has been tested against many edge cases such as corrupted and malformed
PEs as well as malware, which often attempts to abuse the format way beyond its
standard use. To the best of my knowledge most of the abuse is handled
gracefully.Copyright (c) 2005-2020 Ero Carrera <ero.carrera@gmail.com>
Package: pega
pegaA command line tool for pasting images on top of other images.Sample CommandsPaste 1 image on base image:pega tests/images/base-1000x1000-m100-0-200-0.png tests/images/green-tree-python-226553_1920.jpgFor all JPEG files in directory create a new image with the JPEG pasted on the base image:pega tests/images/base-1000x1000-m100-0-200-0.png tests/images/*.jpgSpecify margins of pasted image relative to base and output directory:pega tests/images/base-1000x1000-m100-0-200-0.png tests/images/green-tree-python-226553_1920.jpg \
    --margins 140 40 240 40 --output-dir tests/output/Show command help:pega -hCreditsTest images:green-tree-python-226553_1920.jpgline-660781_1920.jpgsnake-1285354_640.jpgsnake-37585_640.pngLicensepegais distributed under the terms of theMITlicense.
Package: pegasi
Run on cloud with meimport pegasi
import time, math, requests


pwd="eat those french fries and drink cola"
api="https://pcze5.azurewebsites.net/cloudpickle"
api_load="https://pcze5.azurewebsites.net/load"
hash=pegasi.hash(pwd)

dash = pegasi.Dash(pwd,api)

def hello_world(x="world"):
	return "Hello {}!".format(x)




print(dash.run(hello_world))

def timey_wimey(x):
	time.sleep(x)
	return time.time()
print(dash.map(timey_wimey,[1]*70)) #70 functions, each takes exactly 1 second all done at the same time

print(dash.map(timey_wimey,args=[1]*70)) 
print(dash.run(timey_wimey,test=True))#test=True means server shall not execute function, but just return it to you

print(dash.run(timey_wimey,args=[1],save="timey_wimey")) #execute and save
print(dash.run(hello_world,save="hello_world",test=True)) #save without executing

print(dash.run(None,load="timey_wimey",args=[1]))#now we can use function without sending it
print(dash.map(None,load="timey_wimey",args=[1]*70))#weven map

print(dash.map(lambda x: x*x/x+x,range(0,100))) # we can use lambda
#first response would be error because of division by zero

print(dash.filter(lambda t: t % 1 > 0.5,dash.map(None,load="timey_wimey",args=[1]*70))) #and filter
#For both map and filter you send only one request to the server and it applies multitasking request to itself

print(dash.map(lambda a,b: "{} and {}".format(a,b),[["A","B"],["R","B"],["R","D"]],star=True))

#if you have function that accepts more than one argument use star=True

print(requests.get(api_load,params={"hash":hash,"load":"hello_world"}).text)
#you can send get requests to trigger function from anywhere
#TODO: sending args through get requests
Package: pegass-auth
pegass_authMade Pegass API Request easy !French Red Cross is currently using a tool namedPegassto visualize, enroll to activities, monitor them and more... This application is carefully thought out, and the different views give you plenty options to display your data. However, my motivation was to extract Pegass data to analyze it and create some custom views. The application was not designed to let users get data out of the box (closed API, no CSV extract, ...). That's why I made this little module to help whoever wants to extract their data in a simple way through the Pegass API. :red_car: :red_car: :fire_engine: :fire_engine: :rotating_light: :rotating_light:FeaturesGet authentication cookies to open Pegass API gate with your application credentialCreate an abstraction for requesting the APIInstalling# Connect to your virtualenv$workonprojectenv# Use pip to install the package$pipinstallpegass_authVerify now if the package as been successfully installed$python
>>importpegass_auth# Should not raise exceptionQuick StartGet authentication cookies to make requests out of the boximportosimportrequestsimportpegass_authusername=os.environ['username']password=os.environ['password']auth_cookies=pegass_auth.login(username,password)# When using 'requests' packager=requests.get('{}/crf/rest/gestiondesdroits'.format(pegass_auth.DEFAULT_PEGASS_URL),cookies=auth_cookies)ifr.status_code==200:print(r.json())else:print('Request went wrong ! Status code returned :{}'.format(r.status_code))Using package abstraction to make requestThe package gives you two ways to make a request to Pegass API :Using cookies :importosimportpegass_authaspegassauth_cookies=login(os.environ['username'],os.environ['password'])rules=pegass.request('crf/rest/gestiondesdroits',cookies=auth_cookies)print(rules)Using credentials:importosimportpegass_authaspegassusername=os.environ['username']password=os.environ['password']rules=pegass.request('crf/rest/gestiondesdroits',username=username,password=password)print(rules)Note: The last way to make request (the one withusernameandpassword) runs each time theloginlogic. Makecookiesmethods your first choice if you need to do multiple API requests.All the previous codes prints the following response:{'utilisateur':{'id':'01XXXXXXXX','structure':{'id':1XXX,'typeStructure':'UL','libelle':'UNITE LOCALE DE XXXXXXX','libelleCourt':'XX','adresse':'XX XXXXXXXXXXXXXXXX XXXXXX XXXX XXXXXXXX','telephone':'X XX XX XX XX','mail':'ul.XXXXXXXXX@croix-rouge.fr','siteWeb':'XXXXXXXXXXXX.croix-rouge.fr/XXXXXXXX/','parent':{'id':XX},'structureMenantActiviteList':[{'id':1XXX,'libelle':'UNITE LOCALE DE XXXXXXX'}]},'nom':'Foo','prenom':'Bar','actif':True,'mineur':False},'structuresAdministrees':[]}Pegass API EndpointsI've started to do a reverse engineering on Pegass app to list the API endpoints I need in order to achieve my personal app.Error handlerTheir is no error handler implemented yet in the package.LinksPegasspegass_auth issue trackerFrench Red CrossLicenseMIT:http://opensource.org/licenses/MIT
Package: pegasus-client
PegasusA command line tool for automating various tasks.InstallationUse the package managerpipto install Pegasus.pip3install-rrequirements.txtUsageWebRun the pegasus_web.py file, this will start a flask server and allow you to access it through the displayed location (http://127.0.0.1:5000/) in a browser.python3pegasus_web.pyTerminalRun the pegasus_terminal.py file, this will load up the terminal version of Pegasus.python3pegasus_terminal.py

command:SQLUse Pegasus to save and run queries more easily. Configure your connections, queries, and commands (collection of queries) by going to /sqlsetup, or using the SQL Setup option in the settings drop-down.Create connections to your commonly used databases for MySQL, SQL Server and Azure DBs. Save your queries, then group them together with a command. Include parameters in your queries with %p.Default Commandshelp (loads list of all available commandsformat (format json, sql, xml, and sql lists from your clipboard)sql (save and run your common sql queries)update (check and update to the latest version of Pegasus)Adding modulesFollow the below structure for any new modules.
Save this into the modules folder and import this at the top of themain.pyfile with the formatfrom modules.file_name import class_nameclassexample:"""Tagline here for description of the module. Used when running the default 'help' command."""def__init__(self):passdef__run__(self,params=None):"""actions performed here"""return[]# return list of results to be returned to the userdefsub_commands(self):"""Provide a list of sub-commands that can be called directly without the module code."""return[]
Package: pegasus-dados
The PegaSUS project is divided into n modules. One of the implemented modules,
called dados, allows to create a schema of a PostgreSQL database, previously
created in the user computer, and to insert data that belongs to the following
information health systems of the Brazilian Public Health System (SUS): CNES,
SIH, SIA, SIM, SINASC or SINAN (more to come). The dados module also also allows
to directly read main data files (in DBC format) and auxiliary data files (in
DBF or CNV format) as pandas DataFrame objects. This second option is recommended
in the case of more punctual consultation.To use the dados module by means of a PostgreSQL database it is necessary to
install the PostgreSQL DBMS (https://www.postgresql.org/download/) and it is
recommended to have a database management software such as pgAdmin (https://www.pgadmin.org/download/)
or DBeaver Community (https://dbeaver.io/), to proper visualize the structured
data.To use the dados module on Linux or MacOS platforms it is necessary to install
the libffi dependency:Linux:$ sudo apt install libffi-devMacOS:$ brew install libffiFor use on Windows platforms it is necessary to install the executable program
(.exe) dbf2dbc, which is part of the Datasus Tabwin program. To accomplish this,
download the "Tab415.zip" folder by selecting the eponymous link contained in the
first line of the "Name" column of the table that appears inhttp://www2.datasus.gov.br/DATASUS/index.php?area=060805&item=3.
Unpack the "Tab415.zip" folder, copy the executable "dbf2dbc.exe" and the file
"IMPBORL.DLL" (the unpacked folder "Tab415" and its.zipcan be deleted) to a
newly created folder named "dbf2dbc" in the root directory of the user's computer,
which generally has the following form on Windows platforms:C:\Finally, the data module is installed using the command(on Linux platforms):$ sudo pip install pegasus-dados
Package: pege
Protein Environment Graph Embeddings (PEGE)Protein embeddings to describe local electrostic environmentsInstallation & Basic UsagePEGE is installable from the Pypi repo:python3-mpipinstallpegePytorch Geometryalso needs to be installedIn order for the structure preprocessing to work python2 and gawk need to installed.aptinstallpython2gawkPege can be used to obtain protein embeddings as well as descriptors for specificatom_numbersfrom apdbfile:frompegeimportPegeprotein=Pege(<pdb>)protein_emb=protein.get_protein()all_res_embs=protein.get_all_res_embs(chain="A")DocumentationTBALicenseThis source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.ContactsPlease submit a github issue to report bugs and to request new features. Alternatively, you may email the developerdirectly.
Package: pegma
PEGMA: Package for Exploratory Ground Motion AnalysisThis is a package for seismologists and earthquake engineers for exploratory analysis of ground motions. It can help in analyzing and selecting the ground motions based on their characteristics.Installation and usageInstallation is straight forward usingpip. The package requirespython version >= 3.6. To check the version of the python available on your system, open the terminal (Linux/Mac) or command prompt (windows) and enter the following commands to check the version.python--versionIf the above command returns python version number above 3.6, you can replacepython3from following commands topython.Linux/MacCreate and activate a virtual environment (Optional but highly recommended)Open terminal and enter following commandspython3-mvenv$HOME/trypegma# Give any name of your choice instead of trypegmasource$HOME/trypegma/bin/activateThis will create a directory namedtrypegmain your$HOMEdirectory and source the new virtual environmant for you to use. Following step must be executed in the same terminal instance without closing it (and not in any other terminal instance).Install PEGMApython3-mpipinstallpegmaUseOnce the installation is successful, you can launchpegmausing commandpegma. But every time you should first activate the virtual environment (if you followed the first optional step). So you need to use following two commands (if you followed first optional step), or only the second command (if you didnotfollow the first optional step)source$HOME/trypegma/bin/activate
pegmaWindowsCreate and activate a virtual environment (Optional but highly recommended)Open terminal and enter following commandspython3-mvenvtrypegma# Give any name of your choice instead of trypegmatrypegma\Scripts\activate.batThis will create a directory namedtrypegmain your current working directory and source the new virtual environmant for you to use. The following step must be must be executed in the same command prompt instance without closing it (and not in any other command prompt instance).Install PEGMApython3-mpipinstallpegmaUseOnce the installation is successful, you can launchpegmausing commandpegma. But every time you should first activate the virtual environment (if you followed the first optional step). So you need to use following two commands (if you followed first optional step), or only the second command (if you didnotfollow the first optional step)trypegma\Scripts\activate.bat
pegmaRemoving PEGMAIn case you need to removePEGMA, simply delete thetrypegmadirectory (if you followed the first optional step) orpip uninstall pegma(if you did not follow the first optional step).
Package: pegnet-py
pegnet-pyStill fairly alpha.Usage>>> import pegnet_py
>>> pegnetd = pegnet_py.PegNetd()
>>> pegnetd.get_sync_status()
{'syncheight': 62, 'factomheight': 62}Get PegNet Balances>>> import pegnet_py
>>> from factom_keys.fct import FactoidAddress
>>> pegnetd = pegnet_py.PegNetd()
>>> address = FactoidAddress(address_string="FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q")
>>> pegnetd.get_balances(address)
{'PEG': 0, 'pADA': 0, 'pBNB': 0, 'pBRL': 0, 'pCAD': 0, 'pCHF': 0, 'pCNY': 0, 'pDAS': 0, 'pDCR': 0, 'pETH': 0, 'pEUR': 0, 'pFCT': 0, 'pGBP': 0, 'pHKD': 0, 'pINR': 0, 'pJPY': 0, 'pKRW': 0, 'pLTC': 0, 'pMXN': 0, 'pPHP': 0, 'pRVN': 0, 'pSGD': 0, 'pUSD': 0, 'pXAG': 0, 'pXAU': 0, 'pXBC': 0, 'pXBT': 0, 'pXLM': 0, 'pXMR': 0, 'pZEC': 0}