cloze 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ include cloze/Template.docx
2
+ include cloze/Template.xlsx
cloze-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,79 @@
1
+ Metadata-Version: 2.1
2
+ Name: cloze
3
+ Version: 0.2.0
4
+ Summary: A python package about automatic report, include automatic docx, automatic xlsx, and business rule sql engine.
5
+ Author: cloze
6
+ Author-email: yaomsn@live.cn
7
+ Keywords: automatic report,automatic form,automatic xlsx,business rule engine,RPA
8
+ Platform: any
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: pandas
12
+ Requires-Dist: sqlalchemy
13
+ Requires-Dist: python-docx
14
+ Requires-Dist: openpyxl
15
+
16
+
17
+ from auto_rpt.pandas_query import PandasQuery
18
+ import pandas
19
+
20
+ data1=pandas.DataFrame({"列1": range(100),"y": range(100)})
21
+ data2=pandas.DataFrame({"x": range(100),"y": range(100)})
22
+
23
+ sql='select data1.*,data2.* from data1,data2 where data1.y=data2.y;'
24
+
25
+ query=PandasQuery()
26
+ result=query(sql, {'data1':data1,'data2':data2})
27
+
28
+
29
+ #%%
30
+ from auto_rpt.template_docx import TemplateDocx
31
+ import pandas
32
+ import matplotlib.pyplot as plt
33
+ from io import BytesIO
34
+
35
+ data1=pandas.Series(range(100),index=['a%i'%i for i in range(100)])
36
+ data2=pandas.DataFrame({"x": range(10),"y": range(10)})
37
+
38
+
39
+
40
+ plot=BytesIO()
41
+ plt.plot(data2.y)
42
+ plt.savefig(plot)
43
+
44
+ ax = data2.y.plot()
45
+ fig = ax.get_figure()
46
+ fig.savefig(plot)
47
+
48
+ template=TemplateDocx()
49
+ template('Template.docx','Save.docx',env={'data1':data1,'data2':data2,'plot':plot})
50
+
51
+ #%%
52
+ from auto_rpt.template_xlsx import TemplateXlsx
53
+ import pandas
54
+ import matplotlib.pyplot as plt
55
+ from io import BytesIO
56
+
57
+ data1=pandas.Series(range(100),index=['a%i'%i for i in range(100)])
58
+ data2=pandas.DataFrame({"x": range(10),"y": range(10)})
59
+
60
+
61
+
62
+ plot=BytesIO()
63
+
64
+ # plt.plot(data2.y)
65
+ # plt.savefig(plot)
66
+
67
+ data2.y.plot().get_figure().savefig(plot)
68
+
69
+ template=TemplateXlsx(restore=False)
70
+ template('Template.xlsx','Save.xlsx',env={'data1':data1,'data2':data2,'plot':plot})
71
+
72
+ template=TemplateXlsx(restore=True)
73
+ template('Template.xlsx','Save.xlsx',env={'data1':data1,'data2':data2,'plot':plot})
74
+ #%%
75
+ from auto_rpt.template_text import TemplateText
76
+ import pandas
77
+ template=TemplateText()
78
+ template('这是一个测试{data.a}',{'data':pandas.Series({'a':1})})
79
+
cloze-0.2.0/README.md ADDED
@@ -0,0 +1,64 @@
1
+
2
+ from auto_rpt.pandas_query import PandasQuery
3
+ import pandas
4
+
5
+ data1=pandas.DataFrame({"列1": range(100),"y": range(100)})
6
+ data2=pandas.DataFrame({"x": range(100),"y": range(100)})
7
+
8
+ sql='select data1.*,data2.* from data1,data2 where data1.y=data2.y;'
9
+
10
+ query=PandasQuery()
11
+ result=query(sql, {'data1':data1,'data2':data2})
12
+
13
+
14
+ #%%
15
+ from auto_rpt.template_docx import TemplateDocx
16
+ import pandas
17
+ import matplotlib.pyplot as plt
18
+ from io import BytesIO
19
+
20
+ data1=pandas.Series(range(100),index=['a%i'%i for i in range(100)])
21
+ data2=pandas.DataFrame({"x": range(10),"y": range(10)})
22
+
23
+
24
+
25
+ plot=BytesIO()
26
+ plt.plot(data2.y)
27
+ plt.savefig(plot)
28
+
29
+ ax = data2.y.plot()
30
+ fig = ax.get_figure()
31
+ fig.savefig(plot)
32
+
33
+ template=TemplateDocx()
34
+ template('Template.docx','Save.docx',env={'data1':data1,'data2':data2,'plot':plot})
35
+
36
+ #%%
37
+ from auto_rpt.template_xlsx import TemplateXlsx
38
+ import pandas
39
+ import matplotlib.pyplot as plt
40
+ from io import BytesIO
41
+
42
+ data1=pandas.Series(range(100),index=['a%i'%i for i in range(100)])
43
+ data2=pandas.DataFrame({"x": range(10),"y": range(10)})
44
+
45
+
46
+
47
+ plot=BytesIO()
48
+
49
+ # plt.plot(data2.y)
50
+ # plt.savefig(plot)
51
+
52
+ data2.y.plot().get_figure().savefig(plot)
53
+
54
+ template=TemplateXlsx(restore=False)
55
+ template('Template.xlsx','Save.xlsx',env={'data1':data1,'data2':data2,'plot':plot})
56
+
57
+ template=TemplateXlsx(restore=True)
58
+ template('Template.xlsx','Save.xlsx',env={'data1':data1,'data2':data2,'plot':plot})
59
+ #%%
60
+ from auto_rpt.template_text import TemplateText
61
+ import pandas
62
+ template=TemplateText()
63
+ template('这是一个测试{data.a}',{'data':pandas.Series({'a':1})})
64
+
Binary file
Binary file
File without changes
@@ -0,0 +1,70 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Created on Thu Mar 5 09:24:16 2026
4
+
5
+ @author: ThinkPad
6
+ """
7
+
8
+ from auto_rpt.pandas_query import PandasQuery
9
+ import pandas
10
+
11
+ data1=pandas.DataFrame({"列1": range(100),"y": range(100)})
12
+ data2=pandas.DataFrame({"x": range(100),"y": range(100)})
13
+
14
+ sql='select data1.*,data2.* from data1,data2 where data1.y=data2.y;'
15
+
16
+ query=PandasQuery()
17
+ result=query(sql, {'data1':data1,'data2':data2})
18
+
19
+
20
+ #%%
21
+ from auto_rpt.template_docx import TemplateDocx
22
+ import pandas
23
+ import matplotlib.pyplot as plt
24
+ from io import BytesIO
25
+
26
+ data1=pandas.Series(range(100),index=['a%i'%i for i in range(100)])
27
+ data2=pandas.DataFrame({"x": range(10),"y": range(10)})
28
+
29
+
30
+
31
+ plot=BytesIO()
32
+ plt.plot(data2.y)
33
+ plt.savefig(plot)
34
+
35
+ ax = data2.y.plot()
36
+ fig = ax.get_figure()
37
+ fig.savefig(plot)
38
+
39
+ template=TemplateDocx()
40
+ template('Template.docx','Save.docx',env={'data1':data1,'data2':data2,'plot':plot})
41
+
42
+ #%%
43
+ from auto_rpt.template_xlsx import TemplateXlsx
44
+ import pandas
45
+ import matplotlib.pyplot as plt
46
+ from io import BytesIO
47
+
48
+ data1=pandas.Series(range(100),index=['a%i'%i for i in range(100)])
49
+ data2=pandas.DataFrame({"x": range(10),"y": range(10)})
50
+
51
+
52
+
53
+ plot=BytesIO()
54
+
55
+ # plt.plot(data2.y)
56
+ # plt.savefig(plot)
57
+
58
+ data2.y.plot().get_figure().savefig(plot)
59
+
60
+ template=TemplateXlsx(restore=False)
61
+ template('Template.xlsx','Save.xlsx',env={'data1':data1,'data2':data2,'plot':plot})
62
+
63
+ template=TemplateXlsx(restore=True)
64
+ template('Template.xlsx','Save.xlsx',env={'data1':data1,'data2':data2,'plot':plot})
65
+ #%%
66
+ from auto_rpt.template_text import TemplateText
67
+ import pandas
68
+ template=TemplateText()
69
+ template('这是一个测试{data.a}',{'data':pandas.Series({'a':1})})
70
+