Saravanan666/pypi-org huggingface dataset:
Package: psycopg2-utils
psycopg2 utilsThis package contains helper classes for psycopg2.Installationpipinstallpsycopg2-utilsConnectionPoolThis connection pool is thread safe and does not raise an exception when the pool is
empty and a thread tried to get a connection from it. Instead the thread will wait
for a connection to become available in the pool.
Connections will also not be closed when returned to the pool until they have been
idle for some specified time.frompsycopg2_utilsimportConnectionPoolconfig={"minconn":os.environ["DB_MINCONN"],"maxconn":os.environ["DB_MAXCONN"],"idle_time":os.environ["IDLE_TIME"],"dbname":os.environ["DB_NAME"],"host":os.environ["DB_HOST"],"port":os.environ["DB_PORT"],"user":os.environ["DB_USER"],"password":os.environ["DB_PASS"],"options":"-c search_path={}".format(os.environ["DB_SCHEMA"]),}pool=ConnectionPool(**config)# Get connection from the poolcon=pool.getconn()# Return connection to the poolpool.putconn(con)CursorThis cursor extends the dict curser and enables logging the sql queries when the log
level is set to DEBUG and also logs how long each query takes to execute if log level
is INFO and there is an environment variable named METRIC_LOGGING that has the value
"TRUE".frompsycopg2importconnectfrompsycopg2_utilsimportCursorcon=connect("")cur=con.cursor(cursor_factory=Cursor)pooled_cursorThis allows a method of a class to be decorated so that it will automatically supply
the method with a cursor to use.
It requires that the class has a property named pool containing a connection pool that
implements theAbstractConnectionPool.frompsycopg2_utilsimportpooled_cursorclassMyClass:def__init__(self,config):self.pool=ConnectionPool(**config)@pooled_cursordefget_count(self,cursor):cursor.execute("SELECT count(*) FROM table;")returncursor.fetchone()[0]my_class=MyClass(config)#The method can then be used like this:count=my_class.get_count()# If you already hold a cursor and don't want to get a new one# from the pool then it can be passed into the method.cursor=some_method_that_gets_cursor()count=my_class.get_count(cursor=cursor)The wrapper will take care of getting a connection from the pool and returning it to
the pool at the end. It also does a commit when there is no exception.
Package: psycopg2-wrapper
Simple wrapper for executing commands and queriesFeaturesConnection PoolClient cursorFor installing package:pip install psycopg2-wrapperFor usage:from psycopg2_wrapper.database import Database
database = Database(host='host_name', database='db_name', user='db_user', password='db_password')
result = database.execute_query('select * from user where id=%s', (1,))
Package: psycopg-binary
This distribution package is an optional component ofPsycopg 3: it
contains the optional optimization packagepsycopg_binary.You shouldn’t install this package directly: use insteadpip install "psycopg[binary]"to install a version of the optimization package matching thepsycopgversion installed.Installing this package requires pip >= 20.3 or newer installed.This package is not available for every platform: check outBinary
installationin the documentation.Please readthe project readmeandthe installation documentationfor
more details.Copyright (C) 2020 The Psycopg Team
Package: psycopg-c
This distribution package is an optional component ofPsycopg 3: it
contains the optional optimization packagepsycopg_c.You shouldn’t install this package directly: use insteadpip install "psycopg[c]"to install a version of the optimization package matching thepsycopgversion installed.Installing this package requires some prerequisites: checkLocal
installationin the documentation. Without a C compiler and some library
headers installwill fail: this is not a bug.If you are unable to meet the prerequisite needed you might want to installpsycopg[binary]instead: look forBinary installationin the
documentation.Please readthe project readmeandthe installation documentationfor
more details.Copyright (C) 2020 The Psycopg Team
Package: psycopg-dbconn-class
psycopg_dbconn_classA simple class to handle database connections usingpsycopg2(PostgreSQL).UseTo properly use this class, just get it fromPyPI.pipinstallpsycopg-dbconn-classAlternatively, you can also clone it from theGitHubrepository and install manually.gitclonehttps://github.com/kstenio/psycopg_dbconn_class.gitcdpsycopg_dbconn_class
pipinstall-rrequirements.txt
pipinstall.Then, you can create an object, connect to a server and begin running queries.
By default, parameters for connecting into the server are expected do be in environment variables
('DBN', 'DBU', 'DBK', 'DBH', 'DBP'), but you can also use a json file (conn.json). Finally,
you may also enter parameters manually.frompsycopg_dbconn_classimportDataBaseConnectionDB=DataBaseConnection(auto_config=False)DB.update_config_values(name='db',host='127.0.0.0',port="15432",user="postgres",password="PostgresPass")DB.connect()ifDB.connected:# For queries without need of returnDB.run_query('INSERT INTO colum VALUES (NULL)')DB.run_query('INSERT INTO colum VALUES (%s)',[1])# For queries that need the returnresult=DB.run_read_query('SELECT * FROM table WHERE val =%s',[2],fetch_all=True)print(result)DB.close()Development backgroundWhen I've started to work with Python + PostgreSQL, I have begun using the pysycopg2
library. However, I do prefer working with classes, and the usual connection/cursor
methods were not very functional for my applications.Eventually, I decided to structure the objects I needed inside aDataBaseConnectionclass, and created this repository for further improvements.Warrantypsycopg_dbconn_classis an open-source project. It is distributed in the hope that it will be
useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITYorFITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
version 3 attached for more details.Developed by:Kleydson Stenio@ 2023
Package: psycopg-pool
This distribution package is an optional component ofPsycopg 3: it
contains the optional connection pool packagepsycopg_pool.This package is kept separate from the mainpsycopgpackage because it is
likely that it will follow a different release cycle.You can also install this package using:pip install "psycopg[pool]"Please readthe project readmeandthe installation documentationfor
more details.Copyright (C) 2020 The Psycopg Team
Package: psycopg-postgis2
[![Circle CI](https://img.shields.io/circleci/project/yohanboniface/psycopg-postgis.svg)](https://circleci.com/gh/yohanboniface/psycopg-postgis) [![PyPI](https://img.shields.io/pypi/v/psycopg-postgis.svg)](https://pypi.python.org/pypi/psycopg-postgis) [![PyPI](https://img.shields.io/pypi/pyversions/psycopg-postgis.svg)](https://pypi.python.org/pypi/psycopg-postgis) [![PyPI](https://img.shields.io/pypi/implementation/psycopg-postgis.svg)](https://pypi.python.org/pypi/psycopg-postgis) [![PyPI](https://img.shields.io/pypi/status/psycopg-postgis.svg)](https://pypi.python.org/pypi/psycopg-postgis)# psycopg-postgisPostGIS helpers for psycopg2.## Installpip install psycopg-postgisIf you want a compiled version, first installcython:pip install cython
pip install psycopg-postgis## UsageYou need to register the extension:> import postgis
> postgis.register(mydatabase.get_cursor())Then you can pass python geometries instance to psycopg:> cursor.execute(‘INSERT INTO table (geom) VALUES (%s)’, [Point(x=1, y=2, srid=4326)])And retrieve data as python geometries instances:> cursor.execute(‘SELECT geom FROM points LIMIT 1’)
> geom = cursor.fetchone()[0]
> geom
<Point POINT(1.0 2.0)>## Example> import psycopg2
> from postgis import register, LineString
> db = psycopg2.connect(dbname=”test”)
> cursor = db.cursor()
> register(cursor)
> cursor.execute(‘CREATE TABLE IF NOT EXISTS mytable (“geom” geometry(LineString) NOT NULL)’)
> cursor.execute(‘INSERT INTO mytable (geom) VALUES (%s)’, [LineString([(1, 2), (3, 4)], srid=4326)])
> cursor.execute(‘SELECT geom FROM mytable LIMIT 1’)
> geom = cursor.fetchone()[0]
> geom
<LineString LINESTRING(1.0 2.0, 3.0 4.0)>
> geom[0]
<Point POINT(1.0 2.0)>
> geom.coords
((1.0, 2.0), (3.0, 4.0))
> geom.geojson
{‘coordinates’: ((1.0, 2.0), (3.0, 4.0)), ‘type’: ‘LineString’}
> str(geom.geojson)
‘{“type”: “LineString”, “coordinates”: [[1, 2], [3, 4]]}’
Package: psycopgr
____  _______  ___________  ____  ____ ______
   / __ \/ ___/ / / / ___/ __ \/ __ \/ __ `/ ___/
  / /_/ (__  ) /_/ / /__/ /_/ / /_/ / /_/ / /
 / .___/____/\__, /\___/\____/ .___/\__, /_/
/_/         /____/          /_/    /____/psycopgris a Python wrapper ofpgRoutingwith one purpose:Computing routes on real map for humans.Tested withPython 3.6.5PostgreSQL 11.2PostGIS 2.5.2pgRouting 2.6.2osm2pgrouting 2.3.6PreparationInstallPostgreSQL,PostGIS, andpgRoutingCreate database to store map dataImport OpenStreet map data into databaseA step by step note can be foundhere.InstallationpipinstallpsycopgrorpipenvinstallpsycopgrRouting with Python!First,frompsycopgrimportPgrNode,PGRoutingCreate an PGRouting instance with database connection:pgr=PGRouting(database='mydb',user='user')Adjust meta datas of tables including the edge table properies if they are different from the default (only the different properties needs to be set), e.g.:pgr.set_meta_data(cost='cost_s',reverse_cost='reverse_cost_s',directed=true)This is the default meta data:{'table':'ways','id':'gid','source':'source','target':'target','cost':'cost_s',# driving time in second'reverse_cost':'reverse_cost_s',# reverse driving time in second'x1':'x1','y1':'y1','x2':'x2','y2':'y2','geometry':'the_geom','has_reverse_cost':True,'directed':True,'srid':4326}Nodes are points on map which are represented byPgrNodenamedtuple with geographic coordinates (longitude and latitude) rather than vague vertex id (vid) in the tables.PgrNodesis defined as:PgrNode=namedtuple('PgrNode',['id','lon','lat'])in whichidcould beNoneor self-defined value, andlonandlatare double precision values.For example:nodes=[PgrNode(None,116.30150,40.05500),PgrNode(None,116.36577,40.00253),PgrNode(None,116.30560,39.95458),PgrNode(None,116.46806,39.99857)]Now we can do routings! This is really straightforward:# many-to-manyroutings=pgr.get_routes(nodes,nodes,end_speed=5.0,pgx_file='r.pgx')# one-to-oneroutings=pgr.get_routes(nodes[0],nodes[1])# one-to-manyroutings=pgr.get_routes(nodes[0],nodes)# many-to-oneroutings=pgr.get_routes(nodes,node[2])end_speed: speed from node to nearest vertices on ways in unit km/h.gpx_file: set it to output paths to a gpx file.The returned is a dict of dict:{(start_node, end_node): {'path': [PgrNode], 'cost': cost}By default,costis traveling time along the path in unit second. It depends on the means of columns of the edge table that you set ascostandreverse_cost. You can assign the relations byset_meta_datafunction.We can also get only costs without detailed paths returned:costs=pgr.get_costs(nodes,nodes)The returned is also a dict:{(start_node, end_node): cost}Low-level wrapper of pgRouting functionspsycopgr functionpgRouting functiondijkstrapgr_dijkstradijkstra_costpgr_dijkstraCostastarpgr_astarThese are direct wrappings of pgRouting functions. For example,dijkstratakes vertex ids as input. This list may be extended in the future.TutorialHere is atutorial.
Package: psycopgwrap
Here are a few of the features:Query results can be accessed as a dictionary of columns.Queries return indexable iterators with dictionary syntax, so you can
do things like “for row in query”, and “query(cmd)[0]”.  Note that
indexes can only be larger than or equal to the last index.Query arguments are passed as discrete arguments, not as a tuple.
Passing as a tuple always makes me want to do a “%” and if I accidentally
do that it can open up a SQL injection.There’s an “insert” helper that takes a table name and keyword arguments.
Similarly there’s a “dictinsert” helper that takes a dictionary of
row:values.
Package: psycossh
PsycoSSHA ConnectionFactory for use by psycopg2 to enable SSH TunnelingProbably should just usecreate_tunneled_enginewhich wraps around itExamplefrompsycosshimportcreate_tunneled_enginefromsqlalchemyimportMetaDataengine=create_tunneled_engine(ssh_user="ssh_username",ssh_pkey=r"C:\Path\To\OpenSSH_Private_Key",# without passwordssh_host=r"ssh_server_host",ssh_port=22,# default valuedatabase=r"main_db",pg_host="localhost",# default valuepg_port=5432,# default valuepg_password="pg_password")meta=MetaData()meta.reflect(bind=engine)print(meta.tables)
Package: psydapt
Python bindings tohttps://github.com/aforren1/psydapt.To install, either install from PyPI (pip install psydapt), or find the latest wheels under "Artifacts" here:https://github.com/aforren1/psydapt-py/actions. Windows usersmayneed the Microsoft Visual C++ runtime DLLs. One easy way to acquire those is viapip install msvc-runtime.For now, see the C++ documentation for details:https://aforren1.github.io/psydapt/index.htmlSee the demos/ folder for examples.frompsydaptimportScaleimportpsydapt.questplusasqpfrompsydapt.staircaseimportStaircasefrompsydapt.questplusimportWeibullx=Staircase(start_val=0.5,n_reversals=3,step_sizes=[0.01,0.001],n_trials=20,n_up=4,n_down=3,apply_initial_rule=True,stim_scale=Scale.Linear,min_val=0)intensities=[-3.5,-3.25,-3,-2.75,-2.5,-2.25,-2,-1.75,-1.5,-1.25,-1,-0.75,-0.5]y=Weibull(stim_scale=Scale.Log10,intensity=intensities,threshold=intensities,slope=[0.5,4.125,7.75,11.375,15],lower_asymptote=[0.01,0.1325,0.255,0.3775,0.5],lapse_rate=[0.01],stim_selection_method=qp.StimSelectionMethod.MinEntropy,# only MinEntropy for nowparam_estimation_method=qp.ParamEstimationMethod.Mean,# currently unusedn=5,# currently unusedmax_consecutive_reps=2,# currently unusedrandom_seed=1# currently unused)
Package: psygnal
psygnalPsygnal (pronounced "signal") is a pure python implementation of theobserver
pattern, with the API ofQt-style Signalswith (optional)
signature and type checking, and support for threading.This library doesnotrequire or use Qt in any way, It simply implements
a similar observer pattern API.Documentationhttps://psygnal.readthedocs.io/Installpipinstallpsygnalcondainstall-cconda-forgepsygnalUsageTheobserver patternis a software design pattern in which an object maintains a list of its dependents ("observers"), and notifies them of any state changes – usually by calling acallback functionprovided by the observer.Here is a simple example of using psygnal:frompsygnalimportSignalclassMyObject:# define one or more signals as class attributesvalue_changed=Signal(str)# create an instancemy_obj=MyObject()# You (or others) can connect callbacks to your signals@my_obj.value_changed.connectdefon_change(new_value:str):print(f"The value changed to{new_value}!")# The object may now emit signals when appropriate,# (for example in a setter method)my_obj.value_changed.emit('hi')# prints "The value changed to hi!"Much more detail available in thedocumentation!Evented DataclassesA particularly nice usage of the signal pattern is to emit signals whenever a
field of a dataclass changes. Psygnal provides an@eventeddecorator that will
emit a signal whenever a field changes.  It is compatible withdataclassesfromthe standard library,
as well asattrs, andpydantic:frompsygnalimporteventedfromdataclassesimportdataclass@evented@dataclassclassPerson:name:strage:int=0person=Person('John',age=30)# connect callbacks@person.events.age.connectdef_on_age_change(new_age:str):print(f"Age changed to{new_age}")person.age=31# prints: Age changed to 31See thedataclass documentationfor more details.Benchmark historyhttps://pyapp-kit.github.io/psygnal/andhttps://codspeed.io/pyapp-kit/psygnalDevelopersDebuggingWhilepsygnalis a pure python module, it is compiled with mypyc to increase
performance.  To disable all compiled files and run the pure python version,
you may run:python-c"import psygnal.utils; psygnal.utils.decompile()"To return the compiled version, run:python-c"import psygnal.utils; psygnal.utils.recompile()"Thepsygnal._compiledvariable will tell you if you're using the compiled
version or not.
Package: psykorebase
Easily perform merge-based rebases, i.e. rebases that don’t alter history.You can read the full rationale behind this idea here:http://tech.novapost.fr/merging-the-right-way-en.htmlhttp://tech.novapost.fr/psycho-rebasing-en.htmlWhat?As a summary:git checkout topic && git merge masteris the wrong way to merge.
Get ready for bad things to happen.git checkout topic && git rebase masteris better but:it alters history. It is safe from merge conflicts but doesn’t guarantee
that merged code works. You are losing some intermediate states of your
work.it is incompatible with branches you already pushed to shared repository.psykorebase:mimics the “rebase” workflow, but only using merges, no history alteration.
It replays “topic” changes on top of “master” in “topic” branch (just like
rebase), without deleting “topic” changes.preserves all states of your code.is compatible with pushed branches.the main (and only?) counterpart is that there are more entries in history.
There are more commits and more merges. Is that a drawback? If you look
carefully, things are clear and clean. But some developers don’t like it…InstallCurrently developped against Python 2.7.x.
Supports only Git for now.sudopipinstallhttps://github.com/benoitbryon/psykorebase/archive/master.tar.gz#egg=psykorebaseUninstall withsudo pip uninstall psykorebase.UsageGitCurrent, in-development prototypepsykorebase MASTER [TOPIC]performs a “psycho-rebase” of TOPIC branch on
top of MASTER. Where TOPIC is optional and defaults to current branch.Example:gitcheckoutmaster&&gitpull--rebaseoriginmaster# Update master.gitcheckouttopic&&psykorebasemaster# Psykorebase topic on top of master.Planned usage (in development)The default, issues one merge for each (new) commit in topic branch:git checkout topic && psykorebase master.The quick’n’dirty, issues one big merge which includes all (new) commits from
topic branch (merges heads):git checkout topic && psykorebase--fastmasterThe default is safer, the--fastworks well when there are poor chances of
problems.
CHANGELOG
=========1.0.1 (2015-07-29)Fix setup.py1.0.0 (2015-07-29)Add Python3 support.Add Git supportAddpsykorebase BRANCHandpsykorebase--continuefunctionality.
Package: psym
Psym is a python package that allows for querying and modifying the Symphony data using graphql queries.
Graphql is a query language developed by Facebook (https://graphql.org/)PrerequisitesPython >= 3.7InstallationInstall it with:pip install psymUsageFirst connect to symphony with your credentialsfrompsymimportPsymClient# since symphony is multi tenant system you will need to insert which partner you connect asclient=PsymClient(email,password,tenant_name)The tenant is the company nameStart creating location types, equipment types:locationType=client.add_location_type("City",[])equipment_type=client.add_equipment_type("Antenna HW","Category Name",[("altitude","int",None,True)],{},[])Start creating locations, equipment and links:location=client.add_location(-1.22,2.66,('City','New York'))equipment=client.add_equipment('HW1569','Antenna HW',location,{'altitude':53.5})Licensepsym isBSD Licenselicensed, as found in theLICENSEfile.
Package: psy-maps
docstestspackageimplementationsWelcome to the psyplot plugin for visualizations on a map. This package uses thecartopypackage to project the plots that are made with thepsy-simpleplugin
to an earth-referenced grid. It’s main plot methods are themapplotandmapvectorplot methods which can plot
rectangular and triangular plots.See the full documentation onpsyplot.github.io/psy-maps/for allplot methods, and checkout theexamples.CopyrightCopyright © 2021 Helmholtz-Zentrum Hereon, 2020-2021 Helmholtz-Zentrum
Geesthacht, 2016-2021 University of Lausannepsy-maps and is released under the GNU LGPL-3.O license.
See COPYING and COPYING.LESSER in the root of the repository for full
licensing details.This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3.0 as
published by the Free Software Foundation.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU LGPL-3.0 license for more details.You should have received a copy of the GNU LGPL-3.0 license
along with this program.  If not, seehttps://www.gnu.org/licenses/.
Package: psym-arriendo-energia
Psym is a python package that allows for querying and modifying the Symphony data using graphql queries.
Graphql is a query language developed by Facebook (https://graphql.org/)PrerequisitesPython >= 3.7InstallationInstall it with:pip install psymUsageFirst connect to symphony with your credentialsfrompsymimportPsymClient# since symphony is multi tenant system you will need to insert which partner you connect asclient=PsymClient(email,password,tenant_name)The tenant is the company nameStart creating location types, equipment types:locationType=client.add_location_type("City",[])equipment_type=client.add_equipment_type("Antenna HW","Category Name",[("altitude","int",None,True)],{},[])Start creating locations, equipment and links:location=client.add_location(-1.22,2.66,('City','New York'))equipment=client.add_equipment('HW1569','Antenna HW',location,{'altitude':53.5})Licensepsym isBSD Licenselicensed, as found in theLICENSEfile.
Package: psym-arriendo-energiav2
Psym is a python package that allows for querying and modifying the Symphony data using graphql queries.
Graphql is a query language developed by Facebook (https://graphql.org/)PrerequisitesPython >= 3.7filetype >= 1.0.8pandas >= 1.3.4py-gql-client >= 1.0.1xmlrunner >= 1.7.7requests >= 2.26.0tqdm >= 4.62.3jsonschema >= 4.2.1InstallationInstall it with:pip install psym_arriendo_energiav2UsageFirst connect to symphony with your credentialsfrompsymimportPsymClient# since symphony is multi tenant system you will need to insert which partner you connect asclient=PsymClient(email,password,tenant_name)The tenant is the company nameStart creating location types, equipment types:locationType=client.add_location_type("City",[])equipment_type=client.add_equipment_type("Antenna HW","Category Name",[("altitude","int",None,True)],{},[])Start creating locations, equipment and links:location=client.add_location(-1.22,2.66,('City','New York'))equipment=client.add_equipment('HW1569','Antenna HW',location,{'altitude':53.5})Licensepsym isBSD Licenselicensed, as found in theLICENSEfile.
Package: psym-gjiroto
Psym is a python package that allows for querying and modifying the Symphony data using graphql queries.
Graphql is a query language developed by Facebook (https://graphql.org/)PrerequisitesPython >= 3.7InstallationInstall it with:pip install psymUsageFirst connect to symphony with your credentialsfrompsymimportPsymClient# since symphony is multi tenant system you will need to insert which partner you connect asclient=PsymClient(email,password,tenant_name)The tenant is the company nameStart creating location types, equipment types:locationType=client.add_location_type("City",[])equipment_type=client.add_equipment_type("Antenna HW","Category Name",[("altitude","int",None,True)],{},[])Start creating locations, equipment and links:location=client.add_location(-1.22,2.66,('City','New York'))equipment=client.add_equipment('HW1569','Antenna HW',location,{'altitude':53.5})Licensepsym isBSD Licenselicensed, as found in theLICENSEfile.
Package: psym-nttdata
Psym is a python package that allows for querying and modifying the Symphony data using graphql queries.
Graphql is a query language developed by Facebook (https://graphql.org/)PrerequisitesPython >= 3.7InstallationInstall it with:pip install psymUsageFirst connect to symphony with your credentialsfrompsymimportPsymClient# since symphony is multi tenant system you will need to insert which partner you connect asclient=PsymClient(email,password,tenant_name)The tenant is the company nameStart creating location types, equipment types:locationType=client.add_location_type("City",[])equipment_type=client.add_equipment_type("Antenna HW","Category Name",[("altitude","int",None,True)],{},[])Start creating locations, equipment and links:location=client.add_location(-1.22,2.66,('City','New York'))equipment=client.add_equipment('HW1569','Antenna HW',location,{'altitude':53.5})Licensepsym isBSD Licenselicensed, as found in theLICENSEfile.