GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - juancarlospaco/cpython: Alternative StdLib for Nim for Python targets, hijacks Python StdLib for Nim

BranchesTags
Open more actions menu

Latest commit

 

History

739 Commits
739 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
src/cpython
src/cpython
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
cpython.nimble
cpython.nimble
 
 
nim-python-hybrid0.png
nim-python-hybrid0.png
 
 
nim-python-hybrid1.png
nim-python-hybrid1.png
 
 
poll.png
poll.png
 
 
upbge.gif
upbge.gif
 
 
wiki_changelog_2022.md
wiki_changelog_2022.md
 
 

Repository files navigation

Alternative StdLib for Nim for Python targets

Documentation

  • ✔️ atexit ➡️ https://juancarlospaco.github.io/cpython/atexit
  • ✔️ base64 ➡️ https://juancarlospaco.github.io/cpython/base64
  • ✔️ binascii ➡️ https://juancarlospaco.github.io/cpython/binascii
  • ✔️ binhex ➡️ https://juancarlospaco.github.io/cpython/binhex
  • ✔️ builtins ➡️ https://juancarlospaco.github.io/cpython/builtins
  • ✔️ bz2 ➡️ https://juancarlospaco.github.io/cpython/bz2
  • ✔️ cmath ➡️ https://juancarlospaco.github.io/cpython/cmath
  • ✔️ codecs ➡️ https://juancarlospaco.github.io/cpython/codecs
  • ✔️ codeop ➡️ https://juancarlospaco.github.io/cpython/codeop
  • ✔️ colorsys ➡️ https://juancarlospaco.github.io/cpython/colorsys
  • ✔️ compileall ➡️ https://juancarlospaco.github.io/cpython/compileall
  • ✔️ copy ➡️ https://juancarlospaco.github.io/cpython/copy
  • ✔️ crypt ➡️ https://juancarlospaco.github.io/cpython/crypt
  • ✔️ curses ➡️ https://juancarlospaco.github.io/cpython/curses
  • ✔️ decimal ➡️ https://juancarlospaco.github.io/cpython/decimal
  • ✔️ dbd ➡️ https://juancarlospaco.github.io/cpython/dbd
  • ✔️ dis ➡️ https://juancarlospaco.github.io/cpython/dis
  • ✔️ doctest ➡️ https://juancarlospaco.github.io/cpython/doctest
  • ✔️ ensurepip ➡️ https://juancarlospaco.github.io/cpython/ensurepip
  • ✔️ errno ➡️ https://juancarlospaco.github.io/cpython/errno
  • ✔️ faulthandler ➡️ https://juancarlospaco.github.io/cpython/faulthandler
  • ✔️ fcntl ➡️ https://juancarlospaco.github.io/cpython/fcntl
  • ✔️ filecmp ➡️ https://juancarlospaco.github.io/cpython/filecmp
  • ✔️ fnmatch ➡️ https://juancarlospaco.github.io/cpython/fnmatch
  • ✔️ gc ➡️ https://juancarlospaco.github.io/cpython/gc
  • ✔️ getopt ➡️ https://juancarlospaco.github.io/cpython/getopt
  • ✔️ getpass ➡️ https://juancarlospaco.github.io/cpython/getpass
  • ✔️ gettext ➡️ https://juancarlospaco.github.io/cpython/gettext
  • ✔️ glob ➡️ https://juancarlospaco.github.io/cpython/glob
  • ✔️ grp ➡️ https://juancarlospaco.github.io/cpython/grp
  • ✔️ gzip ➡️ https://juancarlospaco.github.io/cpython/gzip
  • ✔️ hashlib ➡️ https://juancarlospaco.github.io/cpython/hashlib
  • ✔️ hmac ➡️ https://juancarlospaco.github.io/cpython/hmac
  • ✔️ html.entities ➡️ https://juancarlospaco.github.io/cpython/html_entities
  • ✔️ imghdr ➡️ https://juancarlospaco.github.io/cpython/imghdr
  • ✔️ imp ➡️ https://juancarlospaco.github.io/cpython/imp
  • ✔️ importlib ➡️ https://juancarlospaco.github.io/cpython/importlib
  • ✔️ keyword ➡️ https://juancarlospaco.github.io/cpython/keyword
  • ✔️ linecache ➡️ https://juancarlospaco.github.io/cpython/linecache
  • ✔️ logging ➡️ https://juancarlospaco.github.io/cpython/logging
  • ✔️ lzma ➡️ https://juancarlospaco.github.io/cpython/lzma
  • ✔️ marshal ➡️ https://juancarlospaco.github.io/cpython/marshal
  • ✔️ math ➡️ https://juancarlospaco.github.io/cpython/math
  • ✔️ mimetypes ➡️ https://juancarlospaco.github.io/cpython/mimetypes
  • ✔️ ntpath ➡️ https://juancarlospaco.github.io/cpython/ntpath
  • ✔️ nis ➡️ https://juancarlospaco.github.io/cpython/nis
  • ✔️ operator ➡️ https://juancarlospaco.github.io/cpython/operator
  • ✔️ os ➡️ https://juancarlospaco.github.io/cpython/os
  • ✔️ pickle ➡️ https://juancarlospaco.github.io/cpython/pickle
  • ✔️ pickletools ➡️ https://juancarlospaco.github.io/cpython/pickletools
  • ✔️ pkgutil ➡️ https://juancarlospaco.github.io/cpython/pkgutil
  • ✔️ posixpath ➡️ https://juancarlospaco.github.io/cpython/posixpath
  • ✔️ pprint ➡️ https://juancarlospaco.github.io/cpython/pprint
  • ✔️ pwd ➡️ https://juancarlospaco.github.io/cpython/pwd
  • ✔️ py_compile ➡️ https://juancarlospaco.github.io/cpython/py_compile
  • ✔️ quopri ➡️ https://juancarlospaco.github.io/cpython/quopri
  • ✔️ random ➡️ https://juancarlospaco.github.io/cpython/random
  • ✔️ re ➡️ https://juancarlospaco.github.io/cpython/re
  • ✔️ readline ➡️ https://juancarlospaco.github.io/cpython/readline
  • ✔️ reprlib ➡️ https://juancarlospaco.github.io/cpython/reprlib
  • ✔️ resource ➡️ https://juancarlospaco.github.io/cpython/resource
  • ✔️ runpy ➡️ https://juancarlospaco.github.io/cpython/runpy
  • ✔️ secrets ➡️ https://juancarlospaco.github.io/cpython/secrets
  • ✔️ shutil ➡️ https://juancarlospaco.github.io/cpython/shutil
  • ✔️ signal ➡️ https://juancarlospaco.github.io/cpython/signal
  • ✔️ site ➡️ https://juancarlospaco.github.io/cpython/site
  • ✔️ sndhdr ➡️ https://juancarlospaco.github.io/cpython/sndhdr
  • ✔️ spwd ➡️ https://juancarlospaco.github.io/cpython/spwd
  • ✔️ statistics ➡️ https://juancarlospaco.github.io/cpython/statistics
  • ✔️ struct ➡️ https://juancarlospaco.github.io/cpython/struct
  • ✔️ ssl ➡️ https://juancarlospaco.github.io/cpython/ssl
  • ✔️ subprocess ➡️ https://juancarlospaco.github.io/cpython/subprocess
  • ✔️ sys ➡️ https://juancarlospaco.github.io/cpython/sys
  • ✔️ sysconfig ➡️ https://juancarlospaco.github.io/cpython/sysconfig
  • ✔️ syslog ➡️ https://juancarlospaco.github.io/cpython/syslog
  • ✔️ tabnanny ➡️ https://juancarlospaco.github.io/cpython/tabnanny
  • ✔️ tempfile ➡️ https://juancarlospaco.github.io/cpython/tempfile
  • ✔️ termios ➡️ https://juancarlospaco.github.io/cpython/termios
  • ✔️ textwrap ➡️ https://juancarlospaco.github.io/cpython/textwrap
  • ✔️ timeit ➡️ https://juancarlospaco.github.io/cpython/timeit
  • ✔️ token ➡️ https://juancarlospaco.github.io/cpython/token
  • ✔️ tty ➡️ https://juancarlospaco.github.io/cpython/tty
  • ✔️ turtle ➡️ https://juancarlospaco.github.io/cpython/turtle
  • ✔️ typing ➡️ https://juancarlospaco.github.io/cpython/typing
  • ✔️ unicodedata ➡️ https://juancarlospaco.github.io/cpython/unicodedata
  • ✔️ uu ➡️ https://juancarlospaco.github.io/cpython/uu
  • ✔️ uuid ➡️ https://juancarlospaco.github.io/cpython/uuid
  • ✔️ venv ➡️ https://juancarlospaco.github.io/cpython/venv
  • ✔️ warnings ➡️ https://juancarlospaco.github.io/cpython/warnings
  • ✔️ webbrowser ➡️ https://juancarlospaco.github.io/cpython/webbrowser
  • ✔️ winsound ➡️ https://juancarlospaco.github.io/cpython/winsound
  • ✔️ zipapp ➡️ https://juancarlospaco.github.io/cpython/zipapp
  • ✔️ zlib ➡️ https://juancarlospaco.github.io/cpython/zlib
  • :trollface: More supported modules soon...
  • For more documentation, use Python official documentation, works too.

