{
"info": {
"author": "James Routley",
"author_email": "jroutley@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6"
],
"description": "===========================================\nPtolemy, an AWS DMS table mapping generator\n===========================================\n\nWrite terse AWS DMS table mappings.\n\n\nBackground\n----------\n\nAmazon Web Services provides a tool for migrating data to, from or between SQL databases. This tool is named `Database Migration Service `_ (DMS). When running DMS, users can supply a table mapping, which specifies allows the user to control what data is sent from the source database to the target database. A full list of table mapping options can be found `here `_.\n\nTable mappings are written as JSON documents, which can grow to be long and complex. ``ptolemy`` allows the user to write terse YAML ``source`` files, which can be compiled to valid JSON table mappings using the ``ptolemy`` cli tool.\n\n\nUsage\n-----\n\n.. code-block:: console\n\n $ # Display an example source file:\n $ cat migrate_all_tables_in_a_schema.yaml\n selection:\n include:\n -\n object-locators:\n schema-names:\n - Test\n table-names:\n - \"%\"\n $ # Compile it to a DMS table mapping:\n $ ptolemy migrate_all_tables_in_a_schema.yaml\n {\n \"rules\": [\n {\n \"object-locator\": {\n \"schema-name\": \"Test\",\n \"table-name\": \"%\"\n },\n \"rule-action\": \"include\",\n \"rule-id\": \"1\",\n \"rule-name\": \"1\",\n \"rule-type\": \"selection\"\n }\n ]\n }\n\n\nAPI\n---\n\n.. code-block:: console\n\n $ ptolemy -h\n ptolemy [-h] [-d] [-v] source\n\n positional arguments:\n source path to the source file\n\n optional arguments:\n -h, --help show this help message and exit\n -d, --debug enable debug logs\n -v, --version show program's version number and exit\n\n\nInstall\n-------\n\nInstall via pip (recommended):\n\n.. code-block:: console\n\n $ pip install ptolemy\n\nInstall from source:\n\n.. code-block:: console\n\n $ git clone git@github.com:cloudreach/ptolemy.git\n $ cd ptolemy\n $ make install\n\n\nLicense\n-------\n\nptolemy is licensed under the Apache Software License 2.0.\n\n\nSource Syntax\n-------------\n\nThe following sections describe the source syntax. It is intended to show users who have working knowledge of DMS JSON mapping files how to write their YAML equivalents. For an overview of the JSON mapping files, see the `documentation `_. Most items are the same as those in JSON mapping files, with the exception of ``object-locators``, which are explained in the section `Object Locators`_\n\nThe descriptions are written in pseudo-yaml, where the syntax ``( option_a|option_b )`` indicates that an item could take the value ``option_a`` or ``option_b``.\n\nFor working examples, see the `examples directory `_.\n\n\nSelection Rules and Actions\n***************************\n\n.. code-block:: YAML\n\n selection:\n ( include|exclude ):\n -\n object-locators:\n schema-names:\n - \n table-names:\n - \n filters:\n -\n filter-type: source\n column-name: \n filter-conditions:\n -\n filter-operator: ( ste|gte|eq|between )\n value: \n\n\nTransformation Rules and Actions\n********************************\n\n.. code-block:: YAML\n\n transformation:\n ( rename|remove-column|convert-lowercase|convert-uppercase|add-prefix|remove-prefix|replace-prefix|add-suffix|remove-suffix|replace-suffix ):\n -\n object-locators:\n schema-names:\n - \n table-names:\n - \n column-names:\n - \n rule-target: ( schema|table|column )\n value: \n old-value: \n\n\nObject Locators\n***************\n\n``object-locators`` offer a powerful way to apply selection and transformation rules to large numbers of objects. The singular ``schema-name``, ``table-name`` and ``column-name`` parameters of the native JSON table mapping ``object-locator`` have been replaced by their plurals. These new parameters each accept a list of objects. The rule is then applied to each column listed, for each table listed, for each schema listed.\n\n\nMultiple Source File Compilation\n--------------------------------\n\nMultiple source files can be compiled at once with the following Bash snippet. The snippet recursively finds all YAML files under the directory ``src/``, compiles the source to a DMS mapping file, and saves it to a file with the same name and path under a directory named ``mappings/``, with the extension ``.json``.\n\n.. code-block:: bash\n\n source_files=\"$(find src -type f -name '*.yaml')\"\n for source_file in $source_files; do\n source_file_without_extension=${source_file%.*}\n source_file_with_json_extension=${source_file_without_extension}.json\n destination_file=mappings${source_file_with_json_extension#src}\n mkdir -p \"$(dirname $destination_file)\"\n ptolemy $source_file > $destination_file\n done\n\nRunning the code from the following directory:\n\n.. code-block:: console\n\n .\n \u2514\u2500\u2500 src\n \u251c\u2500\u2500 db-a\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 schema-1.yaml\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 schema-2.yaml\n \u2514\u2500\u2500 db-b\n \u251c\u2500\u2500 schema-1.yaml\n \u2514\u2500\u2500 schema-2.yaml\n\nwould result in:\n\n.. code-block:: console\n\n .\n \u251c\u2500\u2500 mappings\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 db-a\n \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 schema-1.json\n \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 schema-2.json\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 db-b\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 schema-1.json\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 schema-2.json\n \u2514\u2500\u2500 src\n \u251c\u2500\u2500 db-a\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 schema-1.yaml\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 schema-2.yaml\n \u2514\u2500\u2500 db-b\n \u251c\u2500\u2500 schema-1.yaml\n \u2514\u2500\u2500 schema-2.yaml\n\n\n=======\nHistory\n=======\n\n1.0.0 (2016-11-18)\n------------------\n\n* Initial release.",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/cloudreach/ptolemy",
"keywords": "ptolemy",
"license": "Apache Software License 2.0",
"maintainer": null,
"maintainer_email": null,
"name": "ptolemy",
"package_url": "https://pypi.org/project/ptolemy/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/ptolemy/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/cloudreach/ptolemy"
},
"release_url": "https://pypi.org/project/ptolemy/1.0.0/",
"requires_dist": null,
"requires_python": null,
"summary": "Write terse AWS DMS table mappings.",
"version": "1.0.0"
},
"last_serial": 2468805,
"releases": {
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "fa104251520760f86885ad8bc745cef0",
"sha256": "77fe5d2d656bfbcfe74b0c36f7340ac595aeae76e757da31f470522178f78db8"
},
"downloads": -1,
"filename": "ptolemy-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "fa104251520760f86885ad8bc745cef0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14243,
"upload_time": "2016-11-18T15:49:35",
"url": "https://files.pythonhosted.org/packages/54/ba/a821e8cd33bdab1a8a8b0c36899bdc8c7445ce48647e5c47857be9c4e650/ptolemy-1.0.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "fa104251520760f86885ad8bc745cef0",
"sha256": "77fe5d2d656bfbcfe74b0c36f7340ac595aeae76e757da31f470522178f78db8"
},
"downloads": -1,
"filename": "ptolemy-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "fa104251520760f86885ad8bc745cef0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14243,
"upload_time": "2016-11-18T15:49:35",
"url": "https://files.pythonhosted.org/packages/54/ba/a821e8cd33bdab1a8a8b0c36899bdc8c7445ce48647e5c47857be9c4e650/ptolemy-1.0.0.tar.gz"
}
]
}