Excel 파일을 시트별 BSON 파일로 변환하는 CLI 도구
Project description
PyExcelToBSON
🇰🇷 한국어 문서
A CLI tool that converts each sheet of an Excel (.xlsx) file into a BSON (Binary JSON) file.
Requirements
- Python
>= 3.10 openpyxl: For reading Excel filespymongo: For BSON serialization (includesbsonmodule)
Installation
pip install pyexcel2bson
Usage
pyexcel2bson -i sample.xlsx -o ./output
Arguments
| Argument | Description | Required |
|---|---|---|
-i, --input |
Path to the Excel (.xlsx) file |
✅ |
-o, --output |
Path to the output directory | ✅ |
-s, --suffix |
Suffix appended to output filenames | ❌ |
-d, --debug |
Also export as JSON for debugging | ❌ |
-c, --clean |
Clean up the output directory before converting | ❌ |
Excel Sheet Rules
-
Sheets whose name starts with
_are skipped.- e.g.
_info
- e.g.
-
Rows 1–5 must follow this structure:
| Row | Description |
|---|---|
| 1 | Column description |
| 2 | Column usage (reserved) |
| 3 | Column attribute |
| 4 | Column data type |
| 5 | Column name (variable name) |
- Data cells must not be empty.
Output Format
Each sheet is exported as a .bson file with the following structure:
{
"data": [
{ "column_name": value, ... },
...
]
}
Development
git clone https://github.com/onsemy/PyExcelToBSON.git
cd PyExcelToBSON
pip install -e ".[dev]"
Project Structure
PyExcelToBSON/
├── main.py
├── output_manager.py
├── readers/
│ ├── input_reader.py # Abstract base class
│ └── excel_reader.py
├── writers/
│ ├── output_writer.py # Abstract base class
│ ├── bson_writer.py
│ └── json_writer.py
└── factories/
├── reader_factory.py
└── writer_factory.py
Contributing
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
pyexcel2bson-0.1.2.tar.gz
(16.3 kB
view details)
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 pyexcel2bson-0.1.2.tar.gz.
File metadata
- Download URL: pyexcel2bson-0.1.2.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fa179ced4ded368dbcecadec8581bce731a3274873fb8fb075a392d99aa7d84
|
|
| MD5 |
0bae7f854242e48f81aedcd6f37409c0
|
|
| BLAKE2b-256 |
dd68a9272007a0010b575b68817ba9814662d03cf210c3dd7bd8a95ba7fbbb0d
|
File details
Details for the file pyexcel2bson-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pyexcel2bson-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23b141d4a8d2e3bd23782decf75898238fc6f5ea6fa891867c016894697a0d9f
|
|
| MD5 |
d61c2ddb28cd675de04dffb3e9d8839a
|
|
| BLAKE2b-256 |
0585c2d8396b9160ebf37b21229744bca4c38c660e8bbb6069c091b233d0ce5c
|