Import statement
An import statement is a source-code declaration that makes names or definitions from another module, package, or namespace available in the current scope.
Learn AI-Assisted Python Programming, Second Edition
- How it is used
- Extends Python programs with reusable modules for files, archives, data processing, visualization, automation, and other tasks.
- How deep it goes
- Explains why imports are needed, distinguishes built-in from installable modules, and diagnoses missing-import and version errors without covering import internals.
- Examples
- Uses string.punctuation for password validation, zipfile for archives, os for directories, and PyPDF2 or PyMuPDF for PDF processing.
- What you can do after
- Operate/configure Python programs by importing suitable modules, installing external dependencies, and fixing missing-name or compatibility errors.
Read how Learn AI-Assisted Python Programming, Second Edition explains import statement →
Web Components in Action
A JavaScript module declaration that makes exported bindings from another module available in the current module.
- How it is used
- Replaces a fragile collection of page-level script references with component-managed JavaScript dependencies.
- How deep it goes
- Works through a multi-component import chain but defers a deeper introduction to modules.
- Examples
- Uses a browser harp whose application imports a string container, which imports an individual string component.
- What you can do after
- Build it from scratch as a Web Component dependency chain with one JavaScript module entry in the HTML page.
Read how Web Components in Action explains import statement →
The Quick Python Book, Fourth Edition
- How it is used
- Makes definitions from local, library, or package modules available to code that uses them.
- How deep it goes
- Explains three import forms, name qualification, wildcard exports, package imports, and reload; defers detailed module-search locations.
- Examples
- Uses a circle-area module, `math` versus `cmath`, and a nested package with initialization output.
- What you can do after
- Build it from scratch: split functions into a module and call them from client code using an appropriate import form.
Read how The Quick Python Book, Fourth Edition explains import statement →
Python Workout, Second Edition
A module import is the Python operation that loads a module and makes its definitions available to importing code.
- How it is used
- Supports code reuse across programs by loading modules and exposing their definitions.
- How deep it goes
- Explains syntax, name binding, filesystem search, and sys.modules caching, then extends to packages and reloading.
- Examples
- Uses os imports, aliased third-party modules, package imports, wildcard imports, and a two-file sales-tax exercise.
- What you can do after
- Build it from scratch by dividing reusable logic across Python modules and importing the needed functions or objects.
Read how Python Workout, Second Edition explains import statement →
Python Workout: 50 ten-minute exercises
- How it is used
- Supports reusable, maintainable Python programs by making module and package definitions available across files.
- How deep it goes
- Explains syntax, aliases, selected bindings, search paths, single loading, and execution guards, but does not detail import machinery internals.
- Examples
- Uses os imports, aliases, selected names, a two-file sales-tax program, and the __name__ execution guard.
- What you can do after
- Build it from scratch by separating reusable functions into modules and importing them with explicit or aliased names.
Read how Python Workout: 50 ten-minute exercises explains import statement →
The Joy of JavaScript
A JavaScript module feature for bringing exported bindings or module namespaces into the current module.
- How it is used
- Consumes APIs across application modules while supporting static dependency analysis and separation of concerns.
- How deep it goes
- Explains default, named, aliased, namespace, package, and dynamic imports, stopping short of a complete syntax reference.
- Examples
- Uses Transaction, Block, validation utilities, RxJS operators, and feature-flagged wallet implementations.
- What you can do after
- Apply ESM import forms to consume default, named, namespace, package, and conditionally loaded module APIs.
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
A JavaScript module syntax form that brings bindings or module code into the current module from another module.
- How it is used
- Brings selected module values or side effects into another file without sharing them through global variables.
- How deep it goes
- Works through location syntax, import forms, bindings, and execution order; leaves environment-specific module resolution to loaders.
- Examples
- Uses currency formatting, a changing title, analytics setup, and a logging-order check to distinguish import behaviors.
- What you can do after
- Practice/perform it by choosing default, named, namespace, or side-effect imports and predicting when imported code runs.
Pro Angular 16
An import statement is JavaScript or TypeScript syntax that declares a dependency on another module and makes its exported declarations available in the current module.
- How it is used
- Declares dependencies on exported module features used by data models, components, and Angular application modules.
- How deep it goes
- Explains named-import syntax, relative module paths, omitted extensions, and bundle inclusion; defers fuller build-tool details.
- Examples
- Uses a to-do data model and a file that imports two classes to print messages in the browser console.
- What you can do after
- Apply it via Angular development tools to use exported classes across files and include their required code in the browser bundle.
Essential TypeScript 5, Third Edition
An import statement is JavaScript module syntax that declares dependencies on exported bindings from another module.
- How it is used
- Declares dependencies so one file can use exported features from another module or include an application stylesheet.
- How deep it goes
- Explains default and named imports, module locations, and Node.js path and format failures; does not detail every import form.
- Examples
- Uses tax and utility functions, imported TypeScript classes, a compiler error, and a React stylesheet dependency.
- What you can do after
- Build it from scratch: write default or named imports and choose runtime-compatible paths for a Node.js TypeScript project.
Read how Essential TypeScript 5, Third Edition explains import statement →
Practices of the Python Pro
- How it is used
- Uses imports to connect focused modules while making dependencies and name origins visible.
- How deep it goes
- Explains direct, whole-module, aliased, wildcard, and package imports, stopping short of import execution internals.
- Examples
- Demonstrates sales-tax modules, receipt code, conflicting time names, aliases, and database and search packages.
- What you can do after
- Apply it via Python import syntax to reuse module definitions, qualify names, avoid collisions, and structure packages.
Read how Practices of the Python Pro explains import statement →
Secrets of the JavaScript Ninja, Second Edition
JavaScript module syntax for bringing exported bindings from another module into the current module's scope.
- How it is used
- Brings explicitly exported identifiers from another ES6 module into the current module.
- How deep it goes
- Explains named, namespace, default, and aliased imports, and shows that unexported identifiers remain inaccessible.
- Examples
- Uses `Ninja.js` examples to import named exports, a namespace, a default class, and an aliased function.
- What you can do after
- Apply named, namespace, default, and aliased imports to access exported module identifiers.
Read how Secrets of the JavaScript Ninja, Second Edition explains import statement →
Learn Haskell by Example
An import declaration is a Haskell declaration that makes definitions from another module available in the importing module.
- How it is used
- Shares definitions between Haskell modules and structures larger projects through direct, qualified, or re-exported imports.
- How deep it goes
- Explains exported definitions, qualified access, name conflicts, cyclical imports, and module re-export structure.
- Examples
- Uses Lib and Main, a conflicting Graph lookup, and a Csv facade re-exporting Conversion and Types.
- What you can do after
- Apply it by importing modules, qualifying conflicting names, or exposing grouped submodules through a re-export.
Read how Learn Haskell by Example explains import statement →
Get Programming: Learn to code with Python
- How it is used
- Reuses definitions from other files or libraries to organize code and avoid copying definitions.
- How deep it goes
- Defines importing and explains module names, same-folder files, and library types through examples.
- Examples
- Uses Circle and Rectangle classes from shapes.py and random functions for numbers and list selection.
- What you can do after
- Apply imports to use classes from another file and random operations from a library.
Read how Get Programming: Learn to code with Python explains import statement →
Related concepts
- moduleuses · A module is a distinct, bounded software unit that groups related code or functionality and provides an organizational or interaction boundary within a larger system.
- wildcard importincludes · A wildcard import is an import statement that brings eligible exported names from a module, package, object, or namespace into the importing scope.
- dynamic importcontrasts with · Dynamic import is a language feature that asynchronously loads a module at runtime and returns a promise for its module namespace.
- packageuses · A package is a programming-language namespace and organizational unit that groups related code and may define import, compilation, or access boundaries.
- sys.pathuses · sys.path is the ordered sequence of filesystem paths that Python’s import system searches when locating importable modules and packages.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.












