Saravanan666/pypi-org huggingface dataset:
Package: pyDBMS
InstallationTo install pydb to your machine, run the following script from the root of your project's directory:pip3 install pyDBMSPyDBMSDescription:  Pydb provides users with a light-weight, easy to use ORM(Object Relational Mapping) for multiple DBMS systems. The primary goal is to make communicating between databases as easy as possible using a unified base model type and abstract database interface. Pydb is designed to be easily extended to other languages as needed by the user.DependenciesWhen pydb is installed all libraries that will also be installed through pip.
Pydb currently has no external dependencies until non-native databases are supported.UsageModelsUsers have the ability to create their own custom models and seamlessly add them to their database of choice.example_model.pyfrompyDBMSimportModel,Text,Float,IntegerclassExampleModel(Model):__table_name__='example_models'__primary_keys__='model_id'# alternatively ['model_id']model_id=Text()other_column=Integer()another_column=Float()Selecting Model Entries From The DatabaseUsers may select entries from the database. They can use filters as seen below:db=SQLiteDB('example.db')results1=db.select(ExampleModel,model_id='uuid(1)')orresults2=db.select(ExampleModel,other_column=[100,200],another_column=2.0)or they can select all the models in the database of the given type with:db=SQLiteDB('example.db')all_example_models=db.select(ExamplModel)Inserting And Updating EntriesUsers can insert and update model entries across multiple databases with a uniform interface as seen belowlocal_db=SQLiteDB('local.db')remote_db=PostgreSQLDB(host='http://db.example.com/',username='admin',password='password123')# ************************# process creating models# ************************model1=ExampleModel(model_id='test_id',other_column=100)local_db.insert(model1)# same model can be used to upload to postgres DBremote_db.insert(model1)model1['another_column']=3.14#update both db'slocal_db.update(model1)remote_db.update(model1)Query Existing Databases Infodb=SQLiteDB('/location/for/database')# list tables and columnsfortableindb.tables():print(table+':')forcolumnindb.get_columns(table):print(column)How to test the softwarePydb is developed using Test-Driven Development. All the unittests can be run using the following command in the root directory:python3-munittestdiscoverKnown issuesPydb currently only supports the Sqlite database as the requirements are being elicited.Getting helpIf you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.Getting involvedIf you are interested in contributing fixes or features to MonoGame, please read ourCONTRIBUTORguide first.
Package: pydbops
Database OperationsLibrary for simplifying database operations.
Contains standard functions for database operations.GitHub Page :https://github.com/NotShrirang/pydbopsImporting pydbops:frompydbopsimport*Methods in Database:openDatabase()- Creates a database and returns a Database object.createTable()- Creates table of given name.addEntry()- Function for inserting values in database.databaseVersion()- Returns sqlite3 version.dropTable()- Function for deleting table.fetchInOrder()- Function for fetching database entries in given order.getData()- Function for getting all data.getFieldNames()- Function for getting field names.getTable()- Creates Table instance.intersection()- Performs intersection and returns all distinct rows selected by query.length()- Returns length of database.minus()- Fetches rows which are present in first query but absent in second.removeEntry()- Function for removing records from database.searchEntry()- Function for searching in database.tableNames()- Function for retrieving tables in a database.union()- Performs union and returns all distinct rows selected by query.updateEntry()- Function for updating values in database.For printing data in database, you can use default print() method by passing Database object in it.
Package: pyDbOracle
pyDbOracleEstá lib foi desenvolvida para facilitar o dia a dia de quem precisa martelar comandos a moda antiga (SELECT, UPDATE, INSERT) em bancos oracle.Instalaçãopip install pyDbOracleUtilizaçãoAlguns exemplos de uso.Conexão básicafrompyDbOracle.databaseimportDatabasestr_conn='oracle://<USER>:<PASS>@<HOST>:<PORT>/<INSTANCE>'db=Database(str_conn)db.info()Conexão em banco com RACfrompyDbOracle.databaseimportDatabasestr_conn='oracle://<USER>:<PASS>@<HOST>:<PORT>/<INSTANCE>?threaded=True'db=Database(str_conn)db.info()Conexão definindo charsetfrompyDbOracle.databaseimportDatabasestr_conn='oracle://<USER>:<PASS>@<HOST>:<PORT>/<INSTANCE>?encoding=utf-8'db=Database(str_conn)db.info()Executando queriesfrompyDbOracle.databaseimportDatabasestr_conn='oracle://<USER>:<PASS>@<HOST>:<PORT>/<INSTANCE>'db=Database(str_conn)command='SELECT INSTANCE_NAME FROM V$INSTANCE'data=db.get(command=command)print(data)# {'instance_name': 'PROD'}Executando queries com filtrosfrompyDbOracle.databaseimportDatabasestr_conn='oracle://<USER>:<PASS>@<HOST>:<PORT>/<INSTANCE>'db=Database(str_conn)command='SELECT INSTANCE_NAME FROM V$INSTANCE WHERE HOST = :host'params=dict(host='MEUHOST')data=db.get(command=command,params=params)print(data)# {'instance_name': 'PROD'}Executandos Inserts, Updates ou DeletesQuando precisar executar um comando do tipo insert, update ou delete, rodar o metodorunfrompyDbOracle.databaseimportDatabasestr_conn='oracle://<USER>:<PASS>@<HOST>:<PORT>/<INSTANCE>'db=Database(str_conn)command='INSERT INTO TABELA (COLUNA1, COLUNA2) VALUES (:valor1, :valor2)'params=dict(valor1='ABC',valor2=123)data=db.run(command=command,params=params)print(data)# 1
Package: pydbots
A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.Key FeaturesModern Pythonic API usingasyncandawait.Proper rate limit handling.Optimised in both speed and memory.InstallingPython 3.8 or higher is requiredTo install the library without full voice support, you can just run the following command:# Linux/macOSpython3-mpipinstall-Upydbots# Windowspy-3-mpipinstall-UpydbotsOtherwise to get voice support you should run the following command:# Linux/macOSpython3-mpipinstall-U"pydbots[voice]"# Windowspy-3-mpipinstall-Upydbots[voice]To install the development version, do the following:$gitclonehttps://github.com/anshtyagi0/pydbots$cdpydbots$python3-mpipinstall-U.[voice]Optional PackagesPyNaCl(for voice support)Please note that on Linux installing voice you must install the following packages via your favourite package manager (e.g.apt,dnf, etc) before running the above commands:libffi-dev (orlibffi-develon some systems)python-dev (e.g.python3.6-devfor Python 3.6)Quick ExampleimportdiscordclassMyClient(discord.Client):asyncdefon_ready(self):print('Logged on as',self.user)asyncdefon_message(self,message):# don't respond to ourselvesifmessage.author==self.user:returnifmessage.content=='ping':awaitmessage.channel.send('pong')client=MyClient()client.run('token')Bot Exampleimportdiscordfromdiscord.extimportcommandsbot=commands.Bot(command_prefix='>')@bot.command()asyncdefping(ctx):awaitctx.send('pong')bot.run('token')You can find more examples in the examples directory.LinksDocumentationOfficial Discord ServerDiscord API
Package: pydbow
Bags of Binary WordsPyDBoW is a Python implementation of Bags of Binary Words algorithm.RequirementsOpenCVnumpyInstallationpipinstallpydbowUsageRefer todemo.ipynbanddemo.pyfor example usage.Running testspython-mpytestLicensePyDBoW is licensed under the MIT License.Images are taken fromhttps://github.com/commaai/comma10k
Package: pyDBoW3
pyDBoW3Ultra-fast Boost.Python interface forDBoW3This repo was created in order to interface DBoW algorithm from python in another projectEasyVision. It is being used for a simple topological SLAM
implementation since OpenCV BowKMeansTrainer doesn’t work with binary features.If you wish you use it on your own it is as easy as:importpyDBoW3asbowvoc=bow.Vocabulary()voc.load("/slamdoom/libs/orbslam2/Vocabulary/ORBvoc.txt")db=bow.Database()db.setVocabulary(voc)delvoc# extract features using OpenCV...# add features to databaseforfeaturesinfeatures_list:db.add(features)# query featuresfeature_to_query=1results=db.query(features_list[feature_to_query])deldbThis repository was created based onpyORBSLAM2and
ndarray to cv::Mat conversion onnumpy-opencv-converter.NoteTested on these platforms:OpenCV 3.4.2.16Windows 10 msvc 2017 x64xenial with Python 2.7, libboost 1.54 (autobuild with travis)xenial with Python 3.5, libboost 1.54 (autobuild with travis)Get startedWindowsPrerequisites:
* OpenCV
* Python with Numpy and opencv-contrib-python
* Boost >1.54
* cmake
* Microsoft Visual StudioTo build Boost.Python, go to Boost root and run:bootstrap.bat --prefix=/dir/to/Boost.BuildThen build Boost.Python like this:/dir/to/Boost.Build/b2 --with-python threading=multi variant=release link=staticTo build DBoW3, simply runbuild.batfile and then build solution folder ininstall/DBoW3/buildand then the solution
inbuildfolder.Currently there is no python package generation, so you could simply copypyDBoW3.pydandopencv_world*.dllfiles
to your virtual environment.UnixUsebuild.shto buildbuild/pyDBoW.so, which you should then put on yourPYTHONPATH.Check.travis.ymlfor environment variables.NoteYou will probably need to runsudo make installforinstall/opencv/buildto install it on your system.
Package: pydbpedia
pyDBpediaInstallationCan easily install using pippip install pydbpediaUsageA simple python package to query dbpedia without the need to use sparql query language.You will need add the endpoint as an argument when initiating the classPyDBpedia.from pydbpedia import PyDBpedia, namespace

