Skip to main content

A python package about automatic report, include automatic docx, automatic xlsx, and business rule sql engine.

Project description

from cloze.pandas_query import PandasQuery import pandas

data1=pandas.DataFrame({"列1": range(100),"y": range(100)}) data2=pandas.DataFrame({"x": range(100),"y": range(100)})

sql='select data1.,data2. from data1,data2 where data1.y=data2.y;'

query=PandasQuery() result=query(sql, {'data1':data1,'data2':data2})

#%% from cloze.template_docx import TemplateDocx import pandas import matplotlib.pyplot as plt from io import BytesIO

data1=pandas.Series(range(100),index=['a%i'%i for i in range(100)]) data2=pandas.DataFrame({"x": range(10),"y": range(10)})

plot=BytesIO() plt.plot(data2.y) plt.savefig(plot)

ax = data2.y.plot() fig = ax.get_figure() fig.savefig(plot)

template=TemplateDocx() template('Template.docx','Save.docx',env={'data1':data1,'data2':data2,'plot':plot})

#%% from cloze.template_xlsx import TemplateXlsx import pandas import matplotlib.pyplot as plt from io import BytesIO

data1=pandas.Series(range(100),index=['a%i'%i for i in range(100)]) data2=pandas.DataFrame({"x": range(10),"y": range(10)})

plot=BytesIO()

plt.plot(data2.y) plt.savefig(plot)

data2.y.plot().get_figure().savefig(plot)

template=TemplateXlsx(restore=False) template('Template.xlsx','Save.xlsx',env={'data1':data1,'data2':data2,'plot':plot})

template=TemplateXlsx(restore=True) template('Template.xlsx','Save.xlsx',env={'data1':data1,'data2':data2,'plot':plot}) #%% from cloze.template_text import TemplateText import pandas template=TemplateText() template('这是一个测试{data.a}',{'data':pandas.Series({'a':1})})

Project details


Download files

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

Source Distribution

cloze-0.3.0.tar.gz (381.4 kB view details)

Uploaded Source

Built Distributions

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

cloze-0.3.0-cp312-cp312-win_amd64.whl (277.5 kB view details)

Uploaded CPython 3.12Windows x86-64

cloze-0.3.0-cp311-cp311-win_amd64.whl (198.6 kB view details)

Uploaded CPython 3.11Windows x86-64

cloze-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

File details

Details for the file cloze-0.3.0.tar.gz.

File metadata

  • Download URL: cloze-0.3.0.tar.gz
  • Upload date:
  • Size: 381.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for cloze-0.3.0.tar.gz
Algorithm Hash digest
SHA256 dd6ace165c58da4c66680fc9f084ade5ae6fe69dda717d6d91128d5c03987811
MD5 a51305963eaf5ecb2a61daecc1d8eb76
BLAKE2b-256 213fc4b4e524bc663936996ff4fb6577839a10b96a7eb0e260cb9b746840808f

See more details on using hashes here.

File details

Details for the file cloze-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cloze-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 277.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for cloze-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bc7e2ff1eb88a14491e40a9109709a2046065cf02e118b2ced44f9c2dcc11379
MD5 a35fc6e97dc186bfc4580f2330cfe98d
BLAKE2b-256 014ee241e85a9f2e24d15e866e570613027cae8525634bd08a9b6b5d2a4fe596

See more details on using hashes here.

File details

Details for the file cloze-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cloze-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 198.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for cloze-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c2298cd850f573cc04fdbdcca13d0e6997b6d3282e556280540d63c129aa4a83
MD5 61a2d35ceeaf369af0f159c0214118b6
BLAKE2b-256 cacd3ddc9cbe6eefd7ab9cd2cc926ec18d6d2ddb5a31f0bb636636d453682aa7

See more details on using hashes here.

File details

Details for the file cloze-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for cloze-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e92fee1bde378d1845703ad13ba43af6dd3cc5dda17bce35b01069b165bc2bfa
MD5 257119ab23697c8d2708b4dc518d7b39
BLAKE2b-256 58eb62cdd3307cba0ac88f42ecc7b2780d8bf6b52c25f27d23c74456cc002562

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