Python Utils Documentation - Read the Docs

Python Utils

Release 3.8.2

Rick van Hattem

Mar 03, 2024

CONTENTS

1

2

3

Useful Python Utils

1.1 Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.2 Security contact information . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.3 Requirements for installing: . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.4 Installation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.5 Quickstart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.6.1

Retrying until timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.6.2

Formatting of timestamps, dates and times . . . . . . . . . . . . . . . . .

1.6.3

Converting your test from camel-case to underscores: . . . . . . . . . . .

1.6.4

Attribute setting decorator. Very useful for the Django admin . . . . . . .

1.6.5

Scaling numbers between ranges . . . . . . . . . . . . . . . . . . . . . .

1.6.6

Get the screen/window/terminal size in characters: . . . . . . . . . . . .

1.6.7

Extracting numbers from nearly every string: . . . . . . . . . . . . . . .

1.6.8

Doing a global import of all the modules in a package programmatically: .

1.6.9

Automatically named logger for classes: . . . . . . . . . . . . . . . . . .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

3

3

3

3

4

4

4

5

5

6

6

6

6

6

7

7

python_utils package

2.1 Submodules . . . . . . . . . .

2.2 python_utils.decorators module

2.3 python_utils.converters module

2.4 python_utils.formatters module

2.5 python_utils.import_ module .

2.6 python_utils.logger module . .

2.7 python_utils.terminal module .

2.8 python_utils.time module . . .

2.9 Module contents . . . . . . . .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

9

9

9

11

15

16

17

17

18

20

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Indices and tables

35

Python Module Index

37

Index

39

i

ii

Python Utils, Release 3.8.2

Contents:

CONTENTS

1

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download