Convert a spreadsheet into a sqlite3 database.
Project description
Introduction
xlsql is a simple command-line tool that converts an Excel .xlsx spreadsheet into a sqlite3 database.
Installation
To install this utility using pip you can simply pip install xlsql
Usage
To view command help, you can always run xlsql --help.
Usage: xlsql [OPTIONS] SPREADSHEET
Convert an Excel spreadsheet into a SQLite database.
Args:
spreadsheet (str): The path to the Excel spreadsheet.
Options:
--column, -c: A column (or columns) to extract. Can be specified multiple times.
--database: The name of the database to create. (default: database.db)
--force: Overwrite an existing database.
--sheet, -s: A sheet (or sheets) to extract. Can be specified multiple times.
--verbose, -v: Show verbose output.
--version, -V: Show the xlsql version number.
Examples:
xlsql ~/Documents/Example.xlsx
# Creates: ~/Documents/example.db with all data included in the database.
xlsql ~/Documents/Example.xlsx --verbose
# Creates: ~/Documents/example.db, displaying verbose output while running.
xlsql ~/Documents/Example.xlsx --database /tmp/example.db
# Creates /tmp/example.db with all data included from the Excel sheet.
xlsql ~/Documents/Example.xlsx --database /tmp/example.db --force
# Overwrites the existing db with fresh content from the sheet!
xlsql example.xlsx -c name -c id -c address -s people
# Only select the name, id, and address columns from the people sheet.
Contributing
To contribute to this project, please fork the repo and make your changes there. Submit a PR back to this repo for review.
Be sure to install the dev dependencies, such as pre-commit and black.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xlsql-0.2.6.tar.gz.
File metadata
- Download URL: xlsql-0.2.6.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.11.7 Darwin/23.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b03f205c505dc4c5a60292ad4021488d6fbb6470badb85a536ffb27a5045bf03
|
|
| MD5 |
f0f4fcd0143f283bdd208f17ebdd5624
|
|
| BLAKE2b-256 |
5f6f3a878c62a3657254248bd73d5a4202e48e8fe725d3e705d9150dd4c399dd
|
File details
Details for the file xlsql-0.2.6-py3-none-any.whl.
File metadata
- Download URL: xlsql-0.2.6-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.11.7 Darwin/23.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b600f3e6b3ebb6f77576954a029296ebd46cc907cc0d3cd2c1754a6f1c935a1
|
|
| MD5 |
c54be2dbb1e833ac85c882c7b7ec8bec
|
|
| BLAKE2b-256 |
87ab7500faaad3053a01651d3b8689ea561bb27c5c3f7a806a9866f154a050f2
|