UPBGE

UPBGE API is supported out of the box, new UPBGE features will be integrated.

3D Games, GUI with OpenGL and shaders, audio, video, and more...

Are you Gamedev?, Pull Requests welcome!.

Design

  • 1 Dependency only.
  • 1 Nim module per 1 Python module.
  • Module files are <200 lines each of pure Nim code.
  • Arbitrary precision big Decimals with all the operators for Nim.
  • Compatible with ARC and ORC deterministic memory nanagement.
  • Enforces real strong inferred static typing with UFCS for Python.
  • Same API as Python StdLib, same function names, same argument names (Names starting and ending with double underscore are not legal in Nim).
  • 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.
  • Simple code using template, easy to hack for new users, KISS & DRY.
  • 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.
  • If Python removes a module from StdLib you must obtain the .py file somehow, but the .nim remains.
  • It does not use anything from Nim standard library, very future-proof (uses Nimpy for Python-Nim interop, but other than that they are thin wrappers, with minimal dependency on StdLib).
  • Package version == Python version.
  • Pet the turtle.

Requisites

  • Python ( >2.7 works but unsupported, >3.5 minimal, >=3.10 recommended ).

Install

nimble install cpython

OR

nimble install https://github.com/juancarlospaco/cpython.git

Doing JavaScript or Web Dev ?

  • Alternative StdLib for Nim for NodeJS/JavaScript targets, hijacks NodeJS StdLib for Nim.

