Skip to main content

PYCOF (PYthon COmmon Functions)

1. Installation

Downloads PyPI version

You can get pycof from PyPI with:

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 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: aggragated function for SQL queries to SELECT, INSERT, DELETE or COPY.
  • read: Load any data file, regarless of the format.
  • send_email: simple function to send email to contacts in a concise way.
  • verbose_display: extended function to print strings, lists, data frames and progression bar if used as a wrapper in for loops.
  • add_zero: simple function to convert int to str by adding a 0 is less than 10.
  • group: will convert an int to a str with thousand seperator.
  • replace_zero: will transform 0 values to - for display purposes.
  • week_sunday: will return week number of last sunday date of a given date.
  • display_name: displays the current user name. Will display either first, last or full name.
  • write: writes a str to a specific file (usually .txt) in one line of code.
  • file_age: computes the age (in days, hours, ...) of a given local file.
  • str2bool: converts string to boolean.
  • And many others!

2.2. Config file for credentials

The function remote_execute_sql and 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:

{
	"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:

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.

Release files for PYCOF 1.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PYCOF 1.8.0
File Size Uploaded
pycof-1.8.0.tar.gz 28.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PYCOF 1.8.0
File Interpreter ABI Platform
pycof-1.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 58.7 kB

Release files / pycof-1.8.0.tar.gz

Download URL pycof-1.8.0.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3e9106a246c4a533a100c460ee405a94252a6e061409f1df41badc98d53ec157
BLAKE2b-256 checksum
How to use checksums
e3eb0d2fec1e597df1cb5fc9cd95d042ae97c673da10e945b1d4a9dbdd1e8945
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

Release files / pycof-1.8.0-py3-none-any.whl

Download URL pycof-1.8.0-py3-none-any.whl
Size 30.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcf8273efd9165c45e9d5bf0775b852f1921cf741e61a0afa9d41d46836ec5f2
BLAKE2b-256 checksum
How to use checksums
5b432395d211eceddccf82e0493ed626cd33ccae7de2f718d9e855ff3289be39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.8.0 This release

2 release files

1.7.1

2 release files

1.5.15

2 release files

1.5.14

2 release files

1.5.13

2 release files

1.5.12

2 release files

1.5.10

2 release files

1.5.9

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.12

2 release files

1.2.11

2 release files

1.2.10

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.41

2 release files

1.1.40

2 release files

1.1.39

2 release files

1.1.38

2 release files

1.1.37

2 release files

1.1.36

2 release files

1.1.35

2 release files

1.1.33

2 release files

1.1.32

2 release files

1.1.31

2 release files

1.1.30

2 release files

1.1.29

2 release files

1.1.28

2 release files

1.1.27

2 release files

1.1.26

2 release files

1.1.25

2 release files

1.1.24

2 release files

1.1.23

2 release files

1.1.22

2 release files

1.1.21

2 release files

1.1.20

2 release files

1.1.19

2 release files

1.1.17

2 release files

1.1.16

2 release files

1.1.15

2 release files

1.1.14

2 release files

1.1.13

2 release files

1.1.12

2 release files

1.1.11

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page