backlib¶
Key Features¶
Provides backports for the standard library;
Compatible with Python 3.9+;
Almost dependency-free.
Getting Started¶
Installation¶
The library is available as backlib on PyPI:
pip install backlib
Usage¶
builtins¶
For more, see the documentation.
from backlib.py310 import builtins
assert issubclass(builtins.EncodingWarning, Warning)
errno¶
For more, see the documentation.
from backlib.py311 import errno
assert errno.ENOTCAPABLE == 93
io [SOON]¶
from backlib.py311 import io
encoding = io.text_encoding(None)
assert encoding == "utf-8"
json¶
For more, see the documentation.
from backlib.py310 import json
data = json.loads("{\"backlib\": \"pypi\"}")
assert data == {"backlib": "pypi"}
operator¶
For more, see the documentation.
from backlib.py311 import operator
value = operator.call(abs, -42)
assert value == 42
os¶
For more, see the documentation.
from backlib.py312 import os
st = os.stat("pyproject.toml")
assert st.st_birthtime_ns > 0
os.path¶
For more, see the documentation.
from backlib.py313 import os
assert os.path.isreserved("NUL")
stat¶
For more, see the documentation.
from backlib.py313 import stat
assert stat.SF_SYNTHETIC == 0xC0000000
tomllib¶
For more, see the documentation.
from backlib.py311 import tomllib
data = tomllib.loads("\"backlib\" = \"pypi\"")
assert data == {"backlib": "pypi"}
Documentation¶
- Backports
- Python 3.10
builtins— Built-in objectserrno— Standard errno system symbolsio— Core tools for working with streamsjson— JSON encoder and decoderoperator— Standard operators as functionsos— Miscellaneous operating system interfacesos.path— Common pathname manipulationsstat— Interpretingstat()results
- Python 3.11
builtins— Built-in objectserrno— Standard errno system symbolsio— Core tools for working with streamsjson— JSON encoder and decoderoperator— Standard operators as functionsos— Miscellaneous operating system interfacesos.path— Common pathname manipulationsstat— Interpretingstat()resultstomllib— Parse TOML files
- Python 3.12
builtins— Built-in objectserrno— Standard errno system symbolsio— Core tools for working with streamsjson— JSON encoder and decoderoperator— Standard operators as functionsos— Miscellaneous operating system interfacesos.path— Common pathname manipulationsstat— Interpretingstat()resultstomllib— Parse TOML files
- Python 3.13
builtins— Built-in objectserrno— Standard errno system symbolsio— Core tools for working with streamsjson— JSON encoder and decoderoperator— Standard operators as functionsos— Miscellaneous operating system interfacesos.path— Common pathname manipulationsstat— Interpretingstat()resultstomllib— Parse TOML files
- Python 3.10
License¶
MIT License, Copyright (c) 2025 Sergei Y. Bogdanov. See LICENSE file.