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.5.0.tar.gz (381.2 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.5.0-cp312-cp312-win_amd64.whl (219.3 kB view details)

Uploaded CPython 3.12Windows x86-64

cloze-0.5.0-cp311-cp311-win_amd64.whl (225.5 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

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

File metadata

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

File hashes

Hashes for cloze-0.5.0.tar.gz
Algorithm Hash digest
SHA256 5ae49aa13665e20c68f6bf60c493da714f0b602bbecfa9d468e93b03e64727f7
MD5 d8b2554170b1ce53e781b23918fdc3d2
BLAKE2b-256 a9a46f850bdd0381f6a1d46b2cd59c2b16da8c3bffb2a4ca6c4abfec7f71c65e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloze-0.5.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 219.3 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.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1ef8eeaafc5a9c98e646cf9119b372ffca3c4c03a284d1aab84a8e70a7f37043
MD5 53478177f44fd46b914d245f1a1135b8
BLAKE2b-256 961e2f91817c7df9ef366f2ac4ec008fab695ad10e90965340886ece5ae49da2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloze-0.5.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 225.5 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.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 268c53b14bcf659fa4eea32ea40acbf11988284f6d839d1f916e60b96097a5e7
MD5 76a0fec5e349b9d5ffada0529b3420e3
BLAKE2b-256 647b3eb296471dd7af3114e7c8f31c2b2ce75238e72d5c0f016c9e933ae99ca4

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