Saravanan666/pypi-org huggingface dataset:
Package: dbgdb
This is a library containingLuigitasks to
help you get that data into (and out of) your GIS databases. The library
also comes with a command-line interface based onClickthat can be helpful for running
tasks individually.Getting StartedPrerequisitespip installYou can use pip to install the library itself.pipinstalldbgdbGDAL/OGRYou will also needogr2ogrwhich you can get by installingGDAL.Note: In this early version we expect ``ogr2ogr`` to be in your system
path. Improvements on that point are forthcoming.Using TasksThis library contains a number of tasks that you can use in your Luigi
pipelines.PgLoadTaskUse`PgLoadTask<https://dbgdb.readthedocs.io/en/latest/api.html#dbgdb.tasks.postgres.load.PgLoadTask>`__
task to import your data (likely a file geodatabase) to your PostgreSQL
database.PgExtractTaskUse a`PgExtractTask<https://dbgdb.readthedocs.io/en/latest/api.html#dbgdb.tasks.postgres.extract.PgExtractTask>`__
to get your data out of the database.PgDropSchemaTaskIf you need to drop the import schema because you’re starting the
process over, use`PgDropSchemaTask<https://dbgdb.readthedocs.io/en/latest/api.html#dbgdb.tasks.postgres.drop.PgDropSchemaTask>`__.Using the Command LineA Note about the CLI and LuigiMost of the commands you run with the command-line interface (CLI)
create Luigi tasks which are then submitted to a Luigi scheduler. The-lparameter indicates that the tasks should be run using the local
scheduler. The examples listed below use this parameter.Getting Helpdbgdbhas its own command-line help.dbgdb--helpLoad DataYou can load a file geodatabase with theloadsubcommand.dbgdb-lload--schemamyschema/path/to/your/data.gdbExtract DataYou can extract all of the data within a schema to an output file with
theextractsubcommand.dbgdb-lextract--schemamyschema/path/to/your/exported/data.dbNote: At the moment, we can export to
`GeoPackage <https://www.geopackage.org/>`__ or
`Spatialite <https://www.gaia-gis.it/fossil/libspatialite/index>`__
formats. Support for ESRI File Geodatabses (gdb) is still in the
works.Drop a SchemaIf the target schema for yourloadcommand already exists, you may
notice Luigi reports there was nothing to do because, from the task’s
perspective, the work is already done. If you need to drop a schema, you
can use thedropsubcommand.dbgdb-ldropschemamyschemaResourcesWould you like to learn more? Check out the links below!LuigiClickAuthorsPat Daburu-Initial work-githubSee also the list ofcontributorswho participated in this project.LicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details
Package: dbgDecorator
Python Debugging Decorators / Python调试装饰器概览 / Overview这个Python库提供了一系列用于调试的装饰器，用于追踪函数和方法调用，记录异常，以及注释代码流程。可用的装饰器有：universal_exception_logger: 记录由装饰的函数或类的方法抛出的任何异常。universal_decorator: 一个可配置的装饰器，可用于各种调试注释。debug_trace_class: 为类的所有可调用方法添加追踪。This Python library provides a collection of debugging decorators to assist you in tracing function and method calls, logging exceptions, and annotating code flow. The available decorators are:universal_exception_logger: Logs any exceptions that are thrown by the decorated function or methods of the decorated class.universal_decorator: A configurable decorator that can be used for various debug annotations.debug_trace_class: Adds tracing to all callable methods of a class.安装 / Installation克隆仓库或下载源代码。在你的Python脚本中导入装饰器。Clone the repository or download the source code. Import the decorators into your Python script.使用方法 / Usage通用异常记录器 / Universal Exception Logger要记录函数或类的所有方法抛出的异常，使用universal_exception_logger。fromyour_libraryimportuniversal_exception_logger@universal_exception_loggerdefyour_function():# Your code here对于类：@universal_exception_logger
class YourClass:
    # Your methods hereTo log exceptions thrown by a function or all methods of a class, useuniversal_exception_logger.from your_library import universal_exception_logger

@universal_exception_logger
def your_function():
    # Your code hereFor classes:@universal_exception_logger
