{ "info": { "author": "Simon Muller", "author_email": "samullers@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 3 :: Only", "Topic :: Database", "Topic :: Utilities" ], "description": "# pgmerge - a PostgreSQL data import and merge utility\n\n[![Build Status](https://travis-ci.org/samuller/pgmerge.svg?branch=master)](https://travis-ci.org/samuller/pgmerge)\n[![PyPI version](https://badge.fury.io/py/pgmerge.svg)](https://badge.fury.io/py/pgmerge)\n\nThis utility's main purpose is to manage a set of CSV files that correspond with tables in a PostgreSQL database. Each of these CSV files can then be *merged* into their table, meaning that the following process will occur (also called an *upsert* operation):\n\n* Rows whose primary key don't yet exist in the table will be imported.\n* When the primary key already exists, row values will be updated.\n* Rows that are missing or unchanged will be ignored.\n\npgmerge can then also export data in the same format expected for import.\n\nThese features allow you to move data between databases with the same schema to keep them up to date and in sync, although it does not cover handling deleted data.\n\n $ pgmerge --help\n Usage: pgmerge [OPTIONS] COMMAND [ARGS]...\n\n Merges data in CSV files into a Postgresql database.\n\n Options:\n --version Show the version and exit.\n --help Show this message and exit.\n\n Commands:\n export Export each table to a CSV file.\n import Import/merge each CSV file into a table.\n inspect Inspect database schema in various ways.\n\n### Import\n\n $ pgmerge import --help\n Usage: pgmerge import [OPTIONS] DIRECTORY [TABLES]...\n\n Import/merge each CSV file into a table.\n\n All CSV files need the same name as their matching table and have to be located\n in the given directory. If one or more tables are specified then only they will\n be used, otherwise all tables found will be selected.\n\n Options:\n -d, --dbname TEXT Database name to connect to. [required]\n -h, --host TEXT Database server host or socket directory.\n [default: localhost]\n -p, --port TEXT Database server port. [default: 5432]\n -U, --username TEXT Database user name. [default: postgres]\n -s, --schema TEXT Database schema to use. [default: public]\n -w, --no-password Never prompt for password (e.g. peer\n authentication).\n -W, --password TEXT Database password (default is to prompt for\n password or read config).\n -L, --uri TEXT Connection URI can be used instead of specifying\n parameters separately (also sets --no-password).\n -f, --ignore-cycles Don't stop import when cycles are detected in\n schema (will still fail if there are cycles in\n data)\n -F, --disable-foreign-keys Disable foreign key constraint checking during\n import (necessary if you have cycles, but requires\n superuser rights).\n -c, --config PATH Config file for customizing how tables are\n imported/exported.\n -i, --include-dependent-tables When selecting specific tables, also include all\n tables on which they depend due to foreign key\n constraints.\n --help Show this message and exit.\n\n## Installation\n\n> WARNING: the reliability of this utility is not guaranteed and loss or corruption of data is always a possibility.\n\n### Install from PyPI\n\nWith `Python 3` installed on your system, you can run:\n\n pip install pgmerge\n\n(your `pip --version` has to be 9.0 or greater). To test that installation worked, run:\n\n pgmerge --help\n\nand you can uninstall at any time with:\n\n pip uninstall pgmerge\n\n### Install from Github\n\nTo install the newest code directly from Github:\n\n pip install git+https://github.com/samuller/pgmerge\n\n### Issues\n\nIf you have trouble installing and you're running a Debian-based Linux that uses `Python 2` as its system default, then you might need to run:\n\n sudo apt install libpq-dev python3-pip python3-setuptools\n sudo -H pip3 install pgmerge\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/samuller/pgmerge", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pgmerge", "package_url": "https://pypi.org/project/pgmerge/", "platform": "", "project_url": "https://pypi.org/project/pgmerge/", "project_urls": { "Homepage": "https://github.com/samuller/pgmerge" }, "release_url": "https://pypi.org/project/pgmerge/1.8.0/", "requires_dist": [ "psycopg2-binary", "networkx (==1.11)", "click (==6.7)", "sqlalchemy (==1.3.5)", "appdirs (==1.4.3)", "PyYAML (==5.1.1)", "rxjson (==0.3)" ], "requires_python": ">=3", "summary": "PostgreSQL data import/export utility", "version": "1.8.0" }, "last_serial": 5573241, "releases": { "1.1.0": [ { "comment_text": "", "digests": { "md5": "504d30d24aceff8007bd05c78ec1ad3e", "sha256": "24897bf50815e81d4f08a214b80365218bfd01c0063d8cdcc9c6075a274b35d9" }, "downloads": -1, "filename": "pgmerge-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "504d30d24aceff8007bd05c78ec1ad3e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 24367, "upload_time": "2018-02-26T07:40:28", "url": "https://files.pythonhosted.org/packages/c9/72/f8b0bdbe386eb178893b79e0b1f1be04d8f7f0704f902b43462202295950/pgmerge-1.1.0-py3-none-any.whl" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "ab8e776152e1fe86210323b9004d13e8", "sha256": "005f43c942ef4e05892a54f0f458bd1068108c997e283d1968d3937cc2bc74c2" }, "downloads": -1, "filename": "pgmerge-1.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ab8e776152e1fe86210323b9004d13e8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 25266, "upload_time": "2018-04-18T21:11:16", "url": "https://files.pythonhosted.org/packages/69/9c/1c5688f26bbc7d521c9cbe2969e287a73b33a14ea84240a392044dc9d852/pgmerge-1.5.0-py3-none-any.whl" } ], "1.6.0": [ { "comment_text": "", "digests": { "md5": "0852025f792b1228f96081c7b1ddc1b4", "sha256": "0f8c162978f35d591f2027a0b06fa98ffc41ed047fafa1fd974d06c3aab2a4c8" }, "downloads": -1, "filename": "pgmerge-1.6.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0852025f792b1228f96081c7b1ddc1b4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 26201, "upload_time": "2018-04-21T13:40:29", "url": "https://files.pythonhosted.org/packages/de/36/dc2dc0cf272a7e923e3a7c9314691c389fd43ee172380af97531afd3b8d6/pgmerge-1.6.0-py3-none-any.whl" } ], "1.6.1": [ { "comment_text": "", "digests": { "md5": "8ac51019f499d2238ad5ecd68d630482", "sha256": "2f3d7a295423e30950058f6386c26690bfb743e18f13d8493f4a057ccbb1372b" }, "downloads": -1, "filename": "pgmerge-1.6.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8ac51019f499d2238ad5ecd68d630482", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 26302, "upload_time": "2018-04-23T19:04:42", "url": "https://files.pythonhosted.org/packages/15/22/f67e0e610be6d00da2f6871b44da95ee1aa205e4b75d3d8097aa70c2f390/pgmerge-1.6.1-py3-none-any.whl" } ], "1.6.2": [ { "comment_text": "", "digests": { "md5": "475692db75ef63766c5faf3d26df7fdb", "sha256": "3807846b54a8dee2d0d32f5744649ceec98d13ba88f8e6c743bb91e1d789b275" }, "downloads": -1, "filename": "pgmerge-1.6.2-py3-none-any.whl", "has_sig": false, "md5_digest": "475692db75ef63766c5faf3d26df7fdb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 26397, "upload_time": "2018-04-23T19:14:52", "url": "https://files.pythonhosted.org/packages/71/03/22a1eb6ef5cecc340ca4b1c5953dc5adf26ca0136a8c7e08451d883a9a78/pgmerge-1.6.2-py3-none-any.whl" } ], "1.7.0": [ { "comment_text": "", "digests": { "md5": "660fe2af2aecc448af6ce3c582f827a0", "sha256": "a6d0f91a607fa5433639ccf94cc84d5f2a2b2e45d6a6ddea0e23fe0ea8df3e63" }, "downloads": -1, "filename": "pgmerge-1.7.0-py3-none-any.whl", "has_sig": false, "md5_digest": "660fe2af2aecc448af6ce3c582f827a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 26508, "upload_time": "2018-04-24T20:01:03", "url": "https://files.pythonhosted.org/packages/1b/34/02503235f449d550227dfe657e9d45b8e74660084d2bfcc2d367d6937004/pgmerge-1.7.0-py3-none-any.whl" } ], "1.8.0": [ { "comment_text": "", "digests": { "md5": "b29de9e97b802a73661db978579bf7bc", "sha256": "b22cfe18a75d0e9090f6e03e0e86d15515687f6d3178702bc9a48be14d326497" }, "downloads": -1, "filename": "pgmerge-1.8.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b29de9e97b802a73661db978579bf7bc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 30549, "upload_time": "2019-07-23T16:06:13", "url": "https://files.pythonhosted.org/packages/a7/2d/6f65ccb8263f97fbe523ee55d28a4a990316ee78e11f680b259427fdf35b/pgmerge-1.8.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b29de9e97b802a73661db978579bf7bc", "sha256": "b22cfe18a75d0e9090f6e03e0e86d15515687f6d3178702bc9a48be14d326497" }, "downloads": -1, "filename": "pgmerge-1.8.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b29de9e97b802a73661db978579bf7bc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 30549, "upload_time": "2019-07-23T16:06:13", "url": "https://files.pythonhosted.org/packages/a7/2d/6f65ccb8263f97fbe523ee55d28a4a990316ee78e11f680b259427fdf35b/pgmerge-1.8.0-py3-none-any.whl" } ] }