Start Reading

#111 loguru: Python logging made simple

0 page


Sponsored by

Brian #1: loguru: Python logging made (stupidly) simple

Finally, a logging interface that is just slightly more syntax than print to do mostly the right thing, and all that fancy stuff like log rotation is easy to figure out.
i.e. a logging API that fits in my brain.
bonus: README is a nice tour of features with examples.

Ready to use out of the box without boilerplate
No Handler, no Formatter, no Filter: one function to rule them all
Easier file logging with rotation / retention / compression
Modern string formatting using braces style
Exceptions catching within threads or main
Pretty logging with colors
Asynchronous, Thread-safe, Multiprocess-safe
Fully descriptive exceptions
Structured logging as needed
Lazy evaluation of expensive functions
Customizable levels
Better datetime handling
Suitable for scripts and libraries
Entirely compatible with standard logging
Personalizable defaults through environment variables
Convenient parser
Exhaustive notifier

Michael #2: Python gets a new governance model

by Brett Canon
July 2018, Guido steps down
Python progress has basically been on hold since then
ended up with 7 governance proposals
Voting was open to all core developers as we couldn't come up with a reasonable criteria that we all agreed to as to what defined an "active" core dev
And the winner is ... In the end PEP 8016, the steering council proposal, won.
it was a decisive win against second place
PEP 8016 is heavily modeled on the Django project's organization (to the point that the PEP had stuff copy-and-pasted from the original Django governance proposal).

What it establishes is a steering council of five people who are to determine how to run the Python project. Short of not being able to influence how the council itself is elected (which includes how the electorate is selected), the council has absolute power.
result of the vote prevents us from ever having the Python project be leaderless again, it doesn't directly solve how to guide the language's design.

What's next? The next step is we elect the council. It's looking like nominations will be from Monday, January 07 to Sunday, January 20 and voting from Monday, January 21 to Sunday, February 03
A key point I hope people understand is that while we solved the issue of project management that stemmed from Guido's retirement, the council will need to be given some time to solve the other issue of how to manage the design of Python itself.

Brian #3: Why you should be using pathlib

Tour of pathlib from Trey Hunner
pathlib combines most of the commonly used file and directory operations from os, os.path, and glob.
uses objects instead of strings
as of Python 3.6, many parts of stdlib support pathlib
since pathlib.Path methods return Path objects, chaining is possible
convert back to strings if you really need to for pre-3.6 code

make a directory: Path('src/__pypackages__').mkdir(parents=True, exist_ok=True)
rename a file: Path('.editorconfig').rename('src/.editorconfig')
find some files: top_level_csv_files = Path.cwd().glob('*.csv')
recursively: all_csv_files = Path.cwd().rglob('*.csv')
read a file: Path('some/file').read_text()
write to a file: Path('.editorconfig').write_text('# config goes here')
with open(path, mode) as x works with Path objects as of 3.6

Follow up article by Trey: No really, pathlib is great

Michael #4: Altair and Altair Recipes

via Antonio Piccolboni (he wrote altair_recipes)
Altair: Declarative statistical visualization library for Python

Altair is developed by Jake Vanderplas and Brian Granger
By statistical visualization they mean:

The data source is a DataFrame that consists of columns of different data types (quantitative, ordinal, nominal and date/time).
The DataFrame is in a tidy format where the rows correspond to samples and the columns correspond to the observed variables.
The data is mapped to the visual properties (position, color, size, shape, facetin

Read on the Scribd mobile app

Download the free Scribd mobile app to read anytime, anywhere.