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.4.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.4.0-cp312-cp312-win_amd64.whl (277.6 kB view details)

Uploaded CPython 3.12Windows x86-64

cloze-0.4.0-cp311-cp311-win_amd64.whl (198.7 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

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

File metadata

  • Download URL: cloze-0.4.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.4.0.tar.gz
Algorithm Hash digest
SHA256 b8779ca0f7bb9242c1603b188eb3cd31176d99fa52b6b93378c8d724a6c9936e
MD5 e274dcc41c8cf7f86d76a580a5bf3ae6
BLAKE2b-256 f627f611a9f3768ca7574c7b9df46ec35cbc368eaea7ada05daa725bd48c2846

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloze-0.4.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 277.6 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.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d8bdd877a45bfad985071157558ce64d1f177dd2f8eca8510fa57e67d7272f61
MD5 26e2a70dd0ac25bb6b6102e8d79e4235
BLAKE2b-256 9965d20f4b8ee63ebfd07b5c3e4c800a781ea876e30b4c8d400b4dbdcb9b2f03

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloze-0.4.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 198.7 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.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5bf31a7d194ebd8f983139baff61f96b3ac166ea3d14172dc5a13135a9caf028
MD5 93574fa4244191bc9e4c22643ed4c604
BLAKE2b-256 4ea0874be360a2ed8e02025710cf40f0a71d41be1bfb9cbe61fd25d258d802ff

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