Click is a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary. It's the "Command Line Interface Creation Kit". It's highly configurable but comes with sensible defaults out of the box.
It aims to make the process of writing command line tools quick and fun while also preventing any frustration caused by the inability to implement an intended CLI API.
Click in three points:
- Arbitrary nesting of commands
- Automatic help page generation
- Supports lazy loading of subcommands at runtime
Isn't it awesome how optparse and argparse generate help messages based on your code?!
Hell no! You know what's awesome? It's when the option parser is generated based on the beautiful help message that you write yourself! This way you don't need to write this stupid repeatable parser-code, and instead can write only the help message--the way you want it.
This document gives coding conventions for the Python code comprising the standard library in the main Python distribution. Please see the companion informational PEP describing style guidelines for the C code in the C implementation of Python 1.
This document and PEP 257 (Docstring Conventions) were adapted from Guido’s original Python Style Guide essay, with some additions from Barry’s style guide 2.
This style guide evolves over time as additional conventions are identified and past conventions are rendered obsolete by changes in the language itself.
Many projects have their own coding style guidelines. In the event of any conflicts, such project-specific guides take precedence for that project.
Bandit is a tool designed to find common security issues in Python code. To do this, Bandit processes each file, builds an AST from it, and runs appropriate plugins against the AST nodes. Once Bandit has finished scanning all the files, it generates a report.
This documentation is generated by the Sphinx toolkit and lives in the source tree.
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. Windows is a first-class citizen, in our world.
It automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your Pipfile as you install/uninstall packages. It also generates the ever-important Pipfile.lock, which is used to produce deterministic builds.
Pipenv is primarily meant to provide users and developers of applications with an easy method to setup a working environment. For the distinction between libraries and applications and the usage of setup.py vs Pipfile to define dependencies, see ☤ Pipfile vs setup.py.
This bot is meant to be super easy platform to write Matrix bot functionality in Python. It uses matrix-nio library https://github.com/poljar/matrix-nio/ for Matrix communications.
Zero configuration except Matrix account info is needed. Everything else can be done with bot commands.
Type !help in room with this bot running to list active modules.
If you don't want some modules, just delete the files from modules directory or disable them with !bot disable command.
End-to-end encryption is currently not supported by bot but should be doable. Bot won't respond to commands in e2ee rooms. PR for enabling e2ee is welcome!
Support room: #hemppa:hacklab.fi - https://matrix.to/#/#hemppa:hacklab.fi
Welcome to the Python Packaging User Guide, a collection of tutorials and references to help you distribute and install Python packages with modern tools.
This guide is maintained on GitHub by the Python Packaging Authority. We happily accept any contributions and feedback. 😊
signald is a daemon that facilitates communication over Signal.
Atheris is a coverage-guided Python fuzzing engine. It supports fuzzing of Python code, but also native extensions written for CPython. Atheris is based off of libFuzzer. When fuzzing native code, Atheris can be used in combination with Address Sanitizer or Undefined Behavior Sanitizer to catch extra bugs.
This is the Dulwich project.
It aims to provide an interface to git repos (both local and remote) that doesn’t call out to git directly but instead uses pure Python.
Handling own exception class
When you raise an exception from within an except block in Python, you have three options:
- If a new/unexpected exception occurs in the code handling the original exception, raise NewException.
- If you want to wrap the original exception(s) (e.g., with a common base exception to reduce complexity for your users), raise NewException from cause.
- If you want to hide the original exception because it is irrelevant for your users, raise NewException from None.
We learned how to send emails with attachment, read emails from Gmail inbox and how to send messages to Microsoft teams channel.
When you are automating the mundane tasks, there might be cases when you have to generate PDF files. It could be invoices, reports, or simple documentation. In this article, we will see how to generate PDF files using Python's reportlab module.
Scrapy is a fast high-level web crawling and web scraping framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from data mining to monitoring and automated testing.
To send messages to the Microsoft teams channel, we will use the requests module.
Dnspython is a DNS toolkit for Python. It can be used for queries, zone transfers, dynamic updates, nameserver testing, and many other things.
Dnspython provides both high and low level access to the DNS. The high level classes perform queries for data of a given name, type, and class, and return an answer set. The low level classes allow direct manipulation of DNS zones, messages, names, and records. Almost all RR types are supported.
dnspython originated at Nominum where it was developed for testing DNS nameservers.
ArchiveBox takes a list of website URLs you want to archive, and creates a local, static, browsable HTML clone of the content from those websites (it saves HTML, JS, media files, PDFs, images and more).
You can use it to preserve access to websites you care about by storing them locally offline. ArchiveBox imports lists of URLs, renders the pages in a headless, authenticated, user-scriptable browser, and then archives the content in multiple redundant common formats (HTML, PDF, PNG, WARC) that will last long after the originals disappear off the internet. It automatically extracts assets and media from pages and saves them in easily-accessible folders, with out-of-the-box support for extracting git repositories, audio, video, subtitles, images, PDFs, and more.
A flexible and powerful static content management system for building complex and beautiful websites out of flat files — for people who do not want to make a compromise between a CMS and a static blog engine.
Getting your ideas implemented is as easy as frying an egg.
Whether you’re brand new to the world of computer vision and deep learning or you’re already a seasoned practitioner, you’ll find tutorials for both beginners and experts alike. Here are some of the most popular categories and tutorials on the PyImageSearch blog.