Metadata-Version: 2.1
Name: backlib
Version: 0.2.1
Summary: Backports for the Python standard library.
Home-page: https://github.com/syubogdanov/backlib
License: MIT
Keywords: python,backport,stdlib,errno,io,json,operator,os,os.path,stat,tomllib
Author: Sergei Y. Bogdanov
Author-email: syubogdanov@outlook.com
Maintainer: Sergei Y. Bogdanov
Maintainer-email: syubogdanov@outlook.com
Requires-Python: >=3.9,<3.14
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: typing-extensions (>=4.12,<5.0)
Project-URL: Documentation, https://backlib.readthedocs.io
Project-URL: Repository, https://github.com/syubogdanov/backlib
Description-Content-Type: text/markdown

# backlib

[![PyPI Version][shields/pypi/version]][pypi/homepage]
[![PyPI Downloads][shields/pypi/downloads]][pypi/homepage]
[![License][shields/pypi/license]][github/license]
[![Python Version][shields/python/version]][pypi/homepage]

> [!WARNING]
> The library is in the pre-alpha stage. Bugs may exist!

## 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`][pypi/homepage] on PyPI:

```shell
pip install backlib
```

### Usage

#### builtins

For more, see the [documentation][docs/all].

```python
from backlib.py310 import builtins

assert issubclass(builtins.EncodingWarning, Warning)
```

#### errno

For more, see the [documentation][docs/all].

```python
from backlib.py311 import errno

assert errno.ENOTCAPABLE == 93
```

#### io [SOON]

For more, see the [documentation][docs/all].

```python
from backlib.py311 import io

encoding = io.text_encoding(None)

assert encoding == "utf-8"
```

#### json

For more, see the [documentation][docs/all].

```python
from backlib.py310 import json

data = json.loads("{\"backlib\": \"pypi\"}")

assert data == {"backlib": "pypi"}
```

#### operator

For more, see the [documentation][docs/all].

```python
from backlib.py311 import operator

value = operator.call(abs, -42)

assert value == 42
```

#### os

For more, see the [documentation][docs/all].

```python
from backlib.py312 import os

st = os.stat("pyproject.toml")

assert st.st_birthtime_ns > 0
```

#### os.path

For more, see the [documentation][docs/all].

```python
from backlib.py313 import os

assert os.path.isreserved("NUL")
```

#### stat

For more, see the [documentation][docs/all].

```python
from backlib.py313 import stat

assert stat.SF_SYNTHETIC == 0xC0000000
```

#### tomllib

For more, see the [documentation][docs/all].

```python
from backlib.py311 import tomllib

data = tomllib.loads("\"backlib\" = \"pypi\"")

assert data == {"backlib": "pypi"}
```

## License

MIT License, Copyright (c) 2025 Sergei Y. Bogdanov. See [LICENSE][github/license] file.

<!-- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -->

[docs/all]: https://backlib.readthedocs.io/en/latest/backports/index.html

[github/license]: https://github.com/syubogdanov/backlib/tree/main/LICENSE

[pypi/homepage]: https://pypi.org/project/backlib/

[shields/pypi/downloads]: https://img.shields.io/pypi/dm/backlib.svg?color=green
[shields/pypi/license]: https://img.shields.io/pypi/l/backlib.svg?color=green
[shields/pypi/version]: https://img.shields.io/pypi/v/backlib.svg?color=green
[shields/python/version]: https://img.shields.io/pypi/pyversions/backlib.svg?color=green

