Alternative StdLib for Nim for Python targets
Documentation
-
✔️ base64➡️ https://juancarlospaco.github.io/cpython/base64.html -
✔️ binascii➡️ https://juancarlospaco.github.io/cpython/binascii.html -
✔️ binhex➡️ https://juancarlospaco.github.io/cpython/binhex.html -
✔️ bz2➡️ https://juancarlospaco.github.io/cpython/bz2.html -
✔️ cmath➡️ https://juancarlospaco.github.io/cpython/cmath.html -
✔️ codecs➡️ https://juancarlospaco.github.io/cpython/codecs.html -
✔️ codeop➡️ https://juancarlospaco.github.io/cpython/codeop.html -
✔️ colorsys➡️ https://juancarlospaco.github.io/cpython/colorsys.html -
✔️ compileall➡️ https://juancarlospaco.github.io/cpython/compileall.html -
✔️ crypt➡️ https://juancarlospaco.github.io/cpython/crypt.html -
✔️ curses➡️ https://juancarlospaco.github.io/cpython/curses.html -
✔️ dbd➡️ https://juancarlospaco.github.io/cpython/dbd.html -
✔️ doctest➡️ https://juancarlospaco.github.io/cpython/doctest.html -
✔️ ensurepip➡️ https://juancarlospaco.github.io/cpython/ensurepip.html -
✔️ faulthandler➡️ https://juancarlospaco.github.io/cpython/faulthandler.html -
✔️ fcntl➡️ https://juancarlospaco.github.io/cpython/fcntl.html -
✔️ filecmp➡️ https://juancarlospaco.github.io/cpython/filecmp.html -
✔️ fnmatch➡️ https://juancarlospaco.github.io/cpython/fnmatch.html -
✔️ gc➡️ https://juancarlospaco.github.io/cpython/gc.html -
✔️ getopt➡️ https://juancarlospaco.github.io/cpython/getopt.html -
✔️ getpass➡️ https://juancarlospaco.github.io/cpython/getpass.html -
✔️ gettext➡️ https://juancarlospaco.github.io/cpython/gettext.html -
✔️ glob➡️ https://juancarlospaco.github.io/cpython/glob.html -
✔️ grp➡️ https://juancarlospaco.github.io/cpython/grp.html -
✔️ gzip➡️ https://juancarlospaco.github.io/cpython/gzip.html -
✔️ hashlib➡️ https://juancarlospaco.github.io/cpython/hashlib.html -
✔️ hmac➡️ https://juancarlospaco.github.io/cpython/hmac.html -
✔️ imghdr➡️ https://juancarlospaco.github.io/cpython/imghdr.html -
✔️ imp➡️ https://juancarlospaco.github.io/cpython/imp.html -
✔️ keyword➡️ https://juancarlospaco.github.io/cpython/keyword.html -
✔️ linecache➡️ https://juancarlospaco.github.io/cpython/linecache.html -
✔️ logging➡️ https://juancarlospaco.github.io/cpython/logging.html -
✔️ lzma➡️ https://juancarlospaco.github.io/cpython/lzma.html -
✔️ marshal➡️ https://juancarlospaco.github.io/cpython/marshal.html -
✔️ math➡️ https://juancarlospaco.github.io/cpython/math.html -
✔️ mimetypes➡️ https://juancarlospaco.github.io/cpython/mimetypes.html -
✔️ nis➡️ https://juancarlospaco.github.io/cpython/nis.html -
✔️ operator➡️ https://juancarlospaco.github.io/cpython/operator.html -
✔️ os➡️ https://juancarlospaco.github.io/cpython/os.html -
✔️ pwd➡️ https://juancarlospaco.github.io/cpython/pwd.html -
✔️ py_compile➡️ https://juancarlospaco.github.io/cpython/py_compile.html -
✔️ quopri➡️ https://juancarlospaco.github.io/cpython/quopri.html -
✔️ random➡️ https://juancarlospaco.github.io/cpython/random.html -
✔️ re➡️ https://juancarlospaco.github.io/cpython/re.html -
✔️ runpy➡️ https://juancarlospaco.github.io/cpython/runpy.html -
✔️ secrets➡️ https://juancarlospaco.github.io/cpython/secrets.html -
✔️ shutil➡️ https://juancarlospaco.github.io/cpython/shutil.html -
✔️ spwd➡️ https://juancarlospaco.github.io/cpython/spwd.html -
✔️ statistics➡️ https://juancarlospaco.github.io/cpython/statistics.html -
✔️ struct➡️ https://juancarlospaco.github.io/cpython/struct.html -
✔️ sys➡️ https://juancarlospaco.github.io/cpython/sys.html -
✔️ sysconfig➡️ https://juancarlospaco.github.io/cpython/sysconfig.html -
✔️ syslog➡️ https://juancarlospaco.github.io/cpython/syslog.html -
✔️ tabnanny➡️ https://juancarlospaco.github.io/cpython/tabnanny.html -
✔️ tempfile➡️ https://juancarlospaco.github.io/cpython/tempfile.html -
✔️ termios➡️ https://juancarlospaco.github.io/cpython/termios.html -
✔️ textwrap➡️ https://juancarlospaco.github.io/cpython/textwrap.html -
✔️ timeit➡️ https://juancarlospaco.github.io/cpython/timeit.html -
✔️ token➡️ https://juancarlospaco.github.io/cpython/token.html -
✔️ tty➡️ https://juancarlospaco.github.io/cpython/tty.html -
✔️ turtle➡️ https://juancarlospaco.github.io/cpython/turtle.html -
✔️ unicodedata➡️ https://juancarlospaco.github.io/cpython/unicodedata.html -
✔️ uu➡️ https://juancarlospaco.github.io/cpython/uu.html -
✔️ uuid➡️ https://juancarlospaco.github.io/cpython/uuid.html -
✔️ venv➡️ https://juancarlospaco.github.io/cpython/venv.html -
✔️ warnings➡️ https://juancarlospaco.github.io/cpython/warnings.html -
✔️ webbrowser➡️ https://juancarlospaco.github.io/cpython/webbrowser.html -
✔️ winsound➡️ https://juancarlospaco.github.io/cpython/winsound.html -
✔️ zipapp➡️ https://juancarlospaco.github.io/cpython/zipapp.html -
✔️ zlib➡️ https://juancarlospaco.github.io/cpython/zlib.html - More supported modules soon...
- Open an issue for more Python libraries that you want wrapped! (1 issue per 1 lib).
For more documentation, use Python official documentation, works too.
Design
- 1 Dependency only.
- 1 Nim module per 1 Python module.
- Compatible with ARC, ORC,
strictFuncs
. - Module files are <200 lines each of pure Nim code.
- Enforces real strong inferred static typing with UFCS for Python.
- Same API as Python StdLib, same function names, same argument names.
- Use the vanilla official Python StdLib that you already know by memory.
- Same module filenames as Python StdLib, same imports as Python StdLib.
- Documentation online, but also any Python documentation should work too.
- It does not use anything from Nim standard library, very future-proof.
- Stuff deprecated/removed in Python before year 2020 will not be supported.
- We do not deprecate stuff, even if Python deprecate/remove it, it will keep working for Nim.
- Each file is completely self-contained standalone, you can copy just 1 file on your project and use it.
- Package version == Python version.
Requisites
- Python ( >
2.7
works but unsupported, >3.5
minimal, >=3.10
recommended ).
Install
nimble install https://github.com/juancarlospaco/cpython.git
Stars
Doing JavaScript or Web Dev ?
Why?
The idea comes from the community of "Nim en Espanol" Telegram group (Spanish).