Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » packages » readPackage
next | previous | forward | backward | up | index | toc

# readPackage -- read the package preamble

- Usage:
    `readPackage PackageName`
- Inputs:
  - PackageName, a string, the name of the package, or a Package object
- Optional inputs:
  - FileName => a string, default value null, the name of the file containing the source code of the package, from which it should be read
- Outputs:
  - an option table, containing the options given to newPackage in the preamble of the package

## Description

The file PackageName.m2 should be on the load path and should contain a package named PackageName. This function is mostly used for getting information about a package quickly and without processing the entire package.

    i1 : opts = readPackage "NormalToricVarieties"

    o1 = OptionTable{Authors => {{Name => Gregory G. Smith, Email => ggsmith@mast.queensu.ca, HomePage => http://www.mast.queensu.ca/~ggsmith}}}
                     AuxiliaryFiles => true
                     CacheExampleOutput => null
                     Certification => null
                     Configuration => {}
                     Date => 31 May 2020
                     DebuggingMode => false
                     Headline => routines for working with normal toric varieties and related objects
                     HomePage => null
                     InfoDirSection => Macaulay2 and its packages
                     Keywords => {Toric Geometry}
                     OptionalComponentsPresent => null
                     PackageExports => {Polyhedra, Schubert2, Varieties, Truncations}
                     PackageImports => {FourierMotzkin, Normaliz, LLLBases, Complexes}
                     Reload => false
                     UseCachedExampleOutput => null
                     Version => 1.9

    o1 : OptionTable

    i2 : "1.9" <= opts.Version

    o2 = true

## See also

- Package -- the class of all packages
- newPackage -- the preamble of a package
- loadPackage -- load a package

## Ways to use readPackage:

- `readPackage(Package)`
- `readPackage(String)`

## For the programmer

The object readPackage is a method function with options.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/package-doc.m2:688:0.