dbpedia_uris = ["http://dbpedia.org/resource/Manchester_United_F.C.", "http://dbpedia.org/resource/Albert_Einstein"]

dbpedia_wrapper = PyDBpedia(endpoint="http://dbpedia.org/sparql")
objects = dbpedia_wrapper.get_objects(subjects=dbpedia_uris, predicates=[namespace.RDF_TYPE])Currently there are only two main functions which both take the same input parameters:subjects: list of DBpedia URIspredicates: list of predicatesBoth Functions query DBpedia and return the results of the query given thesubjectsandpredicates:get_objects(subjects, predicates, **kwarg): Returns a list of simplified (without the DBpedia URI) DBpedia entities, for example[Norway, Sweden].get_subject_object_tuples(subjects, predicates, **kwarg):  Returns a list of format[(subject, object),...]wheresubjectandobjectare simplified DBpedia entities, for example[(Sweden, Stockholm), (Norway, Oslo)].Additionally there is a possibilty to input filters to the two functions. The filters are set by sending them as additional input parameters. Currently there are three filters:redirect: Not really a filter but it will get the objects of the redirected resource. This is good to use when the resource is redirected and you still want to get the objects. For example:get_objeccts(subjects=[http://dbpedia.org/resource/Man_U], predicate=[predicate], redirect=True)will return the objects for the resourcehttp://dbpedia.org/resource/Manchester_United_F.C.since it will be redirected to that.contains: Used to filter the objects of the query if they contain the inputed string. For example:get_objects(subjects=[uri],predicates=[predicate],contains='http://dbpedia.org/Ontology/')'will only return objects which are part of the dbpedia ontology (meaning that they containhttp://dbpedia.org/Ontology/.in_list: To filter the objects of the query if they match any items in a list. For example:get_subject_object_tuples(subjects=[uri],predicates=[predicate],in_list=['London'])'will only return all the cases where the objects areLondon.
Package: pydbproperties
pydbproperties 0.3==============With this script, you can use store properties into aMySQL table, you can change the name of the table, andlist the properties into a output stream or filestream, etc.Right now it only works with MySQL Database, I will beworking in other databases.Dependencies:=============MySQL-python (1.2.3)MysqlSimpleQueryBuilder (0.2.8)Installation:=============MySQL-python has issues when installing by pipyou can install it with your package manage ofyour distributionubuntu: sudo apt-get install python2.7-mysqldbCentos/RHEL/Fedora: yum install MySQL-pythonOnce MySQL-python is installed, you can installMysqlSimpleQueryBuilder:pip install MysqlSimpleQueryBuilderAnd now you are ready to install pydbproperties:pip install pydbpropertiesExample:========from pydbproperties import pydbpropertiesprop = pydbproperties()prop.set_table_name('my_table')for b in range(5):prop.set_property('key' + str(b), 'value' + str(b))config = {"host": 'localhost',"user": 'root',"passwd": '',"db": 'test_pydbproperties',}prop.conn(**config)# prop.load()prop.list()prop.set_property('key_test', 'value_test')prop.store()prop.list()======================Output:-- listing properties --key3=value3key2=value2key1=value1key0=value0key4=value4-- listing properties --key3=value3key2=value2key1=value1key0=value0key4=value4key_test=value_test=====================Table in MySQL:MariaDB [test_pydbproperties]> use test_pydbpropertiesDatabase changedMariaDB [test_pydbproperties]> show tables;+-------------------------------+| Tables_in_test_pydbproperties |+-------------------------------+| my_table                      |+-------------------------------+1 row in set (0.00 sec)MariaDB [test_pydbproperties]> select * from my_table;+----------+------------+| key      | value      |+----------+------------+| key0     | value0     || key1     | value1     || key2     | value2     || key3     | value3     || key4     | value4     || key_test | value_test |+----------+------------+6 rows in set (0.00 sec)
Package: pydbro
______   _____ ___   ___ ______    ____
  \     `\|  |  |   `\|   |\     `\/'    |
   |   T  |  |  |>    |  <__|   >  |     |
   |   '_,|__   |     |     |     /'  T  |
   |   |  __/  /|  T  |  T  |     `|  :  |
   |   | |     ||  '  |  '  |   |  |     |
   `---' `-----'`-----'-----'---'--`-----'
  %xxxxxxxxx<  CONSOLE PYTHON  >xxxxxxxxx%
  ----------< DATABASE BROWSER >----------
  %xxxxxxxxx< (c) 2022 UNKNOWN >xxxxxxxxx%
  ----------------------------------------```PROGRAM: PYTHON CONSOLE DATABASE BROWSERHelp Keyboard Controls:

?   - this help

$   - connection information
j   - move down
k   - move up
h   - move left
l   - move right
L   - shift columns right
H   - shift columns left
0   - go to upper left table corner
G   - go to lower right table corner
n   - next page of records
u   - previous page of records
s   - sort ascending by current column
S   - sort descending by current column
f   - filter (enter claus after where ... )
tab - toggle left / right panel (tables, table content) 
m   - move rows view by 1 page down (tables list)
i   - move rows view by 1 page up (tables list)
r   - reread
e   - edit current cell
d   - delete current row
a   - add new row
X   - reset view (filter, sort) on current table
@   - scroll current row to the top

Note:

Currently the insert, update, delete are only
supported on sqlite and oracle. The other databases
doesn't have rowid pseudo column.

To run this program on Windows You should need
the unofficial curses package for windows.
You can get it here:
Python Extension Packages for Windows - Christoph Gohlke
http://pythonic.zoomquiet.top/data/20101216091618/index.html

To Install use:

$ pip install pydbro

To setup connection you can use the coned program.
To run the coned just use:

$ coned

This will generate json with connectin information
to connect to the mysql, postgres or oracle database.

If You wish to open sqlite file just specify:

$ pydbro -d sqlite file.db

To connect to other databases use:

$ pydbro -d [mysql|postgres|oracle]

and connect according to connection json.

To connect to the mysql|postgres|oracle database You
would need following packages:

for MySQL:    $ pip install mysql-connector 
for Oracle:   $ pip install cx_Oracle 
for Postgres: $ pip install psycopg2-binary

To develop or use the git repository version use:

$ python3 setup.py develop

To both use the commands and run.sh

Special Thanks goes to:

Lawrence Manuel aka Smooth for the Logo
Package: pydbsmgr
pydbsmgrPython package for database control and administration as well as for DataFrame processing. Also contains a simplerPython SDK for Azure Cloud toolssuch as uploading.parquet,.csvand.xlsxfiles, downloading them and DataFrame cleansing.PrerequisitiesBefore you begin, ensure you have met the following requirements:You have aWindows/Linux/Macmachine runningPython 3.10+.You have installed the latest versions ofpipandvirtualenvorconda(Anaconda).InstallationThis package can be easily installed with pip:pipinstallpydbsmgrInstallation from GitHubIf you prefer, you can do it in this other way:pipinstallgit+https://github.com/jzsmoreno/pydbsmgrYou can contribute to this repositoryThrough the following steps:Clone this repository (requiresgit):git clone https://github.com/jzsmoreno/pydbsmgr.git
cd pydbsmgrCreate and activate a python virtual environment (The activation may vary depending on your OS here is the example for Linux):python3 -m venv venv
source ./venv/bin/activateInstall all therequirements:pip3 install -r requirements.txtNow you can test it with any python file you want. But you can also use it in a jupyter notebook, just installjupyterlabpip3 install jupyterlabOpen the jupyter lab instance (you can see that already exists anexample.ipynb, where you can see some of the things you can do):jupyter lab
Package: pydbsnp
pydbsnpInterface with dbSNP VCF dataInstallationStep 0 (optional):If you don't want to bother with environment variables
and don't care about howpydbsnpworks under the hood, skip this step.If you wish, you can determine the location wherepydbsnplooks for relevant
data using four environment variables:PYDBSNP_VCF_GRCH37,PYDBSNP_RSID_GRCH37,PYDBSNP_VCF_GRCH38,PYDBSNP_RSID_GRCH38. TheVCFvariables determine the location of the VCF data, theRSIDvariables
determine the location of the rsid indices. For example, you could add this
to your.bash_profile:exportPYDBSNP_VCF_GRCH37=<pathofyourchoice>exportPYDBSNP_RSID_GRCH37=<pathofyourchoice>exportPYDBSNP_VCF_GRCH38=<pathofyourchoice>exportPYDBSNP_RSID_GRCH38=<pathofyourchoice>If you set these variables before continuing to the next step,pydbsnpwill
use them to determine where it places downloaded VCF files and RSID indices.Step 1:install the python package viapip3pipinstallpydbsnporpipinstall--userpydbsnpStep 2:Once the python package is installed, download and index the dbSBP
VCF data:pydbsnp-download
pydbsnp-indexFor hg19/GRCh37 coordinates:pydbsnp-download--reference-buildGRCh37
pydbsnp-indexCommand line usagepydbsnp-query-hpydbsnp-queryrs231361
pydbsnp-querychr8:118184783
pydbsnp-query--reference-buildGRCh37rs231361
pydbsnp-queryrs231361chr8:118184783rs7903146APITwo classes are provided:VariantandGeneralizedVariant.An object of theVariantclass has an attribute for each relevant field
of the VCF.frompydbsnpimportVariantv=Variant(id='rs8056814')print(v.chrom,v.pos,v.id,v.ref,v.alt)print(v.info)w=Variant(id='rs8056814',reference_build='GRCh37')print(w.chrom,w.pos)x=Variant('chr16',75218429)print(x)help(Variant)An object of theGeneralizedVariantclass is similar, but each attribute
is a tuple which may have multiple items. For example, one RSID may map
to two sets of coordinates.gv=GeneralizedVariant(id='rs8056814')print(gv.chrom,gv.pos,gv.id,gv.ref,gv.alt)
Package: pydbtcloud
py-dbt-cloudpydbtcloud is a developer kit for interfacing with thedbt Cloud v2 APIon Python 3.7 and above.InstallationpipinstallpydbtcloudAuthenticationfrompydbtcloudimportDbtClouddbtcloud=DbtCloud(account_id='account_id',api_token='api_token')Example UsageGet information about a specific dbt cloud job:response=dbtcloud.get_job(1234)You can iterate through pages using the following syntax:forpageindbtcloud.list_runs():forruninpage.get('data'):print(run.get('id'))
Package: pydbtools
pydbtoolsA package that is used to run SQL queries speficially configured for the Analytical Platform. This packages uses AWS Wrangler's Athena module but adds additional functionality (like Jinja templating, creating temporary tables) and alters some configuration to our specification.InstallationRequires a pip release above 20.## To install from pypipipinstallpydbtools## Or install from git with a specific releasepipinstall"pydbtools @ git+https://github.com/moj-analytical-services/pydbtools@v4.0.1"Quickstart guideTheexamples directorycontains more detailed notebooks demonstrating the use of this library, many of which are borrowed from themojap-aws-tools-demo repo.Read an SQL Athena query into a pandas dataframeimportpydbtoolsaspydbdf=pydb.read_sql_query("SELECT * from a_database.table LIMIT 10")Run a query in Athenaresponse=pydb.start_query_execution_and_wait("CREATE DATABASE IF NOT EXISTS my_test_database")Create a temporary table to do further separate SQL queries on laterpydb.create_temp_table("SELECT a_col, count(*) as n FROM a_database.table GROUP BY a_col",table_name="temp_table_1")df=pydb.read_sql_query("SELECT * FROM __temp__.temp_table_1 WHERE n < 10")pydb.dataframe_to_temp_table(my_dataframe,"my_table")df=pydb.read_sql_query("select * from __temp__.my_table where year = 2022")NotesAmazon Athena using a flavour of SQL called presto docs can be foundhereTo query a date column in Athena you need to specify that your value is a date e.g.SELECT * FROM db.table WHERE date_col > date '2018-12-31'To query a datetime or timestamp column in Athena you need to specify that your value is a timestamp e.g.SELECT * FROM db.table WHERE datetime_col > timestamp '2018-12-31 23:59:59'Note dates and datetimes formatting used above. See more specifics around date and datetimeshereTo specify a string in the sql query always use '' not "". Using ""'s means that you are referencing a database, table or col, etc.See changelog for release changes.
Package: pydbuilder
pydBuilderpydBuilder is a simple utility for converting Python scripts topydfiles using Cython.InstallationpipinstallpydbuilderUsingStep 1: Create a Python script to compile using the moduledefdifference(a:int,b:int)->str:result=abs(a-b)/min(a,b)result=result*100returnf'{result:.2f}%'Step 2: Use the module to automatically compile the scriptpydbuilderdifference.pyorpydbuilderpath/to/difference.pyStep 3: Use the compiled file in the codefromdifferenceimportdifferenceprint(difference(3432,2831))Commands examplepydbuilder --helpfor view help messagepydbuilder -all -ext "py, pyw" <path/to/dir>orC:\path\to\dir> pydbuilder -all -ext pyxpydbuilder --settingsfor change settings