Registry / http-networking / eight
library1.0.1pypypi✓ verified 86d ago

A lightweight porting helper library for writing Python 2/3 compatible code. Current version 1.0.1, stable and maintained as needed.

pip install eight
INSTALL
IMPORT
SIG · EIGHT
E
eight
http-networkingpythonv1.0.1
Install
3.2s avg
Import
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 23.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.2s · import 0.000s · 24MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

str
from builtins import str
from six import text_type
eight provides its own str from builtins via future
int
from builtins import int
unicode
for Python 2 compatibility: from builtins import str (eight unicode is str)
Prefer using str for both versions

Import future and eight for Python 2/3 compatible builtins.

from future.builtins import * from eight import * # Now you can write Python 3 code that works on Python 2 print(str('hello'))
Debug
Known issues
deprecatedeight v1.0.1 removed the deprecated 'dummy_thread' symbol from Python 2's dummy_thread module.
fix
Use 'from future.utils import with_metaclass' or import dummy_thread directly if needed.
affects: >=1.0.0
gotchaeight relies on the 'future' library. Ensure future is installed and up-to-date (>=0.16) to avoid import errors.
fix
Run: pip install 'future>=0.16'
affects: all
gotchaDo not mix 'six' and 'eight' imports. They may conflict.
fix
Stick to one compatibility library.
affects: all
Errors
Common errors & fixes
ImportError: No module named builtins
future package not installed or not in path.
fix
pip install future
AttributeError: module 'future.builtins' has no attribute 'str'
Incorrect import of future.builtins instead of using eight's imports.
fix
Use: from eight import str
Upgrade
Version history
1.0.1latest on PyPI · released Mar 16, 2021
Audit
Dependencies
futurerequiredRequired for Python 2/3 compatibility utilities
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
eight — pip install eight · libregistry