class YourClass:
    # Your methods here通用装饰器 / Universal Decoratoruniversal_decorator可以使用各种选项进行自定义。这里有一个简单的示例：from your_library import universal_decorator

@universal_decorator(color="red")
def another_function():
    # Your code hereTheuniversal_decoratorcan be customized using various options. Here is a simple example:from your_library import universal_decorator

@universal_decorator(color="red")
def another_function():
    # Your code here调试追踪类 / Debug Trace Class要为类的所有可调用方法添加追踪，使用debug_trace_class。from your_library import debug_trace_class

@debug_trace_class
class YourClass:
    # Your methods hereTo add tracing to all callable methods of a class, usedebug_trace_class.from your_library import debug_trace_class

@debug_trace_class
class YourClass:
    # Your methods here调试颜色代码 / Debugging Color Codes在某些装饰器中，你可以指定颜色。可用选项有：黑色 / black红色 / red绿色 / green黄色 / yellow蓝色 / blue品红 / magenta青色 / cyan白色 / white示例 / Examples源代码中包含了一些注释掉的示例。取消注释它们以查看装饰器的效果。A few examples are included as comments in the source code. Uncomment them to see the decorators in action.许可 / License本项目根据MIT许可证进行许可 - 有关详细信息，请参阅LICENSE.md文件。This project is licensed under the MIT License - see theLICENSE.mdfile for details.你可以根据需要进行适当的修改或添加其他信息。这个README应该为使用你的库的人提供足够的信息。
