Skip to content

Instantly share code, notes, and snippets.

@cdgriffith
Created January 25, 2021 19:40
Show Gist options
  • Save cdgriffith/45e57da73fd884b1d9a203117697e378 to your computer and use it in GitHub Desktop.
Save cdgriffith/45e57da73fd884b1d9a203117697e378 to your computer and use it in GitHub Desktop.
Use the standard library as Egyptian Hieroglyphs!
# Usage: from rosetta_stone import *
import abc as ๐“€€
import aifc as ๐“€
import argparse as ๐“€ƒ
import ast as ๐“€„
import asynchat as ๐“€…
import asyncio as ๐“€†
import asyncore as ๐“€‡
import base64 as ๐“€ˆ
import bdb as ๐“€‰
import binhex as ๐“€Š
import bisect as ๐“€‹
import bz2 as ๐“€Œ
import cProfile as ๐“€
import calendar as ๐“€Ž
import cgi as ๐“€
import cgitb as ๐“€
import chunk as ๐“€‘
import cmd as ๐“€’
import code as ๐“€“
import codecs as ๐“€”
import codeop as ๐“€•
import collections as ๐“€–
import colorsys as ๐“€—
import compileall as ๐“€˜
import concurrent as ๐“€™
import configparser as ๐“€š
import contextlib as ๐“€›
import contextvars as ๐“€œ
import copy as ๐“€
import copyreg as ๐“€ž
import csv as ๐“€ 
import ctypes as ๐“€ก
import dataclasses as ๐“€ฃ
import datetime as ๐“€ค
import dbm as ๐“€ฅ
import decimal as ๐“€ฆ
import difflib as ๐“€ง
import dis as ๐“€จ
import distutils as ๐“€ฉ
import doctest as ๐“€ช
import dummy_threading as ๐“€ซ
import email as ๐“€ฌ
import encodings as ๐“€ญ
import ensurepip as ๐“€ฎ
import enum as ๐“€ฏ
import filecmp as ๐“€ฐ
import fileinput as ๐“€ฑ
import fnmatch as ๐“€ฒ
import fractions as ๐“€ด
import ftplib as ๐“€ต
import functools as ๐“€ถ
import genericpath as ๐“€ท
import getopt as ๐“€ธ
import getpass as ๐“€น
import gettext as ๐“€บ
import glob as ๐“€ป
import gzip as ๐“€ผ
import hashlib as ๐“€ฝ
import heapq as ๐“€พ
import hmac as ๐“€ฟ
import html as ๐“€
import http as ๐“
import idlelib as ๐“‚
import imaplib as ๐“ƒ
import imghdr as ๐“„
import importlib as ๐“†
import inspect as ๐“‡
import io as ๐“ˆ
import ipaddress as ๐“‰
import json as ๐“Š
import keyword as ๐“‹
import linecache as ๐“Œ
import locale as ๐“
import logging as ๐“Ž
import lzma as ๐“
import mailbox as ๐“
import mailcap as ๐“‘
import mimetypes as ๐“’
import modulefinder as ๐““
import msilib as ๐“”
import multiprocessing as ๐“•
import netrc as ๐“–
import nntplib as ๐“—
import ntpath as ๐“˜
import nturl2path as ๐“™
import numbers as ๐“š
import opcode as ๐“›
import operator as ๐“œ
import optparse as ๐“
import os as ๐“ž
import pathlib as ๐“Ÿ
import pdb as ๐“ 
import pickle as ๐“ก
import pickletools as ๐“ข
import pipes as ๐“ฃ
import pkgutil as ๐“ค
import platform as ๐“ฅ
import plistlib as ๐“ฆ
import poplib as ๐“ง
import posixpath as ๐“จ
import pprint as ๐“ฉ
import profile as ๐“ช
import pstats as ๐“ซ
import py_compile as ๐“ญ
import pyclbr as ๐“ฎ
import pydoc as ๐“ฏ
import pydoc_data as ๐“ฐ
import queue as ๐“ฑ
import quopri as ๐“ฒ
import random as ๐“ณ
import re as ๐“ด
import reprlib as ๐“ต
import rlcompleter as ๐“ถ
import runpy as ๐“ท
import sched as ๐“ธ
import secrets as ๐“น
import selectors as ๐“บ
import shelve as ๐“ป
import shlex as ๐“ผ
import shutil as ๐“ฝ
import signal as ๐“พ
import site as ๐“ฟ
import smtpd as ๐“‚€
import smtplib as ๐“‚
import sndhdr as ๐“‚‚
import socket as ๐“‚ƒ
import socketserver as ๐“‚„
import sqlite3 as ๐“‚…
import sre_compile as ๐“‚†
import sre_constants as ๐“‚‡
import sre_parse as ๐“‚ˆ
import ssl as ๐“‚‰
import stat as ๐“‚Š
import statistics as ๐“‚‹
import string as ๐“‚Œ
import stringprep as ๐“‚
import struct as ๐“‚Ž
import subprocess as ๐“‚
import sunau as ๐“‚
import symbol as ๐“‚‘
import symtable as ๐“‚’
import sysconfig as ๐“‚“
import tabnanny as ๐“‚”
import tarfile as ๐“‚•
import telnetlib as ๐“‚–
import tempfile as ๐“‚—
import test as ๐“‚˜
import textwrap as ๐“‚™
import threading as ๐“‚›
import timeit as ๐“‚œ
import tkinter as ๐“‚
import token as ๐“‚ž
import tokenize as ๐“‚Ÿ
import trace as ๐“‚ 
import traceback as ๐“‚ก
import tracemalloc as ๐“‚ข
import turtle as ๐“‚ค
import turtledemo as ๐“‚ฅ
import types as ๐“‚ฆ
import typing as ๐“‚ง
import unittest as ๐“‚จ
import urllib as ๐“‚ฉ
import uu as ๐“‚ช
import uuid as ๐“‚ซ
import venv as ๐“‚ฌ
import warnings as ๐“‚ญ
import wave as ๐“‚ฎ
import weakref as ๐“‚ฏ
import webbrowser as ๐“‚ฐ
import wsgiref as ๐“‚ฑ
import xdrlib as ๐“‚ฒ
import xml as ๐“‚ณ
import xmlrpc as ๐“‚ด
import zipapp as ๐“‚ต
import zipfile as ๐“‚ถ
import zipimport as ๐“‚ท
try:
import crypt as ๐“€Ÿ
import curses as ๐“€ข
import pty as ๐“ฌ
import tty as ๐“‚ฃ
except ImportError:
pass
@cdgriffith
Copy link
Author

Created via:

import distutils.sysconfig as sysconfig
import os
std_lib = sysconfig.get_python_lib(standard_lib=True)
libraries = set()
for top, dirs, files in os.walk(std_lib):
    for nm in files:
        if nm != '__init__.py' and nm[-3:] == '.py':
            lib_name = os.path.join(top, nm)[len(std_lib)+1:-3].replace(os.sep, '.').split(".",1)[0]
            if not lib_name.startswith("_") and lib_name not in ("lib2to3", "site-packages", "imp", "formatter", "antigravity", "this"):
                libraries.add(lib_name)

for i, library in enumerate(sorted(libraries), start=77824):
    print("import", library, f'as {chr(i)}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment