Skip to content

48th Week of 2022


  • New: Add the donation information.




  • New: Suggest to use pydeps.

    If you get lost in understanding your dependencies, you can try using pydeps to get your head around it.


  • New: Introduce python gnupg.

    python-gnupg is a Python library to interact with gpg taking care of the internal details and allows its users to generate and manage keys, encrypt and decrypt data, and sign and verify messages.


    pip install python-gnupg


    ```python gpg = gnupg.GPG(gnupghome="/path/to/home/directory")


    public_keys = gpg.list_keys() private_keys = gpg.list_keys(True)

Python Snippets


  • New: Introduce python elasticsearch library.

    Python elasticsearch is the Official low-level client for Elasticsearch. Its goal is to provide common ground for all Elasticsearch-related code in Python; because of this it tries to be opinion-free and very extendable.


    pip install elasticsearch


    from elasticsearch import Elasticsearch
    client = Elasticsearch("http://localhost:9200")
    resp ="test-index", query={"match_all": {}})
    documents = resp.body["hits"]["hits"]
    doc = {"partial_document": "value"}
    resp = client.update(index=INDEX, id=id_, doc=doc)


  • New: Introduce pythonping.

    pythonping is simple way to ping in Python. With it, you can send ICMP Probes to remote devices like you would do from the terminal.

    Warning: Since using pythonping requires root permissions or granting cap_net_raw capability to the python interpreter, try to measure the latency to a server by other means such as using requests.


  • New: Disable loading of images.

    You can pass options to the initialization of the chromedriver to tweak how does the browser behave. To get a list of the actual prefs you can go to chrome://prefs-internals, there you can get the code you need to tweak.

    options = ChromeOptions()
            "profile.default_content_setting_values.images": 2,


  • New: Create a --version command.

    You could use a callback to implement a --version CLI option.

    It would show the version of your CLI program and then it would terminate it. Even before any other CLI parameter is processed.

    from typing import Optional
    import typer
    __version__ = "0.1.0"
    def version_callback(value: bool) -> None:
        """Print the version of the program."""
        if value:
            print(f"Awesome CLI Version: {__version__}")
            raise typer.Exit()
    def main(
        version: Optional[bool] = typer.Option(
            None, "--version", callback=version_callback, is_eager=True
    ) -> None:
    if __name__ == "__main__":
  • New: Testing.

    Testing is similar to click testing, but you import the CliRunner directly from typer:

    from typer.testing import CliRunner
  • New: Introduce sponsorship analysis.

    It may arrive the moment in your life where someone wants to sponsor you. There are many sponsoring platforms you can use, each has their advantages and disadvantages.

    • Liberapay.
    • Ko-fi.
    • Buy me a coffee.
    • Github Sponsor.
    [Liberapay][3] [Ko-fi][4] [Buy Me a Coffee][6] [Github Sponsor][7]
    Non-profit [Yes][1] No No No! (Microsoft!)
    Monthly fee No No No No
    Donation Commission 0% 0% 5% Not clear
    Paid plan No [Yes][5] No No
    Payment Processors Stripe, Paypal Stripe, Paypal Stripe, Standard Payout Stripe
    One time donations [Possible but not user friendly][2] Yes Yes Yes
    Membership Yes Yes Yes Yes
    Shop/Sales No Yes No No
    Based in France ? United States United States?
    + Pay delay Instant Instant Instant
    User friendliness OK Good Good Good

    Liberapay is the only non-profit recurrent donations platform. It's been the most recommended platform from the people I know from the open-source, activist environment.

    Ko-fi would be my next choice, as they don't do commissions on the donations and they support more features (that I don't need right now) than Liberapay.