cci-sql-xlsx-converter


Namecci-sql-xlsx-converter JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryConverts SQL databases generated by Cumulus CI into Excel, for manual editing, and converts them back to SQL files
upload_time2024-08-14 17:16:13
maintainerNone
docs_urlNone
authorNone
requires_python>=3.0
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CCI SQL XLSX Importer/Exporter
 Converts SQL databases generated by Cumulus CI into Excel, for manual editing, and converts them back to SQL files.

# Installation
First make sure you have Python 3 and pip. You can install Python [here](https://www.python.org/downloads/), but it may be pre-installed on your machine. You may also need to install pip. Instructions can be found [here](https://pip.pypa.io/en/stable/installation/). TL;DR: run `python -m ensurepip --upgrade` on Linux/MacOS, or `py -m ensurepip --upgrade` on Windows. (If you get an error that the `python` or `pip` commands aren't found, try running `python3` or `pip3` instead.)

Then run `pip install cci_sql_xlsx_converter` to install the tool. All done!

# Usage
Importing into Excel: run either the `dataset_to_excel` or `ds2xl` command from the command line

Exporting Excel file to SQL: use either `excel_to_dataset` or `xl2ds`

## Arguments
### Common
`-i, --input`: path to input file. By default, this is `./datasets/sample.sql` or `./generated.xlsx` for the SQL-to-XLSX or XLSX-to-SQL scripts respectively. (The assumption is that the script is run from the project folder.)
`-o, --output`: path to save the generated file as. The default values are the same as `-i` but swapped: `./generated.xlsx` and `./datasets/sample.sql` respectively.

Open output file:
`-of, --open-file`: Open the generated file once it's complete.
`-nof, --no-open-file`: Do not open the file.
Default behavior is to open the generated XLSX file, but not to open the generated SQL/YML files.

Logging arguments (all default to off):
`-ltn, --log-table-names`: Display a log message for each table that is loaded/detected.
`-lr, --log-records`: Display a log message for each record.
`-lf, --log-fields`: Display a log message for each field in a table.
`-sw, --suppress-warnings`: Prevent warning messages from appearing.

### XLSX-to-SQL Specific
Delete input file:
`-d, --delete-xlsx`: Delete the XLSX file after the new SQL file is generated.
`-p, --preserve-xlsx`: Do not delete the file.
Default behavior is to DELETE the XLSX file! This is done so that there aren't 2 competing versions of the data floating around.

# Important Info/Warnings
## Don't Rename Sheets or Fields
The names of the worksheets in the Excel spreadsheet are linked to the names of the tables, and the headers of each column are linked to the field names. If you want to change the name of a table or field, do it in SalesForce, not Excel. However, you can safely re-order columns or sheets.

## Don't Start an XLSX File from Scratch
This tool is for editing the SQL files in Excel, not a general-purpose tool for converting XLSX data to SQL scripts. If you try to run it on an arbitrary XLSX file, it will probably fail, since the proper data won't be encoded in the comments (see Comments below).

## End Detection
Do not leave any blank columns in the XLSX file, except at the rightward edge. The tool will stop looking for fields once it sees a blank column, and any further data will be ignored. Blank rows are allowed, though discouraged.

## Comments
SQL databases contain information that doesn't have a direct analogue in Excel, like the PRIMARY KEY/NOT NULL constraints. This information needs to be kept along with each field, so this tool stores the info in comments attached to the field headers. Please don't edit or delete those comments!

If you modify a field header, make sure the comment goes with it! For example, to add a new field, insert a new column rather than manually copying the values rightwards. And to delete a field, delete the itself, rather than just deleting the values (see End Detection above).

Comments on the cells of records are not checked. You can feel free to leave comments there; the tool will ignore them.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cci-sql-xlsx-converter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.0",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Arden Kolodner <akolodner25@amherst.edu>",
    "download_url": "https://files.pythonhosted.org/packages/fa/e3/e0eabc4462b4a30ba463772c463c4ecb22d752222713e8ddde1f26f21a74/cci_sql_xlsx_converter-0.2.1.tar.gz",
    "platform": null,
    "description": "# CCI SQL XLSX Importer/Exporter\n Converts SQL databases generated by Cumulus CI into Excel, for manual editing, and converts them back to SQL files.\n\n# Installation\nFirst make sure you have Python 3 and pip. You can install Python [here](https://www.python.org/downloads/), but it may be pre-installed on your machine. You may also need to install pip. Instructions can be found [here](https://pip.pypa.io/en/stable/installation/). TL;DR: run `python -m ensurepip --upgrade` on Linux/MacOS, or `py -m ensurepip --upgrade` on Windows. (If you get an error that the `python` or `pip` commands aren't found, try running `python3` or `pip3` instead.)\n\nThen run `pip install cci_sql_xlsx_converter` to install the tool. All done!\n\n# Usage\nImporting into Excel: run either the `dataset_to_excel` or `ds2xl` command from the command line\n\nExporting Excel file to SQL: use either `excel_to_dataset` or `xl2ds`\n\n## Arguments\n### Common\n`-i, --input`: path to input file. By default, this is `./datasets/sample.sql` or `./generated.xlsx` for the SQL-to-XLSX or XLSX-to-SQL scripts respectively. (The assumption is that the script is run from the project folder.)\n`-o, --output`: path to save the generated file as. The default values are the same as `-i` but swapped: `./generated.xlsx` and `./datasets/sample.sql` respectively.\n\nOpen output file:\n`-of, --open-file`: Open the generated file once it's complete.\n`-nof, --no-open-file`: Do not open the file.\nDefault behavior is to open the generated XLSX file, but not to open the generated SQL/YML files.\n\nLogging arguments (all default to off):\n`-ltn, --log-table-names`: Display a log message for each table that is loaded/detected.\n`-lr, --log-records`: Display a log message for each record.\n`-lf, --log-fields`: Display a log message for each field in a table.\n`-sw, --suppress-warnings`: Prevent warning messages from appearing.\n\n### XLSX-to-SQL Specific\nDelete input file:\n`-d, --delete-xlsx`: Delete the XLSX file after the new SQL file is generated.\n`-p, --preserve-xlsx`: Do not delete the file.\nDefault behavior is to DELETE the XLSX file! This is done so that there aren't 2 competing versions of the data floating around.\n\n# Important Info/Warnings\n## Don't Rename Sheets or Fields\nThe names of the worksheets in the Excel spreadsheet are linked to the names of the tables, and the headers of each column are linked to the field names. If you want to change the name of a table or field, do it in SalesForce, not Excel. However, you can safely re-order columns or sheets.\n\n## Don't Start an XLSX File from Scratch\nThis tool is for editing the SQL files in Excel, not a general-purpose tool for converting XLSX data to SQL scripts. If you try to run it on an arbitrary XLSX file, it will probably fail, since the proper data won't be encoded in the comments (see Comments below).\n\n## End Detection\nDo not leave any blank columns in the XLSX file, except at the rightward edge. The tool will stop looking for fields once it sees a blank column, and any further data will be ignored. Blank rows are allowed, though discouraged.\n\n## Comments\nSQL databases contain information that doesn't have a direct analogue in Excel, like the PRIMARY KEY/NOT NULL constraints. This information needs to be kept along with each field, so this tool stores the info in comments attached to the field headers. Please don't edit or delete those comments!\n\nIf you modify a field header, make sure the comment goes with it! For example, to add a new field, insert a new column rather than manually copying the values rightwards. And to delete a field, delete the itself, rather than just deleting the values (see End Detection above).\n\nComments on the cells of records are not checked. You can feel free to leave comments there; the tool will ignore them.",
    "bugtrack_url": null,
    "license": null,
    "summary": "Converts SQL databases generated by Cumulus CI into Excel, for manual editing, and converts them back to SQL files",
    "version": "0.2.1",
    "project_urls": {
        "Repo": "https://github.com/ArdenKolodner/CCI-SQL-XLSX-Importer-Exporter"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "92af253dd60a369cc394dc8a6a7deed04bc3b73d6533da742fd135c0e9c715ec",
                "md5": "49b1bdfa1dda7a7ad1ae62b8351f2fe8",
                "sha256": "ba71ddf2f41c7ec437f3259c4e25c6d20769b64502330a69194f777345f20303"
            },
            "downloads": -1,
            "filename": "cci_sql_xlsx_converter-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "49b1bdfa1dda7a7ad1ae62b8351f2fe8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.0",
            "size": 8717,
            "upload_time": "2024-08-14T17:16:12",
            "upload_time_iso_8601": "2024-08-14T17:16:12.752587Z",
            "url": "https://files.pythonhosted.org/packages/92/af/253dd60a369cc394dc8a6a7deed04bc3b73d6533da742fd135c0e9c715ec/cci_sql_xlsx_converter-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fae3e0eabc4462b4a30ba463772c463c4ecb22d752222713e8ddde1f26f21a74",
                "md5": "dc39189049f134f3c06529d80748b95c",
                "sha256": "faf9bbb3ac0f22cc4aef5a5f18b26b02b3e40f762d2e7baebf280f52e38ea67d"
            },
            "downloads": -1,
            "filename": "cci_sql_xlsx_converter-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "dc39189049f134f3c06529d80748b95c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.0",
            "size": 8457,
            "upload_time": "2024-08-14T17:16:13",
            "upload_time_iso_8601": "2024-08-14T17:16:13.998480Z",
            "url": "https://files.pythonhosted.org/packages/fa/e3/e0eabc4462b4a30ba463772c463c4ecb22d752222713e8ddde1f26f21a74/cci_sql_xlsx_converter-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-14 17:16:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ArdenKolodner",
    "github_project": "CCI-SQL-XLSX-Importer-Exporter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cci-sql-xlsx-converter"
}
        
Elapsed time: 0.55976s