Why?

The idea comes from the community of "Nim en Espanol" Telegram group (Spanish).

Also...

  • Whole new StdLib becomes usable for Nim, without Nim having to spend resources.
  • Showcase easy interoperability of Nim (CTypes is harder, Python is verbose, etc).
  • Arbitrary precision big Decimals for Nim.
  • Others do it too (Scala/Kotlin uses Java StbLib, Swift uses Objective-C StdLib, etc).
  • Python does it too, Python is written in C therefore using C StdLib.
  • Make others work improving libs that you can use in Nim.
  • A place to pile up "Nim-ified" Python stuff.

See also

  • For Python Programmers
  • Nim integration for Python PIP
  • Python modules Deprecated from Python StdLib for download (PEP594)

💰➡️🍕

Bitcoin BTC

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

BTC Bitcoin Network

1Pnf45MgGgY32X4KDNJbutnpx96E4FxqVi

Lightning Network

[email protected]
Ethereum ETH Dai DAI Uniswap UNI Axie Infinity AXS Smooth Love Potion SLP Uniswap UNI USDC

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

ERC20 Ethereum Network

0xb78c4cf63274bb22f83481986157d234105ac17e
Tether USDT

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

ERC20 Ethereum Network

0xb78c4cf63274bb22f83481986157d234105ac17e

TRC20 Tron Network

TWGft53WgWvH2mnqR8ZUXq1GD8M4gZ4Yfu
Solana SOL

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

SOL Solana Network

FKaPSd8kTUpH7Q76d77toy1jjPGpZSxR4xbhQHyCMSGq
Cardano ADA

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

ADA Cardano Network

DdzFFzCqrht9Y1r4Yx7ouqG9yJNWeXFt69xavLdaeXdu4cQi2yXgNWagzh52o9k9YRh3ussHnBnDrg7v7W2hSXWXfBhbo2ooUKRFMieM
Sandbox SAND Decentraland MANA

ERC20 Ethereum Network

0xb78c4cf63274bb22f83481986157d234105ac17e
Algorand ALGO