Package: dbgear
DBGear特徴データベースの初期データの管理を行います。データ編集用のUIが用意されており、簡単にデータの編集が行えます。テーブル定義の内容は初期データへにも反映され、データの編集を容易にします。関連データも定義することが可能で、IDのコピペなどを行う必要がありません。ユニットテストなどとの連携も行い、より整合性の高いテストを実施できます。保存データはYAML形式で保存されており、Gitなどのバージョン管理、差分管理が可能です。インストールpipinstalldbgearプロジェクトファイルの準備（準備中）実行以下のコマンドで管理ツールが起動できます。dbgear serveブラウザでhttp://localhost:5000にアクセスすると管理画面が表示されます。
Package: dbgen
DBGen is a python package providing a general purpose database
to support genomic data analysis studies.The current implementation is based on mongoDB.Quick startYou can install DBGen along with all its dependencies fromPyPI:$pipinstall-rrequirements.txtdbgenSourceThe source code and minimal working examples can be found onGitHub.DocumentationDocumentation for thelatest stable versionis available on ReadTheDocs.Running testsYou can run all unittests from command line by using python:$python-munittestdiscoveror coverage:$coveragerun-munittestdiscoverContributingPlease read thecontributing sectionfor details on our code of conduct, and the process for submitting pull requests to us.AuthorsPietro Barbiero, Computational Scientist.LicenceCopyright 2020 Pietro Barbiero.Licensed under the Apache License, Version 2.0 (the “License”); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at:http://www.apache.org/licenses/LICENSE-2.0.Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions and
limitations under the License.
Package: db-generator
#Use forThis project allows user to define json structure for creating sqlite3
database as defined in the json file.#Use the following codeimport os
from src.main import maindef generator():
To generate the schema for us
sr = input('Enter your source of json file> ')
dis = input('Enter your destination for .db file> ')
main(sr, dis)ifname== 'main':
generator()make surethat the json structure is same as the given structure.
Have following project structureyour project
|
|json_folder
|
|json_files
main.py
Package: dbghelper
Convenience method for manually inserting tracepoints into code that support multiple debuggersimportdbg;dbg.D()as an alternative to:importpdb;pdb.set_trace()This supports multiple debuggers; currentlypdb(orPdb++if installed),winpdb, andpydevd(which is used inside bothPyDevandPyCharm).Selecting the debuggerThe debugger desired can be selected by setting the environment variable PYDBG. The following are valid values:pydevdorpycharmwill use pydevd locally (if running in debug mode) or remotely if notpydevd_remoteorpycharm_remotewill use pydevd remotelypydevd_localorpycharm_localwill use pydevd locally, and warn if not running in debug modewinpdbwill use winpdbpdbwill use pdb  (default)An environment variable is used so that imports of the debugger libraries can be determined at import time.Inserting a tracepointCalldbg.D()to insert a tracepoint in the code; the appropriate debugger should launch when that line of code
is executed, ready to execute the following line.A thread-safe versiondbg.tsD()``isalso supported. This is only different when using ``pdb; in that case multiple
threads having tracepoints (for example, in a web server) can cause confusion as multiple debug sessions get attached
to the same console. ThetsDimplementation uses a lock to only allow one debug session to use the console at once;
other sessions are not allowed the lock until the debug interaction is finished (e.g. typingcfor continue).Parameters for debuggersSome debuggers have parameters that can be set using environment variables, or at runtime.pydevdimplementation will use the value of the environment variablesPYDEVD_HOSTfor hostname andPYDEVD_PORTfor port when connecting remotely by default. These can also be adjusted on by settingdbg.pydevd_args.hostanddbg.pydevd_args.portat runtime.
Package: dbgis
'python-dbgis is an extension to Psycopg_ and pyspatialite_, respectively aPostgreSQL_ and SQLite_ database adapter for the Python_ programming language.python-dbgis support geometry objects used by PostGIS_ and SpatiaLite_ bytranslating between their EWKB representation and Python objects.python-dbgis has been tested with Python 2.7.python-dbgis is based on PPyGIS_ written by Bartosz Fabianowski(bartosz@fabianowski.eu). Modifications_ written by Nicolas Évrard(nicoe@b2ck.com) for Bio Eco Forests... _PPyGIS: http://www.fabianowski.eu/projects/ppygis/.. _pyspatialite: http://pyspatialite.googlecode.com/.. _SQLite: http://www.sqlite.org/.. _Psycopg: http://initd.org/psycopg/.. _PostgreSQL: http://www.postgresql.org/.. _Python: http://www.python.org/.. _PostGIS: http://postgis.refractions.net/.. _SpatiaLite: http://www.gaia-gis.it/spatialite/'
Package: dbgprint
dbgprintDebug Print is a handy command line print app used for debugging loops and variable changes over time.It has features for tracking pivots in a while and for loop, and also print the information and data types of variablesIts dependencies are termcolor and colorama.For python package:https://pypi.org/project/dbgprint/For github repo:https://github.com/youhengzhou/dbgprintDownload Packagepy -m pip install dbgprint -UIn Your Python Filesimport dbgprintCommandsCreate command:dbgprint.data(dataContent, dataName, action)This will print the data's contents, the data's variable name, and the actions associated with the data at your discretion.
Package: db-hammer
db-hammer[中文] [English]db-hammer是个简单数据库工具库，在 Python DB-API上提供一些高级方法；方便大家经常做数据库查询。
提供方便的导出数据功能，可高性能、稳定的导出超大表数据。
目前已对 MySQL、Oracle、MSSQL、PostgreSQL 数据进行封装，封装其他结构化数据库也很简单。安装pip3installdb-hammerPython Console>>>fromdb_hammer.mysqlimportMySQLConnection>>>db_conf={"host":"10.0.0.10","user":"dbuser","pwd":"dbpassword","database":"database"}>>>db=MySQLConnection(**db_conf):>>>r=db.select_dict_list("select * from t_student")>>>r[{'name':'小明','sex':'男','age':18,'address':'湖南省长沙岳麓区','mobile':'13012345678'},{'name':'小花','sex':'女','age':16,'address':'江苏省南京市鼓楼区','mobile':'13100000001'}]Python Withfromdb_hammer.mysqlimportMySQLConnectiondb_conf={"host":"10.0.0.10","user":"dbuser","password":"dbpassword","database":"database"}withMySQLConnection(**db_conf)asdb:i_sql=db.gen_insert_dict_sql(dict_data={"name":"小白","sex":"男","age":"20","address":"上海市虹口区",},table_name="t_student")db.execute(i_sql)db.commit()rs=db.select_dict_list(sql="select * from t_student")print(rs)连接其他数据库fromdb_hammer.oracleimportOracleConnectionfromdb_hammer.postgresqlimportPostgreSQLConnectionfromdb_hammer.mssqlimportMsSQLConnectiondb_oracle=OracleConnection(**db_conf)db_psql=PostgreSQLConnection(**db_conf)db_mssql=MsSQLConnection(**db_conf)导出数据库数据withMySQLConnection(**mysql_conf)asdb:db.export_data_file(sql="select * from exam_rule_b",dir_path="./export_data",file_mode="csv")根据SQL:select * from exam_rule_b导出到./export_data，默认为分割文件，导出文件类型支持：txt、csv、gz，可以传入文件编码格式：encoding游标方式导出，实际测试大表导出，20个G都没有问题。且导出性能较高，使用gz格式导出时，自动压缩，且很多工具支持直接读取gz文本。开启日志importlogginglogging.basicConfig(level=logging.DEBUG,format='%(asctime)s%(filename)s[line:%(lineno)d]%(levelname)s%(message)s',datefmt='%Y-%m-%d%H:%M:%S')常用数据库方法列表# 根据sql获取页数select_page_size(sql:str,page_size=50)# 获取分页列表数据,列表字典形式返回select_page_list(sql:str,page_size=50,page_start=1,**kwargs)# 获取分页列表数据,列表字典形式返回select_dict_page_list(sql:str,page_size=50,page_start=1,**kwargs)# 获取第一列第一行的值select_value(sql:str)# 获取列表数据,列表方式返回select_list(sql:str)# 获取所有列表数据，列表字典形式返回select_dict_list(sql:str)# 获取第一行数据，字典形式返回select_dict(sql:str)# 执行SQL,并返回影响行数execute(sql:str)# 关闭连接close()# 回滚事务rollback()# 提交事务commit()# 根据字典生成 Insert SQLgen_insert_dict_sql(dict_data:dict,table_name:str)# 根据字典来生成 Update SQLgen_update_dict_sql(dict_data:dict,table_name:str,where:str)# 根据sql语句把数据生成 Insert SQLselect_insert_sql(sql:str,table_name:str)其他小工具# 执行本地命令db_hammer.util.cmd# 简单的日期转换db_hammer.util.date# 获取文件和目录工具（好用）db_hammer.util.file# 简单保存键值工具db_hammer.util.keep# 一个简单的收发邮件工具db_hammer.util.sim_email
Package: db-handler
Database Connection LibraryThis library provides two classes,ACCESSdbcandSSMSdbc, for connecting to Microsoft Access and SQL Server databases respectively.Installationpipinstalldb_handlerUsageConnecting to a Microsoft Access Databasefromdb_handlerimportACCESSdbc# Create an instance of ACCESSdbcdb=ACCESSdbc('path_to_your_database_file')# Connect to the databaseifdb.connect():# Execute a query and get the resultsresults=db.execute_query_return_results('SELECT * FROM your_table')# Don't forget to disconnect when you're donedb.disconnect()Connecting to a Microsoft SQL Server Databasefromdb_handlerimportSSMSdbc# Create an instance of SSMSdbcdb=SSMSdbc('your_server','your_database','your_username','your_password')# Connect to the databaseifdb.connect():# Execute a query and get the resultsresults=db.execute_query_return_results('SELECT * FROM your_table')# Don't forget to disconnect when you're donedb.disconnect()
Package: dbh-bots-wrapper
dbh-bots-wrapper - DanBot Hosting Bots API WrapperOverviewThedbh-bots-wrapperis a Python module designed to simplify interactions with the DanBot Hosting API for adding Discord bots. It provides abotclass with methods for adding bots, retrieving bot information, and obtaining information of all bots.InstallationTo usedbh-bots-wrapper, you must install it first. You can do this using the following command:pipinstalldbh-bots-wrapperUsageImporting the Modulefromdbh-bots-wrapperimportbotInitializing the Botmy_bot=bot(discord_id="YOUR_DISCORD_BOT_ID",owner_id="YOUR_DISCORD_USER_ID",api_key="YOUR_DBH_API_KEY",name="BotName",avatar="AvatarURL",users=1000,guilds=10,shards=1)API InformationTo retrieve information about the bot:info=my_bot.info()print(info)Bot StatusTo retrieve the status of the API from the DanBot Hosting API:status=my_bot.status()print(status)Adding a BotTo add the bot to DanBot Hosting:add_result=my_bot.add_bot()print(add_result)Retrieving a BotTo retrieve information about a specific bot:bot_info=my_bot.get_bot()print(bot_info)Retrieving Bot ListTo retrieve a information of all bots:bots_list=my_bot.get_bots()print(bots_list)Examplefromdbhwrapperimportbot# Initialize the botmy_bot=bot(discord_id="123456789012345678",owner_id="987654321098765432",api_key="YOUR_DBH_API_KEY",name="MyAwesomeBot",avatar="https://example.com/avatar.png",users=1000,guilds=10,shards=1)# Retrieve bot informationinfo=my_bot.info()print("Bot Information:",info)# Retrieve bot statusstatus=my_bot.status()print("Bot Status:",status)# Add the bot to DanBot Hostingadd_result=my_bot.add_bot()print("Add Bot Result:",add_result)# Retrieve information about the added botbot_info=my_bot.get_bot()print("Bot Info:",bot_info)# Retrieve a list of bots associated with the userbots_list=my_bot.get_bots()print("User's Bots:",bots_list)Replace the placeholder values with your actual Discord bot and user information.DanBot[!NOTE]
Found a bug? Open aGitHub Issue. Found a vulnerability? Open a ticket in ourDiscord Server(Soon enough on a support website!)Made with ❤️ byDanBot Hosting.
Package: dbh-pyutils
DBH PyUtilsThese are Python utilities I'm building out as I traverse the machine learning landscapePrerequisitesYou'll want to have Python > 3.10 installedAnd pip (you gotta have pip intalled ffs)To build/install locallycd myprojects
git clone https://github.com/deevis/dbh-pyutils.git
cd dbh-pyutils
python setup.py bdist_wheel
pip install --force-reinstall .\dist\dbh_pyutils-0.1.0-py3-none-any.whlto deploy to pypiupdate version in setup.pypython setup.py sdisttwine upload dist/*UsagesearchYouTubeAPI and getYouTubeVideoInfoRequire YOUTUBE_API_KEY be set for os.getenv('YOUTUBE_API_KEY') to succeedBranchesmain
Package: dbhydra
dbhydraData science friendly ORM (Object Relational Mapping) library combining Python, Pandas, and various SQL dialects
For full documentation see officialdocumentation- currently unavailable but we're working on it!InstallationUse the package managerpipto install dbhydra.pipinstalldbhydraUsageimportdbhydra.dbhydra_coreasdhdb1=dh.db()table1=dh.Table(db1,"test",["test1","test2","test3","test4"],["int","int","int","int"])#table1.drop()#table1.create()#rows=[[1,2,3,4],[5,4,7,9]]#table1.insert(rows)list1=table1.select("SELECT * FROM test")print(list1)#list2=table1.select_all()#print(list2)#table1.drop()table1.export_to_xlsx()tables=db1.get_all_tables()table_dict=db1.generate_table_dict()print(tables)columns=table_dict['test'].get_all_columns()types=table_dict['test'].get_all_types()print(columns,types)table_test=dh.Table.init_all_columns(db1,"test")print(table_test.columns)table2=dh.Table(db1,"test_new",["id","test2"],["int","nvarchar(20)"])#table2.create()#table2.drop()Current scopeAims: Easy integration with Pandas, SQL SERVER/MySQL database, and exports/imports to/from excel/CSV formatDone: Table functions (Create, Drop, Select, Update, Insert, and Delete) should be working fineTodo: Group by, Order by, Where, Linking of FK, Customizable PK,...ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseMIT
Package: dbinfo
DbInfo is a Python 2.x library and command line tool
to extract information and provide util methods to
work with BBDDs.Implemented in PostgreSQL, and MySQL (incomplete).Development in progress.InstallationInstall with pip in your env:$ pip install dbinfoSeeINSTALL.rstguide to install from the sources.AboutProject:https://launchpad.net/dbinfoAuthors: (2013-2014) Mariano Ruiz <mrsarm@gmail.cm>License: LGPL-3
Package: dbinspector
DBInspectorA Python context manager for use with SQLAlchemy.FeaturesCount the number of queires issued.Capture/print the statements/queries issued.Installationpip install dbinspectorUsagewith DBInspector(conn) as inspector:
    conn.execute("SELECT 1")
    conn.execute("SELECT 1")

    # Get query count
    assert inspector.get_count() == 2

    # Print queries issued
    inspector.print_queries(pretty=True)

    # Example pretty printed output:
    """
    QUERY #1
    ----------
    SELECT 1

    QUERY #2
    ----------
    SELECT 1
    """APIDBInspector.get_count() -> int

DBInspector.print_queries(pretty=False)
Package: db_integration_test
Easily setup relational database fixtures and assert database contents in unittest.Install$pipinstalldb_integration_testUsagefromdbitimportDatabaseTestCase,fixtureclassSomeTest(DatabaseTestCase):defsetUp(self):# the DB connection has to be created before the setUp is run.# DatabaseTestCase only ever creates a single connection. Multiple calls to connect are ignored.# to connect to a different DB, call self.disconnect(), then self.connect() with a different connection string.# uses SQLAlchemy under the hoodself.connect('postgresql+psycopg2://user:pass@localhost/test_db')super().setUp()@fixture("table_name",[{'id':1,'value':'abc'},{'id':2,'value':'def'}])deftest_something_with_your_database(self):# interact with the DB# self.engine contains the SQLAlchemy Engine# self.session contains the SQLAlchemy ORM session# self.base contains the automap base for the current database# self.disconnect() disconnects from the DB# assert that the table contents match the fixture exactlyself.assertMatchFixture("table_name",self.get_table_contents(self.base.classes.table_name))# assert that some number of rows appear in the fixtureself.assertAllInFixture("table_name",[{'id':1,'value':'abc'}])
Package: dbinterface
dbinterfacePython 连接数据库，执行读写操作的通用接口，采用简单工厂模式，基于接口和组合进行编程。安装gitclonehttps://github.com/somenzz/dbinterface.gitpipinstall-rrequirements.txt
pipinstalldbinterface使用方法读取数据fromdbinterface.database_clientimportDataBaseClientFactoryclient1=DataBaseClientFactory.create(dbtype="postgres",host="localhost",port=5432,user="postgres",pwd="121113",database="postgres",)result1=client1.read("select current_date")forrowinresult1:#do somethingpassclient=DataBaseClientFactory.create(dbtype="mysql",host="localhost",port=3306,user="aaron",pwd="aaron",database="information_schema",)result2=client.read("select current_date()")forrowinresult2:#do somethingpass更新数据fromdbinterface.database_clientimportDataBaseClientFactoryclient1=DataBaseClientFactory.create(dbtype="postgres",host="localhost",port=5432,user="postgres",pwd="121113",database="postgres",)rows_affeted=client1.write("insert into tmp_test_table values(%s,%s)",("1","aaron"))assertrows_affeted==1导出数据fromdbinterface.database_clientimportDataBaseClientFactoryclient=DataBaseClientFactory.create(dbtype="postgres",host="localhost",port=5432,user="postgres",pwd="121113",database="postgres",)rows_export=client.export("select * from information_schema.TABLES",params=(),file_path="/Users/aaron/tmp/mysql_tables.txt",delimeter="0x02",quote="0x03",all_col_as_str=False,)assertrows_export>0获取表名列表fromdbinterface.database_clientimportDataBaseClientFactoryclient=DataBaseClientFactory.create(dbtype="postgres",host="localhost",port=5432,user="postgres",pwd="121113",database="postgres",)table_list=client.get_tables()fortableintable_list:print(table['name'])print(table['type'])print(table['schema'])print(table['remarks'])扩展修改 database_interface.py 文件，添加新的函数添加新的数据库，以 oracle 为例，在 dbinterface 目录下，新增 oracle_client.py 文件，参考其他 client 编写即可。然后修改 dbinterface 目录下 database_client.py 文件，修改 DataBaseClientFactory 类，添加对应的数据库类型。tests 目录内添加单元测试，执行 pytess 测试联系我微信号 somenzz
公众号 「Python七号」