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.6.0.tar.gz (365.8 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.6.0-cp312-cp312-win_amd64.whl (206.6 kB view details)

Uploaded CPython 3.12Windows x86-64

cloze-0.6.0-cp311-cp311-win_amd64.whl (213.5 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

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

File metadata

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

File hashes

Hashes for cloze-0.6.0.tar.gz
Algorithm Hash digest
SHA256 0b7d3e3602be74f8c54f9e85699390dfc5713797c23197f446f0e6a6e3d72a73
MD5 28b1fcedc750dffc7637b59e145993f1
BLAKE2b-256 374379800c8d6588f5dc3bcb680de8812105768b5f3d38b77d3bd5b9195baed8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloze-0.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 206.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.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1af5a304f8c705048543e64a171e9925822fb868a61b5ace8a61d64d34fe692b
MD5 949f766fd98f88763fb2588c90612c0c
BLAKE2b-256 67748bddee6f9af02028dd501fe1f26c7fd8214f68c2b82d5a2484b3d4b74b86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cloze-0.6.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 213.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.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ee04301e3370644f5f96522f96717d8e2d618b2ae5f06bdaa44117ebd40e9557
MD5 84901336a947ffb95ef2dc13598ab8ec
BLAKE2b-256 16899bf3ee7ec8e465c895b93803faca9225dc7d221a1eccaf46bcce9416e67f

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