{"library":"pangres","title":"Pangres","description":"Pangres is a Python library that provides efficient upsert (insert/update) functionality for pandas DataFrames into SQL databases (PostgreSQL, MySQL, SQLite) via SQLAlchemy. It supports both synchronous and asynchronous operations, with automatic table creation and schema inference. The current version is 4.2.1, with monthly or irregular releases.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install pangres"],"cli":null},"imports":["from pangres import upsert","from pangres import aupsert"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pandas as pd\nfrom sqlalchemy import create_engine\nfrom pangres import upsert\n\nengine = create_engine('postgresql://user:pass@localhost/db')\ndf = pd.DataFrame({'id': [1, 2], 'value': ['a', 'b']}).set_index('id')\nupsert(con=engine, df=df, table_name='my_table', if_row_exists='update')","lang":"python","description":"Inserts or updates rows in PostgreSQL using a DataFrame with a primary key index. The engine can be replaced with a connection for transaction control.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}