Skip to main content

No project description provided

Project description

xlsxgen

使い方

import pandas as pd
import zipfile
import xlsxgen
import resource
import time
import io

# 開始
start_time = time.perf_counter()
file_name = 'tenpo_shohin_pattern3.xlsx'
excel_sheet = 'sheet1'

with open(file_name, 'rb') as file_obj:
    with zipfile.ZipFile(file_obj, 'r') as zip_ref:
        # エクセルファイルを展開してオブジェクトを取得
        s_list = [f'xl/worksheets/{excel_sheet}.xml']
        sheet_list = [i for i in zip_ref.namelist() if i in s_list]
        solve_bytes = 'xl/sharedStrings.xml'
        bytes_obj = zip_ref.read([i for i in zip_ref.namelist() if i in sheet_list][0])
        bytes_solve_obj = zip_ref.read(solve_bytes)

        generator = xlsxgen.DataGenerator()
        generator.process_bytes(10000, bytes_obj, bytes_solve_obj)
        while True:
            csv_data = generator.generate_data_chunk()
            if csv_data == "finish":
                print(csv_data)
                break
            if csv_data:
                print(csv_data)
                #df = pd.read_csv(io.StringIO(csv_data), header=None)
                #print(df)

memory_info = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
print(f"Max RSS: {memory_info / 1024 / 1024} MB")

end_time = time.perf_counter()
# 経過時間を出力(秒)
elapsed_time = end_time - start_time
print(elapsed_time)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

xlsxgen-0.1.1-cp39-cp39-macosx_10_7_x86_64.whl (349.8 kB view details)

Uploaded CPython 3.9macOS 10.7+ x86-64

xlsxgen-0.1.1-cp38-none-win_amd64.whl (211.1 kB view details)

Uploaded CPython 3.8Windows x86-64

File details

Details for the file xlsxgen-0.1.1-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for xlsxgen-0.1.1-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 d034d39bc777ff4e55419a865922f2ad64b6eea6d8dd438a01bbf99040a38da1
MD5 80f26c69f4eab1ccdce96fbedc76ef7c
BLAKE2b-256 af8a6dec610e3a0bcd633acd14ad40ab8a7835a7c85b5296e99527baa7ddf0fb

See more details on using hashes here.

File details

Details for the file xlsxgen-0.1.1-cp38-none-win_amd64.whl.

File metadata

  • Download URL: xlsxgen-0.1.1-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 211.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.10

File hashes

Hashes for xlsxgen-0.1.1-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 18d0a7f72ff9d1064413e92c125ab256c3532839dff3cb57fd823dcb2ee2963f
MD5 14f834c9dc159e3b0e43857b43a3bc6f
BLAKE2b-256 2eedfec58c0d66d2e8336b6aff9921ebd38903d9092e6c0a9123de6aec8922e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page