summaryrefslogtreecommitdiff
path: root/python-pycof.spec
blob: db99fb6706fd81f4668525b171cc28e69e8179a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
%global _empty_manifest_terminate_build 0
Name:		python-pycof
Version:	1.5.4
Release:	1
Summary:	A package for commonly used functions
License:	MIT License
URL:		https://www.florianfelice.com/pycof
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/89/cd/0f4b1c8373288b4c9f88596c785dac1b8ae7d584cadfcd0d7c26dc9008c4/pycof-1.5.4.tar.gz
BuildArch:	noarch

Requires:	python3-boto3
Requires:	python3-bs4
Requires:	python3-dateparser
Requires:	python3-google-api-python-client
Requires:	python3-google-auth-httplib2
Requires:	python3-google-auth-oauthlib
Requires:	python3-google-auth
Requires:	python3-httplib2
Requires:	python3-matplotlib
Requires:	python3-numpy
Requires:	python3-pandas
Requires:	python3-psycopg2-binary
Requires:	python3-pyarrow
Requires:	python3-pymysql
Requires:	python3-sshtunnel
Requires:	python3-tqdm
Requires:	python3-xlrd

%description
# PYCOF (PYthon COmmon Functions)

## 1. Installation
[![Downloads](https://pepy.tech/badge/pycof)](https://pepy.tech/project/pycof)
[![PyPI version](https://badge.fury.io/py/pycof.svg)](https://pypi.org/project/pycof/)

You can get pycof from [PyPI](https://pypi.org/project/pycof/) with:

```bash
pip install pycof
```

The library is supported on Windows, Linux and MacOs.

## 2. Usage

### 2.1. Documentation

You can find the full documentation at [https://www.florianfelice.com/pycof](https://www.florianfelice.com/pycof?orgn=github) or by clicking on the name of each function in the next section.
It will redirect you the the function's specific documentation.

### 2.1. Available functions

The current version of the library provides:

* [**`remote_execute_sql`**](https://www.florianfelice.com/pycof/sql/sql.html#pycof.sql.remote_execute_sql): aggragated function for SQL queries to `SELECT`, `INSERT`, `DELETE` or `COPY`.
* [**`read`**](https://www.florianfelice.com/pycof/datamngt/datamngt.html#pycof.data.read): Load any data file, regarless of the format.
* [**`send_email`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.send_email): simple function to send email to contacts in a concise way.
* [**`verbose_display`**](https://www.florianfelice.com/pycof/format/format.html#pycof.misc.verbose_display): extended function to [print](https://docs.python.org/3/library/functions.html#print) strings, lists, data frames and progression bar if used as a wrapper in `for` loops.
* [**`add_zero`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.add_zero): simple function to convert `int` to `str` by adding a 0 is less than 10.
* [**`group`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.group): will convert an `int` to a `str` with thousand seperator.
* [**`replace_zero`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.replace_zero): will transform 0 values to `-` for display purposes.
* [**`week_sunday`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.week_sunday): will return week number of last sunday date of a given date.
* [**`display_name`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.display_name): displays the current user name. Will display either `first`, `last` or `full` name.
* [**`write`**](https://www.florianfelice.com/pycof/format/format.html#pycof.misc.write): writes a `str` to a specific file (usually .txt) in one line of code.
* [**`file_age`**](https://www.florianfelice.com/pycof/format/format.html#pycof.misc.file_age): computes the age (in days, hours, ...) of a given local file.
* [**`str2bool`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.str2bool): converts string to boolean.
* And [**`many others`**](https://www.florianfelice.com/pycof)!



### 2.2. Config file for credentials

The function [`remote_execute_sql`](https://www.florianfelice.com/pycof/sql/sql.html#pycof.sql.remote_execute_sql) and [`send_email`](https://www.florianfelice.com/pycof/format/format.html#pycof.format.send_email) will by default look for the credentials located at `/etc/.pycof/config.json`.
On Windows, save the config file as `C:/Windows/.pycof/config.json`.

The file follows the below structure:

```bash
{
	"DB_USER": "",
	"DB_PASSWORD": "",
	"DB_HOST": "",
	"DB_PORT": "3306",
	"DB_DATABASE": "",
	"__COMMENT_1__": "Email specific, send_email"
	"EMAIL_USER": "",
	"EMAIL_PASSWORD": "",
	"EMAIL_SMTP": "smtp.gmail.com",
	"EMAIL_PORT": "587"
	"__COMMENT_2__": "IAM specific, if useIAM=True in remote_execute_sql",
	"CLUSTER_NAME": "",
	"AWS_ACCESS_KEY_ID": "",
	"AWS_SECRET_ACCESS_KEY": "",
	"REGION": "eu-west-1"
}
```

On Unix based system, run:
```bash
sudo nano /etc/.pycof/config.json
```

and paste the above json after filling the empty strings (pre-filled values are standard default values).

*__Reminder:__* To save the file, with nano press `CTRL + O`, confirm with `y` then `CTRL + X` to exit.

On Windows, use the path `C:/Windows/.pycof/config.json`.




%package -n python3-pycof
Summary:	A package for commonly used functions
Provides:	python-pycof
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-pycof
# PYCOF (PYthon COmmon Functions)

## 1. Installation
[![Downloads](https://pepy.tech/badge/pycof)](https://pepy.tech/project/pycof)
[![PyPI version](https://badge.fury.io/py/pycof.svg)](https://pypi.org/project/pycof/)

You can get pycof from [PyPI](https://pypi.org/project/pycof/) with:

```bash
pip install pycof
```

The library is supported on Windows, Linux and MacOs.

## 2. Usage

### 2.1. Documentation

You can find the full documentation at [https://www.florianfelice.com/pycof](https://www.florianfelice.com/pycof?orgn=github) or by clicking on the name of each function in the next section.
It will redirect you the the function's specific documentation.

### 2.1. Available functions

The current version of the library provides:

* [**`remote_execute_sql`**](https://www.florianfelice.com/pycof/sql/sql.html#pycof.sql.remote_execute_sql): aggragated function for SQL queries to `SELECT`, `INSERT`, `DELETE` or `COPY`.
* [**`read`**](https://www.florianfelice.com/pycof/datamngt/datamngt.html#pycof.data.read): Load any data file, regarless of the format.
* [**`send_email`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.send_email): simple function to send email to contacts in a concise way.
* [**`verbose_display`**](https://www.florianfelice.com/pycof/format/format.html#pycof.misc.verbose_display): extended function to [print](https://docs.python.org/3/library/functions.html#print) strings, lists, data frames and progression bar if used as a wrapper in `for` loops.
* [**`add_zero`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.add_zero): simple function to convert `int` to `str` by adding a 0 is less than 10.
* [**`group`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.group): will convert an `int` to a `str` with thousand seperator.
* [**`replace_zero`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.replace_zero): will transform 0 values to `-` for display purposes.
* [**`week_sunday`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.week_sunday): will return week number of last sunday date of a given date.
* [**`display_name`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.display_name): displays the current user name. Will display either `first`, `last` or `full` name.
* [**`write`**](https://www.florianfelice.com/pycof/format/format.html#pycof.misc.write): writes a `str` to a specific file (usually .txt) in one line of code.
* [**`file_age`**](https://www.florianfelice.com/pycof/format/format.html#pycof.misc.file_age): computes the age (in days, hours, ...) of a given local file.
* [**`str2bool`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.str2bool): converts string to boolean.
* And [**`many others`**](https://www.florianfelice.com/pycof)!



### 2.2. Config file for credentials

The function [`remote_execute_sql`](https://www.florianfelice.com/pycof/sql/sql.html#pycof.sql.remote_execute_sql) and [`send_email`](https://www.florianfelice.com/pycof/format/format.html#pycof.format.send_email) will by default look for the credentials located at `/etc/.pycof/config.json`.
On Windows, save the config file as `C:/Windows/.pycof/config.json`.

The file follows the below structure:

```bash
{
	"DB_USER": "",
	"DB_PASSWORD": "",
	"DB_HOST": "",
	"DB_PORT": "3306",
	"DB_DATABASE": "",
	"__COMMENT_1__": "Email specific, send_email"
	"EMAIL_USER": "",
	"EMAIL_PASSWORD": "",
	"EMAIL_SMTP": "smtp.gmail.com",
	"EMAIL_PORT": "587"
	"__COMMENT_2__": "IAM specific, if useIAM=True in remote_execute_sql",
	"CLUSTER_NAME": "",
	"AWS_ACCESS_KEY_ID": "",
	"AWS_SECRET_ACCESS_KEY": "",
	"REGION": "eu-west-1"
}
```

On Unix based system, run:
```bash
sudo nano /etc/.pycof/config.json
```

and paste the above json after filling the empty strings (pre-filled values are standard default values).

*__Reminder:__* To save the file, with nano press `CTRL + O`, confirm with `y` then `CTRL + X` to exit.

On Windows, use the path `C:/Windows/.pycof/config.json`.




%package help
Summary:	Development documents and examples for pycof
Provides:	python3-pycof-doc
%description help
# PYCOF (PYthon COmmon Functions)

## 1. Installation
[![Downloads](https://pepy.tech/badge/pycof)](https://pepy.tech/project/pycof)
[![PyPI version](https://badge.fury.io/py/pycof.svg)](https://pypi.org/project/pycof/)

You can get pycof from [PyPI](https://pypi.org/project/pycof/) with:

```bash
pip install pycof
```

The library is supported on Windows, Linux and MacOs.

## 2. Usage

### 2.1. Documentation

You can find the full documentation at [https://www.florianfelice.com/pycof](https://www.florianfelice.com/pycof?orgn=github) or by clicking on the name of each function in the next section.
It will redirect you the the function's specific documentation.

### 2.1. Available functions

The current version of the library provides:

* [**`remote_execute_sql`**](https://www.florianfelice.com/pycof/sql/sql.html#pycof.sql.remote_execute_sql): aggragated function for SQL queries to `SELECT`, `INSERT`, `DELETE` or `COPY`.
* [**`read`**](https://www.florianfelice.com/pycof/datamngt/datamngt.html#pycof.data.read): Load any data file, regarless of the format.
* [**`send_email`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.send_email): simple function to send email to contacts in a concise way.
* [**`verbose_display`**](https://www.florianfelice.com/pycof/format/format.html#pycof.misc.verbose_display): extended function to [print](https://docs.python.org/3/library/functions.html#print) strings, lists, data frames and progression bar if used as a wrapper in `for` loops.
* [**`add_zero`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.add_zero): simple function to convert `int` to `str` by adding a 0 is less than 10.
* [**`group`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.group): will convert an `int` to a `str` with thousand seperator.
* [**`replace_zero`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.replace_zero): will transform 0 values to `-` for display purposes.
* [**`week_sunday`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.week_sunday): will return week number of last sunday date of a given date.
* [**`display_name`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.display_name): displays the current user name. Will display either `first`, `last` or `full` name.
* [**`write`**](https://www.florianfelice.com/pycof/format/format.html#pycof.misc.write): writes a `str` to a specific file (usually .txt) in one line of code.
* [**`file_age`**](https://www.florianfelice.com/pycof/format/format.html#pycof.misc.file_age): computes the age (in days, hours, ...) of a given local file.
* [**`str2bool`**](https://www.florianfelice.com/pycof/format/format.html#pycof.format.str2bool): converts string to boolean.
* And [**`many others`**](https://www.florianfelice.com/pycof)!



### 2.2. Config file for credentials

The function [`remote_execute_sql`](https://www.florianfelice.com/pycof/sql/sql.html#pycof.sql.remote_execute_sql) and [`send_email`](https://www.florianfelice.com/pycof/format/format.html#pycof.format.send_email) will by default look for the credentials located at `/etc/.pycof/config.json`.
On Windows, save the config file as `C:/Windows/.pycof/config.json`.

The file follows the below structure:

```bash
{
	"DB_USER": "",
	"DB_PASSWORD": "",
	"DB_HOST": "",
	"DB_PORT": "3306",
	"DB_DATABASE": "",
	"__COMMENT_1__": "Email specific, send_email"
	"EMAIL_USER": "",
	"EMAIL_PASSWORD": "",
	"EMAIL_SMTP": "smtp.gmail.com",
	"EMAIL_PORT": "587"
	"__COMMENT_2__": "IAM specific, if useIAM=True in remote_execute_sql",
	"CLUSTER_NAME": "",
	"AWS_ACCESS_KEY_ID": "",
	"AWS_SECRET_ACCESS_KEY": "",
	"REGION": "eu-west-1"
}
```

On Unix based system, run:
```bash
sudo nano /etc/.pycof/config.json
```

and paste the above json after filling the empty strings (pre-filled values are standard default values).

*__Reminder:__* To save the file, with nano press `CTRL + O`, confirm with `y` then `CTRL + X` to exit.

On Windows, use the path `C:/Windows/.pycof/config.json`.




%prep
%autosetup -n pycof-1.5.4

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-pycof -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 1.5.4-1
- Package Spec generated