Saravanan666/pypi-org huggingface dataset:
Package: db-conn
Python Packagedb_connTo use this package is necessary create file on your home~"~/access_information.json"{"database_name":{"host":"database-db.host.net","user":"user","password":"1234","database":"database_name","port":5432},}⚠️ Warning ❗️Remember, if you put youraccess_informationinside of your project, add this file into.gitignoreeven if it is a private project, security first 😉After that to use in code, you just need to:# if you do not use path var, it will assume default path as ~/access_information.json, if you want to use another path you can pass this new path# You should pass the 'database_name' that you put on your access_information# With path:path=os.path.expanduser("~/access_information.json")database_access=get_database_access(path)db_handler=DatabaseHandler(database_access["database_name"])############################################################################ You should pass the 'database_name' that you put on your access_information# Without pathdatabase_access=get_database_access()db_handler=DatabaseHandler(database_access["database_name"])To use this connection properlyquery="""select*from table;"""df=pd.DataFrame(db_handler.fetch(query))After use, you should close connectiondb_handler.close()To create table with time series you can use code below, passing start_date, end_date, timezone and frequencydf_script_dim_table=db_handler.create_dim_date('2020-01-01','2020-05-06',tz='utc',freq='D')
Package: dbConnect
dbConnect: Database for HumansWHY?dbConnect was made as a little module to be used in small projects
that need to do some interactions with MySQL or PostgreSQL databases.It’s just a big time saver for developers specially for making data analyzing and data scraping
and it helps to keep your code clean and readable by using python-like structure.Installationrequirements:dbConnect usesmysql.connectorandmysqlclientmodules for mysql, installoneof them using:$apt-getinstallpython3-mysql.connector$apt-getinstallpython-mysql.connectorOr using offical site:https://dev.mysql.com/downloads/connector/python/$pipinstallmysqlclientMore details onmysqlclient:https://github.com/PyMySQL/mysqlclient-pythonFor PostgreSQL install psycopg2 module:$pipinstallpsycopg2using pip:$pipinstalldbConnectfrom source code:$gitclonegit@gitlab.com:mastizada/dbConnect.git$cddbConnect$sudopythonsetup.pyinstallUsageImporting and making a connection:>>>fromdbConnectimportDBConnect>>>database=DBConnect(credentials.json)>>>database.fetch('tableName',limit=5,filters={'company':'pyninjas'})DocumentationDocs:http://dbconnect.readthedocs.org/Alternate Docs:https://pythonhosted.org/dbConnect/Check generated documentation using:$pydoc3dbConnector$pydoc3-p8000and openhttp://localhost:8000/in browserEnjoy
Package: dbcontroller
Welcome toDataBase-ControllerInstallSQLitepython-mpipinstall"dbcontroller[sqlite]"Install PostgreSQLpython-mpipinstall"dbcontroller[sql]""databases[postgresql]"Install MySQLpython-mpipinstall"dbcontroller[sql]""databases[mysql]"InstallMongopython-mpipinstall"dbcontroller[mongo]"InstallTestingpython-mpipinstall"dbcontroller[testing]"To Be Used With . . .sqlalchemyanddatabasespymongoandmotorLinksPyPiGithubRead the Documents
Package: db-converter
DB Converter - MySQL to MongoDB | MongoDB to MySQLThis project is a python library that facilitates data conversion between MongoDB and MySQL databases.InstallationYou can use the following command to install the project:pipinstalldb-converterUsageBy using this project, you can convert a specific table from a MySQL database to a MongoDB collection.You can also convert a specific collection from a MongoDB database to a MySQL table.fromdbconverter.converterimportConverter# DW bilgileriDATAWAREHOUSE_HOST="000.00.0.00"DATAWAREHOUSE_USER="admin"DATAWAREHOUSE_PASSWORD="password"port_number=8080uri="mongodb+srv://admin:password!@cluster0.smovknl.mongodb.net/?retryWrites=true&w=majority"mysql_bilgilerim={'host':DATAWAREHOUSE_HOST,'user':DATAWAREHOUSE_USER,'password':DATAWAREHOUSE_PASSWORD,'port':port_number,'database':'your_db_name'}my_converter=Converter(uri,**mysql_bilgilerim)my_converter.mysql_to_mongodb('test_table')Used Librariespandas: Used for working with data frames.pymongo: Used for communicating with MongoDB.pymysql: Used for connecting to the MySQL database.Classes and MethodsConverter__init__(self, mongo_uri, **kwargs): Creates an instance of Converter by taking MongoDB and MySQL connection information.df_to_json(df) -> list: Converts a DataFrame into JSON objects.mysql_to_mongodb(self, table_name=None): Converts data from a specific MySQL table to a MongoDB collection.MongoDb__init__(self, uri): Establishes a connection to MongoDB.connect(self): Connects to the MongoDB server.insert_data(self, json_data, collection): Inserts JSON data into the specified collection.get_data(self, collection, query=None): Retrieves data from the specified collection.MySQLConnector__init__(self, host, user, password, port_number, database): Establishes a connection to MySQL.connect(self): Connects to the MySQL database.disconnect(self): Closes the connection.fetch_data(self, table) -> pd.DataFrame: Fetches data from the specified table and converts it into a DataFrame.LicenceThis project is licensed under the MIT License. See the LICENSE file for more information.
Package: dbcopy
dbcopyCopy tables from a source database to a destination database, with both databases using different SQL engines. This can be used, for example, to copy the contents from a MySQL or MSSQL database to Postgres. While less civilized, the opposite operation might also work :-PInstallationPlease installdbcopyusing the Python pip command:pipinstall-UdbcopyDepending on the database backend, you may need to also install a connection adapter. Recommended adapters can be installed as extras with the package:pipinstall-Udbcopy[postgres,mssql]UsageYou must always specify a source database connection URI and a target database URI:dbcopy--droppostgresql://localhost/demosqlite:///demo.sqlite3There are additional parameters to skip individual tables or normalize tables and column names to the common snake_case form. For these options, please see:dbcopy--help
Package: dbcp-lite
DBCP LiteA simple, light and nearly featureless database connection pool for Python.Connections are added to the pool as needed up tomax_sizein number.
Once added the connections will remain in the pool and no attempt is made
to shrink the pool. In most cases it is recommended to setmin_size == max_size.Usageimportcx_Oraclefromdbcp_liteimportDBConnectionPoolconnect_args=('scott','tiger','dbhost.example.com/orcl')pool=DBConnectionPool(cx_Oracle.connect,create_args=connect_args,create_kwargs={'threaded':False},min_size=1,max_size=4,name='scott@orcl')withpool.acquire()asconnection:...withpool.acquire_cursor()ascursor:...pool.close()Theacquire_cursor()is a convenience method that returns aCursorusing aConnectionfrom the pool. Upon successful completioncommit()will be
called on theConnectionand theCursorwill be closed.TimeoutsA timeout can be provided to various methods. If no connections are available to
beacquiredorclosedthe methods will raise aPoolTimeoutexception.Lifecycle MethodsThe following lifecycle methods are called during normal operations and alternate
implementations can be provided if needed to perform specialized setup or cleanup.on_acquire(self, connection)- no-opon_return(self, connection)- default implementation callsconnection.rollback()on_close(self, connection)- default implementation callsconnection.close()For example, to implement auto-commit:pool=...pool.on_return=lambdax:x.commit()
Package: dbcreator
dbcreatorThedbcreatorlibrary provides an interface for creating lightweight databases from files.  It currently supports duckdb and s3 parquet files, though there are plans to add sqlite and other source file locations and types in the future.UsageCreating DuckDB Database from Parquet Filesfromflexpathimportcreate_duckdb_database_from_local_parquet# Example for creating database from S3 Parquet filescreate_duckdb_database_from_s3_parquet('target_db.duckdb',FlexPath("s3://bucket-name/prefix"),create_tables=True)The library assumes a specific file naming convention for schema and table name extraction.
For example, a file nameds3://bucket-name/prefix/folder/schemaname_table_name.parquetwill be parsed as a table namedtable_namein a schema namedschemaname.DuckDBConnectionfromflexpathimportDuckDBConnectionwithDuckDBConnection('my_database.duckdb')ascon:# Perform database operations using 'con'FlexPathfromflexpathimportFlexPath# Example for local pathlocal_path=FlexPath("/local/path/to/file.parquet")# Example for S3 paths3_path=FlexPath("s3://bucket-name/prefix/to/file.parquet")Installationpip install dbcreator
Package: db-crud
# requirements_dev.txt we use for the testing
It makes it easier to install and manage dependencies for development and testing, separate from the dependencies required for production.# difference between requirements_dev.txt and requirements.txtrequirements.txt is used to specify the dependencies required to run the production code of a Python project, while requirements_dev.txt is used to specify the dependencies required for development and testing purposes.# tox.ini
We use if for the testing in the python package testing against different version of the python## how tox works tox enviornment creation
1. Install depedencies and packages
2. Run commands
3. Its a combination of the (virtualenvwrapper and makefile)
4. It creates a .tox# pyproject.toml
it is being used for configuration the python project it is a alternative of the setup.cfg file. its containts configuration related to the build system
such as the build tool used package name version author license and dependencies# setup.cfg
In summary, setup.cfg is used by setuptools to configure the packaging and installation of a Python projec# Testing python applicationtypes of testing1. Automated testing
2. Manual testingMode of testing1. Unit testing
2. Integration testsTesting frameworkspytestunittestrobotframeworkseleniumbehavedoctest# check with the code style formatting and syntax(coding standard)pylintflake8(it is best because it containt 3 library pylint pycodestyle mccabe)pycodestyle
Package: dbcurses
dbcursesThis application has been realized mainly inspired by sqlcrush (https://github.com/coffeeandscripts/sqlcrush).
The reason why I decided to create my own version of the application is the need to comfortably display the data in the MySQL database (in a SSH connection) without manually performing SELECTs, and I wasn't able to do so with sqlcrush (the project no longer seems to be maintained). Another reason is that there is no need to install postgresql.However, this project has far less functionality than sqlcrush for the time being and is only used to display data in the database.Actually, only MySQL is supported.InstallTo install this application you can proceed withpip3installdbcursesor clone this repo and install manually.DocumentationThe following are the commands for moving through the application:SPACEBARopen the menu with the list of all the tables in the databasej/korARROW_DOWN/ARROW_UPto scroll through tables and rowsh/lorARROW_LEFT/ARROW_RIGHTto laterally scroll columns+/-to increase/decrease the size of a single columnESCto quit the space menuqto quit the applicationRequirementsFor Ubuntu server be sure unixodbc-dev is installed. If not:sudoapt-getinstallunixodbc-devFuture workThe following features will be added later:Performing database queriesSearch by column to filter results with shortcuts
Package: dbcw
DBCWDBCW (Database Connection Wrapper) is a python package that allows you to connect to different types of databases and contains methods for getting the necessary data.This is a good choice for you if you do not want to deal with queries to the database and you just need basic functionality for getting data.But if you need to send your own query to the database - this is also possible.Supported engines:- PostgreSQL- MySQL / MariaDBDocumentationYou can run thepydocmodule to read the documentation:python-mpydoc-bInstallationUse the package managerpipto install dbcw.pipinstalldbcwUsageImport:fromdbcwimportDBConnectionWrapperPostgreSQL connectionconnection=DBConnectionWrapper(host='localhost',user='root',password='1234')MySQL connectionconnection=DBConnectionWrapper(engine='mysql',host='localhost',user='root',password='1234')Get database list>>>connection.get_db_list()['db1','db2']# output exampleGet tables list from the database>>>connection.get_tables_list('db_name')[('friends','numbers')]# output exampleGet table dataconnection.get_table_data('db_name','table_name')Get database structure (depends on engine)connection.get_db_structure('db_name')Get table structure (depends on engine)connection.get_table_structure('db_name','table_name')Execute custom queryconnection.execute_query('SELECT * FROM table;')ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseMIT
Package: dbdaora
dbdaoraCommunicates withNoSQL(andSQLfor future) databases using repository and service patterns and python dataclassesDocumentation:https://dutradda.github.io/dbdaora/Source Code:https://github.com/dutradda/dbdaoraKey FeaturesCreates an optional service layer with cache and circuit breakerSupports for redis data types:HashSorted Set(Others data types are planned)Backup redis data into other databases:Google DatastoreMongodb(soon)SQL databases with SQLAlchemy(soon)(Others data bases are planned)Support for other databases are in development.RequirementsPython 3.8+jsondaorafor data validation/parsingcircuitbreakercachetoolsOptionals:aioredisgoogle-cloud-datastoreInstalation$ pip install dbdaoraSimple redis hash exampleimportasynciofromdataclassesimportdataclassfromdbdaoraimport(DictFallbackDataSource,DictMemoryDataSource,HashRepository,)@dataclassclassPerson:id:strname:strage:intdefmake_person(name:str,age:int)->Person:returnPerson(name.replace(' ','_').lower(),name,age)classPersonRepository(HashRepository[Person,str]):key_attrs=('id',)repository=PersonRepository(memory_data_source=DictMemoryDataSource(),fallback_data_source=DictFallbackDataSource(),expire_time=60,)person=make_person('John Doe',33)asyncio.run(repository.add(person))geted_person=asyncio.run(repository.query(person.id).entity)print(geted_person)Person(id='john_doe',name='John Doe',age=33)Simple redis sorted set exampleimportasynciofromdbdaoraimport(DictFallbackDataSource,DictMemoryDataSource,SortedSetEntity,SortedSetRepository,)classPlaylist(SortedSetEntity):id:strclassPlaylistRepository(SortedSetRepository[Playlist,str]):...repository=PlaylistRepository(memory_data_source=DictMemoryDataSource(),fallback_data_source=DictFallbackDataSource(),expire_time=60,)data=[('m1',1),('m2',2),('m3',3)]playlist=Playlist(id='my_plalist',data=data)asyncio.run(repository.add(playlist))geted_playlist=asyncio.run(repository.query(playlist.id).entity)print(geted_playlist)Playlist(id='my_plalist',data=[b'm1',b'm2',b'm3'],max_size=None)Using the service layerThe service layer uses the backup dataset when redis is offline, opening a circuit breaker.It has an optional cache system too.importasynciofromdataclassesimportdataclassfromdbdaoraimport(DictFallbackDataSource,DictMemoryDataSource,HashRepository,make_hash_service,)@dataclassclassPerson:id:strname:strage:intdefmake_person(name:str,age:int)->Person:returnPerson(name.replace(' ','_').lower(),name,age)classPersonRepository(HashRepository[Person,str]):...asyncdefmake_memory_data_source()->DictMemoryDataSource:returnDictMemoryDataSource()asyncdefmake_fallback_data_source()->DictFallbackDataSource:returnDictFallbackDataSource()service=asyncio.run(make_hash_service(PersonRepository,memory_data_source_factory=make_memory_data_source,fallback_data_source_factory=make_fallback_data_source,repository_expire_time=60,))person=make_person('John Doe',33)asyncio.run(service.add(person))geted_person=asyncio.run(service.get_one(person.id))print(geted_person)Person(id='john_doe',name='John Doe',age=33)
Package: dbdatareader
dbDataReader - Data Reader for .NET IDataReaderdbDataReaderis a simple data reader for reading .NETSystem.Data.IDataReader-like forward-only streams.The returned data model depends on the type of data container passed in.4 built-in container classes:ListOfListDictOfListListOfDictSqlTvpare shipped with this package.Please refer to theMDX Readerexample and itsproduct documentationfor quick details.Homepage and documentation:https://github.com/DataBooster/PyWebApiCopyright (c) 2020 Abel ChengLicense: MIT
Package: dbdicom
dbdicomis a Pythonic interface for reading and writing DICOM databases.Installationpip install dbdicomDocumentationFor more detail, see the currentdbdicom documentation.AmbitionThe DICOM format is the universally recognised standard for medical imaging, but working with DICOM data remains a challenging task for data scientists.dbdicomaims to provide an intuitive programming interface for reading and writing DICOM databases - replacing unfamiliar DICOM-native concepts by pythonic language and syntax.Disclaimerdbdicomis developed in public and currently trialled in ongoing multi-centre clinical studiesiBEAtandAFiRM. However,dbdicomis work in progress andnot yet sufficiently stable for wider use. Current dissemination activities, such as on theISMRM (Toronto 2023), are limited in scope and intended to get early feedback from the community.
Package: dbdk
NoVa - Discord Bot Dev KitIs a set of funtions and classes to simplify the creation of discord botsInstalling DBDKpipinstalldbdkYou can installDBDKmanually usingPyPIImporting DBDKfromdbdkimport*Creating ARoot@bot.command(name="sample")asyncdefsample_command(ctx:commands.context.Context):root:Root=awaitcreate_root(ctx)Roots are the start and managers of everything inDBDK.
In most cases you will only need1 rootper command.ViewIntroductionAs shown in the example above, we assuming this is inside a command function definition.root:Root=awaitcreate_root(ctx)# by default `root` has a `view` propertyroot.view# You can add items to the view using `add_items` methodawaitroot.view.add_items(Button(on_click_callback,"This is the label"),SelectMenu(on_select_callback,options=[SelectOption]))add_itemsmethod update the root, so changes will be displayed when calledCheckPycord API reference: discord.ui.Viewfor more details.Adding aButtonto theview# Create a on click callback function; this function is called when the button is clickedasyncdefon_click(clicked_button:Button,interaction:discord.Interaction):# respond the interacionawaitinteraction.response.send_message("You Clicked the button!")awaitroot.view.add_items(Button(on_click,label="Click Me!",emoji='🙂'))# That's all, you'll see changes reflected in the root messageCheckPycord API reference: discord.Buttonfor more details.Embedsawaitroot.embeds.add_items(Embed(title="My Embed",description="My embed description :D",color=discord.Color.green()))CheckPycord API reference: discord.Embedfor more details.
Package: db-dtypes
Pandas extension data typesfor data from SQL systems such asBigQuery.Library DocumentationInstallationInstall this library in avirtualenvusing pip.virtualenvis a tool to
create isolated Python environments. The basic problem it addresses is one of
dependencies and versions, and indirectly permissions.Withvirtualenv, it’s possible to install this library without needing system
install permissions, and without clashing with the installed system
dependencies.Supported Python VersionsPython >= 3.7Unsupported Python VersionsPython <= 3.6.Mac/Linuxpip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install db-dtypesWindowspip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install db-dtypes
Package: dbdump
dbdumpFunctionality of the dbdumpExport data from MySQL to Excel,
be it a table or view,Reduce the number of people
with access to your MySQL server,Make Excel the melting pot of data from different source.',UsageMake sure you have Python installed in your system.Run Following command in the CMD.pip install dbdumpExample# test.py

from dbdump import mysqldbToExcel
mysqldbToExcel.dump()Run the following Script.python3 test.pyNoteI have tried to implement all the functionality, it might have some bugs also. Ignore that or please try to solve that bug.
Package: dbeasy-py
dbeasy-pyA package to facilitate the use of database in python. It includes the main methods for creating a simple database, such as:creation of tables;data entry;fetch tables;delete data;delete tables.
And in the future more features will be added.InstalaçãoInstale dbeasy-py com pippipinstalldbeasy-pyMétodos DisponiveisCreate Tabledbeasy_py.dbeasy_py.createTable(db_name)Insert Tabledbeasy_py.dbeasy_py.insertTable(db_name)Search Tabledbeasy_py.dbeasy_py.searchTable(db_name)Delete Tabledbeasy_py.dbeasy_py.deleteTable(db_name)Delete Itendbeasy_py.dbeasy_py.deleteIten(db_name)Autores@brunowanderson7LicençaMITCopyright (c) 2022 Bruno WandersonPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: dbeat
Database-backed Periodic TasksnamevalueVersion1.0.0Downloadhttp://pypi.python.org/pypi/dbeatSourcehttp://github.com/aohan237/dbeatKeywordspeewee, celery, beat, periodic task, cron, schedulingWhy this modulemaybe your proj admin based on django.(django-celery-beat is enough)
but if your apps or proj not based on django, then django orm is hard to use.
then this is the module's purposeUsing the Extensioninstall the modulepython setup.py installinitial database in celery appfrom peewee import SqliteDatabase
database = SqliteDatabase('app.db')
app.database = databasestart the beatcelery -A proj beat -l info --scheduler dbeat.schedulers:DatabaseScheduler
Package: dbe-cli
DB Explorer(DBE) command line toolsBetter performance, higher efficiency and more features.Installationpipinstalldbe-cliIf you want to install this program on Windows, you should install
pyreadline3 first.UsageTake three minutes to fully grasp!First, launch dbe_cliAttention: You need to run an DBE server firstpython-mdbe_cliSecond, connect to one database hostDefault host is the DBE server, not the machine which runs dbe_cliconnectlocalhostThe third and last step, type commandYou can useTABfor autocompletionls# ['ccubase', 'base', 'master', 'Co_1']cdmaster# Now, you moved to 'master' nodepwd# masterYou have completed all the beginner tutorials! You can now take a
look atCommand cheat listMore...You can type?and pressEnterkey to get help information for the program.If you want to know how to use a specific
command, use? <command_name>