Saravanan666/pypi-org huggingface dataset:
Package: pysqlite3-wheels
pysqlite3This library takes the SQLite module from Python 3 and packages it as a
separately-installable module.This may be useful for creating SQLite modules capable of working with other
versions of SQLite (via the amalgamation option).Additional features:User-defined window functions (requires SQLite >= 3.25)Flags and VFS an be specified when opening connectionIncremental BLOB I/O,bpo-24905Improved error messages,bpo-16379Simplified detection of DML statements viasqlite3_stmt_readonly.Sqlite native backup API (also present in standard library 3.7 and newer).A completely self-contained binary package (wheel) is available for versions
0.4.1 and newer aspysqlite3-binary. This package contains the latest release
of SQLite compiled with numerous extensions, and requires no external
dependencies.Building with System SQLiteTo buildpysqlite3linked against the system SQLite, run:$ python setup.py buildBuilding a statically-linked libraryTo buildpysqlite3statically-linked against a particular version of SQLite,
you need to obtain the SQLite3 source code and copysqlite3.candsqlite3.hinto the source tree.# Download the latest release of SQLite source code and build the source
# amalgamation files (sqlite3.c and sqlite3.h).
$ wget https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=release \
    -O sqlite.tar.gz
$ tar xzf sqlite.tar.gz
$ cd sqlite/
$ ./configure
$ make sqlite3.c

# Copy the sqlite3 amalgamation files into the root of the pysqlite3 checkout
# and run build_static + build:
$ cp sqlite/sqlite3.[ch] pysqlite3/
$ cd pysqlite3
$ python setup.py build_static buildYou now have a statically-linked, completely self-containedpysqlite3.Using the binary packageA binary package (wheel) is available for linux with a completely
self-containedpysqlite3, statically-linked against the most recent release
of SQLite.$ pip install pysqlite3-binary
Package: pysqlite-binary
pysqlite3This library takes the SQLite module from Python 3 and packages it as a
separately-installable module. The binary package is statically compiled
which make it easy to embedded the library in certain circumstances.This may be useful for creating SQLite modules capable of working with other
versions of SQLite (via the amalgamation option). Meanwhile, the included SQLite
library is compiled withall features enabled, that user may benefit from
more features, like the score based database FTS (Full-Text Search).Additional features:User-defined window functions (requires SQLite >= 3.25)Flags and VFS an be specified when opening connectionIncremental BLOB I/O,bpo-24905Improved error messages,bpo-16379Simplified detection of DML statements viasqlite3_stmt_readonly.Sqlite native backup API (also present in standard library 3.7 and newer).A completely self-contained binary package (wheel) is available for versions
0.4.1 and newer aspysqlite3-binary. This package contains the latest release
of SQLite compiled with numerous extensions, and requires no external
dependencies.Building with System SQLiteTo buildpysqlite3linked against the system SQLite, run:$ python setup.py buildBuilding a statically-linked libraryTo buildpysqlite3statically-linked against a particular version of SQLite,
you need to obtain the SQLite3 source code and copysqlite3.candsqlite3.hinto the source tree.# Download the latest release of SQLite source code and build the source
# amalgamation files (sqlite3.c and sqlite3.h).
$ wget https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=release \
    -O sqlite.tar.gz
$ tar xzf sqlite.tar.gz
$ cd sqlite/
$ ./configure
$ make sqlite3.c

