A concise, community‑maintained reference of the most common and widely accepted Python import aliases (e.g., np, pd, plt). Quick to browse, easy to search, and organized by domain for fast lookup.
- Why Python Import Aliases Matter
- Goal of This Repository
- Quick Start
- Contents
- Example: Scientific Computing Aliases
- Why Use Aliases?
- When Not to Use Aliases
- Contributing
- License
- Acknowledgements
Python developers frequently use short, conventional aliases when importing popular libraries—for example:
import numpy as np
import pandas as pd
import matplotlib.pyplot as pltThese conventions:
- improve readability
- reduce typing
- match the broader Python ecosystem’s style
Many of them are widely recognized across:
- tutorials
- documentation
- data science communities
This repository collects, organizes, and documents these aliases in one central, easy‑to‑reference place.
- Provide a canonical, community-maintained reference for Python alias conventions.
- Help beginners understand which aliases are standard vs. uncommon.
- Improve code readability and consistency across teams and projects.
- Serve as an “alias encyclopedia” for Python libraries of all kinds.
This project is not prescriptive. Some developers prefer full module names, and many discussions highlight that excessive alias usage can reduce readability.
Our purpose is simply to document what the community already does, not to dictate style.
Browse aliases by domain:
Aliases are organized by domain:
-
Scientific Computing
NumPy, pandas, matplotlib, SciPy, seaborn, xarray, etc. -
Machine Learning & AI
TensorFlow, PyTorch, scikit‑learn, Theano, JAX, etc. -
Data Engineering & Big Data
PySpark, Dask, Polars, etc. -
Web Development
Flask, Django, FastAPI, Requests, etc. -
Miscellaneous & Utilities
Standard library modules, general-purpose libraries, small tools.
Each category lives in its own markdown file under the aliases/ directory.
A taste of what you’ll find inside:
| Package | Alias | Import Example |
|---|---|---|
| NumPy | np | import numpy as np |
| pandas | pd | import pandas as pd |
| matplotlib.pyplot | plt | import matplotlib.pyplot as plt |
| seaborn | sns | import seaborn as sns |
| xarray | xr | import xarray as xr |
| plotly.express | px | import plotly.express as px |
Many of these appear frequently in community-driven alias lists.
Common reasons include:
-
Shorter code
Using np.array() is cleaner than numpy.array().
Common alias examples include packages like numpy → np, pandas → pd. -
Community standards
Many libraries have widely accepted conventional aliases. -
Consistency
Predictable naming across projects helps new contributors onboard faster. -
Readability for heavy‑use modules
For frequently used namespaces, aliases reduce clutter.
Aliases aren’t always the best choice:
- If a module is rarely used
- When the alias isn’t well-known or obvious
- If it makes the code harder for newcomers to understand
- In teams that enforce a “full namespace” policy
Multiple community discussions raise concerns about over-aliasing making code harder to follow. [reddit.com]
Use aliases thoughtfully.
We welcome contributions!
If you'd like to add or correct aliases:
- Fork the repo
- Add or modify entries in aliases/
- Submit a pull request
Guidelines:
- Only add aliases that are in real-world use
- Mark non-standard aliases clearly
- Add references where applicable (tutorials, documentation, etc.)
This project is released under the MIT License.
Feel free to use, copy, and adapt this for your own projects.
Thanks to the Python community, tutorials, articles, and discussions that inspired this repository. The idea of collecting alias conventions is supported by numerous posts and guides that highlight common module abbreviations and best practices.