### Install pybase64 Source: https://github.com/mayeut/pybase64/blob/master/docs/intro.md Install pybase64 using pip. This command installs the package and its dependencies. ```bash pip install pybase64 ``` -------------------------------- ### pybase64 Command-Line Tool Usage Source: https://github.com/mayeut/pybase64/blob/master/README.rst Shows the basic usage and available subcommands for the pybase64 command-line interface. ```bash usage: pybase64 [-h] [-V] {benchmark,encode,decode} ... pybase64 command-line tool. positional arguments: {benchmark,encode,decode} tool help benchmark -h for usage encode -h for usage decode -h for usage optional arguments: -h, --help show this help message and exit -V, --version show program's version number and exit ``` -------------------------------- ### pybase64 Command-Line Tool Usage Source: https://github.com/mayeut/pybase64/blob/master/docs/intro.md Shows the usage of the pybase64 command-line tool, including its subcommands for benchmark, encode, and decode. ```none usage: pybase64 [-h] [-V] {benchmark,encode,decode} ... pybase64 command-line tool. positional arguments: {benchmark,encode,decode} tool help benchmark -h for usage encode -h for usage decode -h for usage optional arguments: -h, --help show this help message and exit -V, --version show program's version number and exit ``` -------------------------------- ### Encode and Decode with pybase64 Source: https://github.com/mayeut/pybase64/blob/master/README.rst Demonstrates base64 encoding and decoding using pybase64, including custom altchars and validation options. Also shows standard and URL-safe variants. ```python import pybase64 print(pybase64.b64encode(b'>>>foo???', altchars='_:')) # b'Pj4_Zm9vPz8:' print(pybase64.b64decode(b'Pj4_Zm9vPz8:', altchars='_:', validate=True)) # b'>>>foo???' # Standard encoding helpers print(pybase64.standard_b64encode(b'>>>foo???')) # b'Pj4+Zm9vPz8/' print(pybase64.standard_b64decode(b'Pj4+Zm9vPz8/')) # b'>>>foo???' # URL safe encoding helpers print(pybase64.urlsafe_b64encode(b'>>>foo???')) # b'Pj4-Zm9vPz8_' print(pybase64.urlsafe_b64decode(b'Pj4-Zm9vPz8_')) # b'>>>foo???' ``` -------------------------------- ### Encode and Decode with pybase64 Source: https://github.com/mayeut/pybase64/blob/master/docs/intro.md Demonstrates base64 encoding and decoding using pybase64's b64encode and b64decode functions. It's recommended to use validate=True for decoding when possible for performance. ```python import pybase64 print(pybase64.b64encode(b'>>>foo???', altchars='_:')) # b'Pj4_Zm9vPz8:' print(pybase64.b64decode(b'Pj4_Zm9vPz8:', altchars='_:', validate=True)) # b'>>>foo???' ``` ```python # Standard encoding helpers print(pybase64.standard_b64encode(b'>>>foo???')) # b'Pj4+Zm9vPz8/' print(pybase64.standard_b64decode(b'Pj4+Zm9vPz8/')) # b'>>>foo???' ``` ```python # URL safe encoding helpers print(pybase64.urlsafe_b64encode(b'>>>foo???')) # b'Pj4-Zm9vPz8_' print(pybase64.urlsafe_b64decode(b'Pj4-Zm9vPz8_')) # b'>>>foo???' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.