# Copy the sqlite3 amalgamation files into the root of the pysqlite3 checkout
# and run build_static + build:
$ cp sqlite/sqlite3.[ch] pysqlite3/
$ cd pysqlite3
$ python setup.py build_static buildYou now have a statically-linked, completely self-containedpysqlite3.Using the binary packageA binary package (wheel) is available for linux with a completely
self-containedpysqlite3, statically-linked against the most recent release
of SQLite.$ pip install pysqlite3-binary
Package: pysqlitecrypto-rsa
pysqlitecrypto_rsaThis package provides functionality for managing RSA keys and encrypting/decrypting messages using SQLite databases.Functions Available for ImportKeychain Operationsgenerate_keys(key_size: int, re_create: bool, db_filename: str = "keys") -> boolGenerates RSA keys and stores them in an SQLite database.key_size: The size of the RSA keys to be generated.re_create: Whether to recreate the keychain directory and database if they already exist.db_filename: The name of the database file. Defaults to "keys".Encryption Operationsencrypt_message(message: str, db_filename: str = "keys") -> Union[bytes, None]Encrypts a message using the public key stored in the specified database.message: The message to be encrypted.db_filename: The name of the database file. Defaults to "keys".decrypt_message(encrypted_message: bytes, db_filename: str = "keys") -> Union[str, None]Decrypts an encrypted message using the private key stored in the specified database.encrypted_message: The encrypted message to be decrypted.db_filename: The name of the database file. Defaults to "keys".
Package: pysqlitehelper
PySQLite-Helper 🧤Python SQLiteHelper is a python package that help you to create sqlite databases,tables and interacting with sqlite database without have to worry about writing any SQL query.# import the module from helper folderfrompysqlitehelper.helpersimportSQLiteHelper# creating the database called todo_app using our SQLiteHeper moduledb=SQLiteHelper('todo_app')# After this like the file todo_app.db will be created in your directory# Specify the structure of table you want to create using dictionary like thiscolumns={'title':'text','description':'text','completed':'boolean',}# create table using create_table function, and pass table name and of course the columns in the tabledb.create_table('tasks',columns)# you want to insert data in your table right let's kee going# specify values to be inserted in your table like this, column name then the value in dictionary formatvalues={'title':'Coding in the morning','description':'Drinking coffee instead','completed':False,}# then to execute the insert method call this fuction and pass table name and it's valuedb.insert('tasks',values)# after this line, you are now inserted your data in your table# select data by ID , here i'm going to select todo with id of 2todo=db.selectWhereId('tasks',2)print(todo)# you can display selected column like this print(todo['title'])# select all datas and display it via console like thisforrindb.selectAll(table_name='tasks'):print(r)
Package: pysqliteog
pysqliteogA client library forsqlite-og, based on thePython Database API Specification v2.0specification.InstallationpipinstallpysqliteogThis will installpysqliteogalong with it's dependenciesgrpcio&protobufUsageBasic Usageimportpysqliteog# connect to the databasedb=pysqliteog.connect('<host>','<port>','<db-name>')withdb.cursor()ascur:cur.execute('select 1')print(f"{cur.fetchone()}")db.close()Using CallbacksThe client allows you to define custom function that
can be used directly in your queries.importpysqliteog# define a custom callback functiondefsay_hello(x):returnf'hello{x}'# connect to the databasedb=pysqliteog.connect('<host>','<port>','<db-name>')# all custom function must be registered before creating the first cursordb.create_function('say_hello',1,say_hello)withdb.cursor()ascur:cur.execute('select say_hello(?)',params=['world'])# should print "hello world"print(f"{cur.fetchone()}")db.close()
Package: py-sqlite-orm-danidr
SQLite simple ORMIt is a simple and small ORM for SQLite database.
An object-relational mapper (ORM) is a code library that automates the
transfer of data stored in relational databases
tables into objects that are more commonly used in application code.python 3+ (developed with 3.7)supports SQLite onlyInstallpipinstallpy-sqlite-orm-danidrUsagefromsqlite_orm.databaseimportDatabasefromsqlite_orm.fieldimportIntegerField,BooleanField,TextFieldfromsqlite_orm.tableimportBaseTableimportloggingclassUser(BaseTable):__table_name__='users'id=IntegerField(primary_key=True,auto_increment=True)#autoincrement int fieldname=TextField(not_null=True)active=BooleanField(not_null=True,default_value=1)classPost(BaseTable):__table_name__='posts'id=IntegerField(primary_key=True)name=TextField(not_null=True)id_user=IntegerField(foreign_key=User.id)if__name__=='__main__':#logger configure:logging.basicConfig(filename="sample.log",level=logging.DEBUG,format=('%(asctime)s: ''%(filename)s: ''%(levelname)s: ''%(funcName)s(): ''%(lineno)d: ''%(message)s'),datefmt="%Y-%m-%d%H:%M:%S")withDatabase("test.db")asdb:# create tabledb.query(Post,User).create().execute()user1=User(id=1,name='User1')user2=User(id=2,name='User2')user3=User(id=3,name='User3')post1=Post(id=1,name='Post1',id_user=user1.id)post2=Post(id=2,name='Post2',id_user=user2.id)post3=Post(id=3,name='Post3',id_user=user3.id)#insert datadb.query().insert(user1,user2,user3,post1,post2,post3).execute()# select with columns + autojoin with fk;print('\n=======SELECT + Auto Join=======')forrowindb.query(User,Post.name).select().join(Post).execute():print(row)# updatedb.query(User).update(name='User3_UPDATED').filter(User.name=='User3').execute()print('\n=======SELECT after update=======')forrowindb.query(User,Post.name).select().join(Post).execute():print(row)db.query(User).delete().filter(User.name=='User3_UPDATED').execute()print('\n=======SELECT after delete=======')forrowindb.query(User,Post.name).select().join(Post).execute():print(row)# deletedb.query(User,Post).drop().execute()
Package: pysqllike
.. _l-README:README======.. only:: html.. image:: https://travis-ci.org/sdpython/pysqllike.svg?branch=master:target: https://travis-ci.org/sdpython/pysqllike:alt: Build status.. image:: https://ci.appveyor.com/api/projects/status/rrpks1pgivea23js?svg=true:target: https://ci.appveyor.com/project/sdpython/pysqllike:alt: Build Status Windows.. image:: https://circleci.com/gh/sdpython/pysqllike/tree/master.svg?style=svg:target: https://circleci.com/gh/sdpython/pysqllike/tree/master.. image:: https://badge.fury.io/py/pysqllike.svg:target: http://badge.fury.io/py/pysqllike.. image:: http://img.shields.io/github/issues/sdpython/pysqllike.png:alt: GitHub Issues:target: https://github.com/sdpython/pysqllike/issues.. image:: https://img.shields.io/badge/license-MIT-blue.svg:alt: MIT License:target: http://opensource.org/licenses/MIT.. image:: https://landscape.io/github/sdpython/pysqllike/master/landscape.svg?style=flat:target: https://landscape.io/github/sdpython/pysqllike/master:alt: Code Health.. image:: https://requires.io/github/sdpython/pysqllike/requirements.svg?branch=master:target: https://requires.io/github/sdpython/pysqllike/requirements/?branch=master:alt: Requirements Status.. image:: https://codecov.io/github/sdpython/pysqllike/coverage.svg?branch=master:target: https://codecov.io/github/sdpython/pysqllike?branch=master**Links:*** `GitHub/pysqllike <https://github.com/sdpython/pysqllike>`_* `documentation <http://www.xavierdupre.fr/app/pysqllike/helpsphinx/index.html>`_* `Blog <http://www.xavierdupre.fr/app/pysqllike/helpsphinx/blog/main_0000.html#ap-main-0>`_Description-----------Writing a map/reduce job(using `PIG <https://pig.apache.org/>`_ for example),usually requires to switch from local files to remote files(on `Hadoop <http://hadoop.apache.org/>`_).On way to work is extract a small sample of the data which will be processedby a map/reduce job. The job is then locally developped. And when it works,it is run on a parallized environment.The goal of this extension is allow the implementation ofthis job using Python syntax as follows:::def myjob(input):iter = input.select (input.age, input.nom, age2 = input.age2*input.age2)wher = iter.where( (iter.age > 60).Or(iter.age < 25))return whereinput = IterRow (None, [ {"nom": 10}, {"jean": 40} ] )output = myjob(input)When the job is ready, it can be translated into a `PIG <https://pig.apache.org/>`_job::input = LOAD '...' USING PigStorage('\t') AS (nom, age);iter = FOREACH input GENERATE age, nom, age*age AS age2 ;wher = FILTER iter BY age > 60 or age < 25 ;STORE wher INTO '...' USING PigStorage();It should also be translated into`SQL <http://fr.wikipedia.org/wiki/Structured_Query_Language>`_.Functionalities---------------* not yet readyDesign------This project contains various helper about logging functions, unit tests and help generation.* a source folder: ``src``* a unit test folder: ``_unittests``, go to this folder and run ``run_unittests.py``* a _doc folder: ``_doc``, it will contains the documentation* a file ``setup.py`` to build and to install the module* a file ``make_help.py`` to build the sphinx documentation
Package: pysqlparse
PySqlParseFind table names and other information in a SQL queryInstallationpip3 install pysqlparseUseImportfrompysqlparseimportparser...get_table_namesReturns a set of all table names (without aliases) found in the SQL string.frompysqlparseimportparserprint(parser.get_table_names('''SELECT *FROM requests.by_account mINNER JOIN customer_data.styles s ON m.version = s.idLEFT JOIN profiles.users u ON m.csm = u.id'''))Returns:{'request.by_account','customer_data.styles','profiles.users'}
Package: pysqlutil
dot.parserProject Phase One:SQL ( Parsing SQL ) Till now I could only managed to create SQL ParserPhase Status - initial DevelopmentDue to beta version release you might face some difficultiesSQL Dialects SupportedMySQLPostreSQL ( Redshift in progress )SqliteHow to use this python modulepip install pysqlutilExtracting raw sql-metadata tokensfrompysqlutilimportparser# extract raw sql-metadata tokensparser("SELECT * FROM test_table").tokensparser("SELECT test, id FROM test_table1,test_table2").columns# you will get column namesparser_object=parser("<your custom SQL>")parser_object.columns# you will get column names as a list# but you can still extract aliases namesparser_object.columns_aliases# column alias listSoon , new featurers will be included like SQL File compare , DDL Compare , Analyze and optimize SQLFuture Release listJan-2023 : SQL Compare , Compare two versions of DDLFeb-2023 : GUI Support .
Package: pysqlw
A Python based wrapper (meta-wrapper, even) allowing easy MySQL and SQLite interactions.RequirementsPython 2.7.3 (this is what I test with, should work with most 2.x; 3.x not guaranteed without porting)sqlite3 module (comes with Python installs)InstallMySQLdbif you want MySQL supportIf you’re using a Debian-like distro (Ubuntu, Debian, Crunchbang, etc), install the packagepython-mysqldb$ sudoapt-getinstallpython-mysqldbThere is no pypi package (someone get on this)If that didn’t work, or you’re not using a Debian-like distro:Build and install the MySQLdb module from source.This linkexplains better than I could.Verify it’s installed:$ python-c'import MySQLdb'If nothing shows up, you’re good!If you get an ImportError, think, do youreallyneed MySQL?If yes, this is a problem, and I can’t really help. :(If you don’t, just use sqlite, it’s much easier.UsageInstall pysqlw:$ pip install pysqlwImport pysqlw:import pysqlwCreate a new instance:p =pysqlw.pysqlw(db_type="sqlite",db_path="/home/user/example.db")If you want to use MySQL you need to supply more details:p =pysqlw.pysqlw(db_type="mysql",db_host="localhost",db_user="username",db_pass="password",db_name="database_name")Alternatively, you can use it with Python’swithstatement.Documentation is now on the pysqlwreadthedocsentry.ContributingIf you’re interested, you can write extra meta-wrappers for foreign database types.
They’re pretty simple, look at thepysqlw wrappersdocumentation page for an example.If there’s not a wrapper for a database type you’d like (that is, an actual wrapper, not just a meta-wrapper), you should make one of those and send in some pull requests with meta-wrappers! More coverage is great.If you wish to help contribute to the base wrapper functions, feel free to fork thegithub repoand send in pull requests!
Package: pysqlx
pysqlx!`Publish <https://github.com/pysqlx/pysqlx/workflows/Publish/badge.svg>`_!`Test <https://github.com/pysqlx/pysqlx/workflows/Test/badge.svg>`_[![Downloads](https://static.pepy.tech/personalized-badge/pysqlx?period=week&units=international_system&left_color=black&right_color=orange&left_text=Last%20Week)](https://pepy.tech/project/pysqlx)[![Downloads](https://static.pepy.tech/personalized-badge/pysqlx?period=month&units=international_system&left_color=black&right_color=orange&left_text=Month)](https://pepy.tech/project/pysqlx)[![Downloads](https://static.pepy.tech/personalized-badge/pysqlx?period=total&units=international_system&left_color=black&right_color=orange&left_text=Total)](https://pepy.tech/project/pysqlx)# IntroductionA generic SQL driver package.# Installpip install pysqlx# Usage# Known Issues and Limitations (KIL)# NotesFor more info visit the project repository athttps://github.com/pysqlx/pysqlx
Package: pysqlx-core
pysqlx-corepysqlx-core is an extremely fast Python library for communicating with various SQL databases.This package provides the core functionality forPySQLX-Engine.The package is currently a work in progress and subject to significant change.pysqlx-corewill be a separate package, required bypysqlx-engine.This package is written entirely in Rust and compiled as a Python library using PyO3 and PyO3-Asyncio.This core is not so friendly, but maybe you want to use it, feel free to suggest improvements.Supported databasesSQLitePostgreSQLMySQLMicrosoft SQL ServerSupported Python versionsPython >= 3.7Supported operating systemsLinuxMacOSWindowsExample of installation:PIP$pipinstallpysqlx-corePoetry$poetryaddpysqlx-coreExample of usage:importpysqlx_coreimportasyncioasyncdefmain(sql):# Create a connectiondb=awaitpysqlx_core.new(uri="postgresql://postgres:postgrespw@localhost:49153")# Create a tableawaitdb.execute(sql="""CREATE TABLE IF NOT EXISTS test (id SERIAL PRIMARY KEY,name VARCHAR(255) NOT NULL);""")# Insert a row and return quantity rows affectedawaitdb.execute(sql="INSERT INTO test (name) VALUES ('Carlos');")# Select all rows, return a class PySQLXResultresult=awaitdb.query(sql="SELECT * FROM test;")# get first rowrow=result.get_first()# Dict[str, Any]# get all rowsrows=result.get_all()# List[Dict[str, Any]]#return the db types to Pydantic BaseModeltypes=result.get_model()# Dict[str, str]# Select all rows, return how List[Dict[str, Any]]rows=awaitdb.query_as_list(sql="SELECT * FROM test;")# close? no need 👌-> auto-close when finished programmer or go out of context..asyncio.run(main())
Package: pysqlx-engine
PySQLXEnginePySQLXEngine, a fast and minimalist SQL engineDocumentation:https://carlos-rian.github.io/pysqlx-engine/Source Code:https://github.com/carlos-rian/pysqlx-enginePySQLXEngine supports the option of sendingRaw SQLto your database.The PySQLXEngine is a minimalistSQL Engine.The PySQLXEngine was created and thought to be minimalistic, but very efficient. The core is write inRust, making communication between Databases andPythonmore efficient.All SQL executed using PySQLXEngine is atomic; only one instruction is executed at a time. Only the first one will be completed if you send an Insert and a select. This is one of the ways to handle SQL ingestion. As of version0.2.0, PySQLXEngine supports transactions, where you can controlBEGIN,COMMIT,ROLLBACK,ISOLATION LEVEL, etc. as you wish.NOTE:
Minimalism is not the lack of something, but having exactly what you need.
PySQLXEngine aims to expose an easy interface for you to communicate with the database in a simple, intuitive way and with good help through documentation, autocompletion, typing, and good practices.Database Support:SQLitePostgreSQLMySQLMicrosoft SQL ServerOS Support:LinuxMacOSWindowsInstallationPIP$pipinstallpysqlx-enginePoetry$poetryaddpysqlx-engineAsync ExampleCreate amain.pyfile and add the code examples below.frompysqlx_engineimportPySQLXEngineasyncdefmain():db=PySQLXEngine(uri="sqlite:./db.db")awaitdb.connect()awaitdb.execute(sql="""CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY,name TEXT,age INT)""")awaitdb.execute(sql="INSERT INTO users (name, age) VALUES ('Rian', '28')")awaitdb.execute(sql="INSERT INTO users (name, age) VALUES ('Carlos', '29')")rows=awaitdb.query(sql="SELECT * FROM users")print(rows)importasyncioasyncio.run(main())Sync ExampleCreate amain.pyfile and add the code examples below.frompysqlx_engineimportPySQLXEngineSyncdefmain():db=PySQLXEngineSync(uri="sqlite:./db.db")db.connect()db.execute(sql="""CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY,name TEXT,age INT)""")db.execute(sql="INSERT INTO users (name, age) VALUES ('Rian', '28')")db.execute(sql="INSERT INTO users (name, age) VALUES ('Carlos', '29')")rows=db.query(sql="SELECT * FROM users")print(rows)# running the codemain()Running the code using the terminal$python3main.pyOutput[BaseRow(id=1,name='Rian',age=28),BaseRow(id=2,name='Carlos',age=29)]
Package: pysqoop
pysqoopA python package that lets you sqoop into HDFS/Hive/HBase data from RDBMS using sqoop.To install the package via pip, runpip install pysqoopYou can then use the package usingfrompysqoop.SqoopImportimportSqoopsqoop=Sqoop(help=True)code=sqoop.perform_import()This will print the output of the commandsqoop --helpto your stoud; e.g.SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.6.3.0-235/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.6.3.0-235/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
18/08/13 20:25:13 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.6.3.0-235
usage: sqoop import [GENERIC-ARGS] [TOOL-ARGS]

Common arguments:
   --connect <jdbc-uri>                                       Specify JDBC
                                                              connect
                                                              string
   --connection-manager <class-name>                          Specify
                                                              connection
                                                              manager
                                                              class name
   ...Useful ResourcesHBase Client for Python :happybaseA more concrete exampleThe following codesqoop=Sqoop(fs='hdfs://remote-cluster:8020',hive_drop_import_delims=True,fields_terminated_by='\;',enclosed_by='\'"\'',escaped_by='\\\\',null_string='\'\'',null_non_string='\'\'',table='sample_table',target_dir='hdfs://remote-cluster/user/hive/warehouse/db/sample_table',delete_target_dir=True,connect='jdbc:oracle:thin:@//your_ip:your_port/your_schema',username='user',password='pwd',num_mappers=2,bindir='/path/to/bindir/folder')sqoop.perform_import()will execute the following commandsqoop import -fs hdfs://remote-cluster:8020 --hive-drop-import-delims  --fields-terminated-by \; --enclosed-by \'\"\' --escaped-by \\\\ --null-string \'\' --null-non-string \'\' --table sample_table --target-dir hdfs://remote-cluster/user/hive/warehouse/db/sample_table --delete-target-dir  --connect jdbc:oracle:thin:@//your_ip:your_port/your_schema --username user --password pwd --num-mappers 2 --bindir /path/to/bindir/folderConditional BuildingUse theset_param,unset_paramfunction to build conditioned sqoop imports.sqoop=Sqoop(table="MyTable")sqoop.set_param(param="--connect",value="jdbc:a_valid_string")iftaget_is_hbase:added_table=sqoop.set_param(param="--hbase-table",value="MyTable")added_key=sqoop.set_param(param="--hbase-row-key",value="Id_MyTable")ifadded_tableandadded_key:print("all params added :D")sqoop.perform_import()Unit TestingIn order to run unit tests open the terminal and change the current directory tounittestsfolder.Then, simply runpython unintary_tests.py. Add your unit tests in this fileDoinghandle sqoop jobsTODOsadd missing parametersmore tests coverage