Added
- new parameters
new_x
andnew_y
forcell()
andmulti_cell()
, replacingln=0
, thanks to @gmischler - new
add_highlight()
method to insert highlight annotations: documentation - new
offset_rendering()
method: documentation - new
.text_mode
property: documentation - the page structure of the documentation has been revised, with a new page about adding text, thanks to @gmischler
- a warning is now raised if a context manager is used inside an
unbreakable()
section, which is not supported
Changed
local_context()
can now "scope" even more properties, likeblend_mode
: documentation
Fixed
- No font properties should be leaked anymore after using markdown or in any other situations (cf. #359), thanks to @gmischler
- If
multi_cell(align="J")
is given text with multiple paragraphs (text followed by an empty line) at once, it now renders the last line of each paragraph left-aligned,
instead of just the very last line (cf. #364), thanks to @gmischler - a regression: now again
multi_cell()
always renders a cell, even iftxt
is an empty string - cf. #349 - a bug with string width calculation when Markdown is enabled - cf. #351
- a few bugs when parsing some SVG files - cf. #356, #358 & #376
- a bug when using
multi_cell(..., split_only=True)
inside anunbreakable
section - cf. #359
Deprecated
- The parameter
ln
tocell()
andmulti_cell()
is now deprecated, usenew_x
andnew_y
instead. - The parameter
center
tocell()
is now deprecated, usealign="C"
instead.
Displaying deprecation warnings
DeprecationWarning
s are not displayed by Python by default.
Hence, every time you use a newer version of fpdf2
, we strongly encourage you to execute your scripts
with the -Wd
option (cf. documentation)
in order to get warned about deprecated features used in your code.
This can also be enabled programmatically with warnings.simplefilter('default', DeprecationWarning)
.
TL;DR version of lessons from the post:
- Writing open source software can be very rewarding in ways you can’t predict
- Be in it for the long haul
- Ship it and ship regularly
- Have broad, open-ended goals
- If you care enough, you’ll find the time
- No one cares about your unit test coverage
- There’s no shame in marketing
- Clear it with your employer
- Foster community
- Keep it enjoyable
Source: https://www.reddit.com/r/Python/comments/smta85/lessons_learned_from_my_10_year_open_source/
Can't I just get the data, without it being turned into objects?
We'll use this mechanism to convert tagged nodes to almost-native types, while preserving the tags.It's likely possible to handle [undefined tag prefixes and undefined aliases] in a way similar to how we handled undefined tags
A very clear and detailed article!
Les notebooks Colab sont des notebooks Jupyter hébergés par Colab.
Bank Python implementations are effectively proprietary forks of the entire Python ecosystem which are in use at many (but not all) of the biggest investment banks. Bank Python differs considerably from the common, or garden-variety Python that most people know and love (or hate).
I've said so far that a lot of data is stored in Barbara. Time to drop a bit of a bombshell: the source code is in Barbara too, not on disk. Remain composed. It's kept in a special Barbara ring called sourcecode.
it's possible to sit down, write a script and get it running in prod within the hour, which is a big deal.
Using simple Python functions, in a source controlled system, is a better middle ground than the modern-day equivalent of J2EE.
One thing I regret about software as a field is how little time is spent learning from existing systems and judging what they did well, or badly. There are only a small number of books discussing, in detail, real systems that exist.
Cette année, grâce à @kleph qui m'en a parlé, je participe au Advent of Code :
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.
You don't need a computer science background to participate - just a little programming knowledge and some problem solving skills will get you pretty far. Nor do you need a fancy computer; every problem has a solution that completes in at most 15 seconds on ten-year-old hardware.
Ce cours a pour but de t’apprendre à parler le Python. Il s’agit d’un langage particulier — un langage de programmation — pour communiquer avec ton ordinateur afin de lui demander de réaliser des tâches précises (comme exécuter un calcul, récupérer des événements du clavier, afficher une image à l’écran, etc.), c’est-à-dire exécuter un programme informatique (un logiciel).
Last month, I realized late that October was hacktoberfest month!
This online event is a month-long celebration (October 1-31) of open source software run in partnership with different software companies, with a focus on encouraging contributions to open source projects.
While I participated in the 2019 edition as a contributor …
Learning the best way of combining your love for math and programming
GitHub repo: https://github.com/ManimCommunity/manim
Examples: https://docs.manim.community/en/latest/examples.html
The other day, while watching La Carte aux trésors at my elderly neighbor's house, I casually played peg solitaire on a board she has.
After many failures at trying to get rid of all pawns but one, I started to wonder about the mathematics & algorithmics behind that game...
Back home …
cf. https://fr.wikipedia.org/wiki/Fichier_de_test_Eicar
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
FROM: https://sebsauvage.net/links/?0rGdAQ
Pour vous amuser à en créer en Python, avec fpdf2:
#!/usr/bin/env python3
# REQUIRE: pip install fpdf2 pdf417 qrcode
import fpdf, pdf417, qrcode
EICAR = 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'
pdf = fpdf.FPDF()
pdf.add_page()
pdf.set_font("Helvetica", size=30)
pdf.text(90, 20, "EICAR")
pdf.text(10, 60, "PDF-417:")
pdf.image(pdf417.render_image(pdf417.encode(EICAR)), x=10, y=60)
pdf.text(10, 140, "QRCode:")
pdf.image(qrcode.make(EICAR).get_image(), x=35, y=145)
pdf.output("eicar.pdf")
Ce blog voit l'apparition d'une nouvelle page permanente : Images libres de droits.
Cette page recense des site web, des illustrateurs, des icônes et des polices de caractères libres de droits.
Depuis octobre 2018, j'ai rassemblé une liste d'artistes dont j'apprécie le travail et qui placent leurs œuvres sous licence Creative …
À oui.sncf
, je travaille au sein d'une équipe en charge de l'usine logicielle,
qui administre depuis des années une instance Gitlab self-hosted.
Cet article contient quelques-unes de nos recommandations à l'intention des utilisateurs de notre Gitlab, ayant pour but à la fois améliorer les performances de leurs pipelines …
Détail des informations stockées dans le QR Code du pass vaccinal européen
#!/usr/bin/env python3
import sys
import zlib
import pprint
# Modules tiers (Pillow, Pyzbar, base45, cbor2)
import PIL.Image
import pyzbar.pyzbar
import base45
import cbor2
img = PIL.Image.open("qrcode.png")
data = pyzbar.pyzbar.decode(img)
cert = data[0].data.decode()
b45data = cert.replace("HC1:", "")
zlibdata = base45.b45decode(b45data)
cbordata = zlib.decompress(zlibdata)
decoded = cbor2.loads(cbordata)
print("Header\n----------------");
pprint.pprint(cbor2.loads(decoded.value[0]))
print("\nPayload\n----------------");
pprint.pprint(cbor2.loads(decoded.value[2]))
print("\nSignature ?\n----------------");
print(decoded.value[3])
I have been amazed recently at the diversity of contributors on the fpdf2 project, coming from all around the world!
Then I thought it would be nice to visualize this diversity by building a world map of all contributors locations. There it is:
Click on the image to access an …
fpdf2
is a minimalist PDF creation library for Python that I am maintaining.
With the release yesterday of its v2.4.0
, I'm going to present some of its notable new features since the latest minor version.
https://github.com/pyfpdf/fpdf2/ Doc: https://pyfpdf.github.io/fpdf2/
JPEG images …
Undying Dusk is a video game in a PDF format, with a gameplay based on exploration and logic puzzles, in the tradition of dungeon crawlers.
A curse set by the Empress keeps the world in an eternal dusk. You are have recently found shelter in an eerie monastery.
Featuring:
- ~ 200 …
What happens if malicious code is uploaded to npm under these names? Is it possible that some of PayPal’s internal projects will start defaulting to the new public packages instead of the private ones?
Today, I am happy to announce version 2.3.0 of fpdf2, code name: Unbreakable!
https://github.com/pyfpdf/fpdf2/ Doc: https://pyfpdf.github.io/fpdf2/
Why Unbreakable?
- As a tribute to M. Night Shyamalan movie
- Because using
fpdf2
, your Python code can never break!
...
Just kidding, I would be …