cpython

Alternative StdLib for Nim for Python targets


Keywords
python, compiled, cython, high-performance, inferred-types, needs-sponsors, nim, nim-lang, python-3, python-api, python-library, python-package, python3, static-typing, stdlib-extras, typed-python
License
MIT
Install
nimble install cpython

Documentation

Alternative StdLib for Nim for Python targets

Documentation

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).

See also