ALGO Algorand Network

WM54DHVZQIQDVTHMPOH6FEZ4U2AU3OBPGAFTHSCYWMFE7ETKCUUOYAW24Q
Polkadot DOT

DOT Network

13GdxHQbQA1K6i7Ctf781nQkhQhoVhGgUnrjn9EvcJnYWCEd

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e
Binance

https://pay.binance.com/en/checkout/e92e536210fd4f62b426ea7ee65b49c3

Stars

⭐ @juancarlospaco ⭐ @aguspiza ⭐ @AndrielFR ⭐ @S0Sbrigade8 ⭐ @aphkyle ⭐ @jhgalino ⭐ @YanMu2020 ⭐ @matkuki ⭐ @Traumatism ⭐ @foxoman ⭐ @whee ⭐ @bakarilevy ⭐ @Ryu1845 ⭐ @babaloveyou ⭐ @jdbernard ⭐ @cyraxjoe ⭐ @zendbit ⭐ @vovavili ⭐ @xujin8 ⭐ @Geksan ⭐ @shxdow ⭐ @singularperturbation ⭐ @adokitkat ⭐ @luisacosta828 ⭐ @ByK95 ⭐ @daweedkob ⭐ @Quantum-Codes ⭐ @qununc ⭐ @AriesFoxgirl ⭐ @Braden-Preston ⭐ @AriesFoxgirl ⭐ @mahmoudimus ⭐ @terretta ⭐ @AndrewGPU ⭐ @themorya ⭐ @zimitz ⭐ @tommo ⭐ @rlipsc ⭐ @jyapayne ⭐ @barseghyanartur ⭐ @tiberiuichim ⭐ @yuchunzhou ⭐ @lf-araujo ⭐ @pietroppeter ⭐ @arkanoid87 ⭐ @jgdevop ⭐ @onoe-serika ⭐ @shizhaojingszj ⭐ @W1M0R ⭐ @genbtc ⭐ @buster-blue ⭐ @Megamegamium ⭐ @1MarcosDev ⭐ @lightcax ⭐ @termermc ⭐ @catsmells ⭐ @maleyva1 ⭐ @all-an ⭐ @janflyborg ⭐ @smeggingsmegger ⭐ @ArikRahman ⭐ @KolyaRS ⭐ @jinczing ⭐ @jason-chandler ⭐ @lolgab ⭐ @melMass ⭐ @xgr ⭐ @majj ⭐ @dseeni ⭐ @jmgomez ⭐ @shaoxie1986 ⭐ @wjl12 ⭐ @cammclain ⭐ @Optimax125 ⭐ @hanok2 ⭐ @KhazAkar ⭐ @rxx ⭐ @FI-Mihej ⭐ @davidvfx07 ⭐ @gnusec ⭐ @ziggertonziggy ⭐ @neroist ⭐ @Bimzzzzz ⭐ @tuanductran ⭐ @Zira3l137 ⭐ @ranjian0 ⭐ @drewbitt ⭐ @taylourchristian ⭐ @seruman ⭐ @corv89 ⭐ @pkulev ⭐ @marioboi3112 ⭐ @planetis-m ⭐ @shaneish ⭐ @trinhminhtriet ⭐ @jtonsing ⭐ @kalaverin ⭐ @svaite ⭐ @hasansezertasan ⭐ @moncefdhk999 ⭐ @jeansossmeier ⭐ @seanstrom ⭐ @Miqueas ⭐ @fmalina ⭐ @Dregacorp ⭐ @kylesinlynn ⭐ @nilslindemann ⭐ @vvsagar ⭐ @a07087263-cmyk ⭐ @dkapt ⭐ @prospero78 ⭐ @slegrand45 ⭐ @toffeeframe ⭐ @alexcochran ⭐ @Ignatz-CastroR ⭐ @emansije

About

Alternative StdLib for Nim for Python targets, hijacks Python StdLib for Nim

gist.github.com/juancarlospaco/37da34ed13a609663f55f4466c4dbc3e

Topics

compiledcythonhigh-performanceinferred-typesneeds-sponsorsnimnim-langpythonpython-3python-apipython-librarypython-packagepython3static-typingstdlib-extrastyped-python

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity

Stars

167 stars

Watchers

5 watching

Forks

3 forks
Report repository

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.