% Generated by Sphinx.
\def\sphinxdocclass{report}
\documentclass[letterpaper,10pt,english]{sphinxmanual}
\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{00A0}{\nobreakspace}
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{times}
\usepackage[Bjarne]{fncychap}
\usepackage{longtable}
\usepackage{sphinx}
\usepackage{multirow}

\addto\captionsenglish{\renewcommand{\figurename}{Fig. }}
\addto\captionsenglish{\renewcommand{\tablename}{Table }}
\floatname{literal-block}{Listing }



\title{PyOEIS Documentation}
\date{June 18, 2015}
\release{1.0}
\author{Dylan Evans}
\newcommand{\sphinxlogo}{}
\renewcommand{\releasename}{Release}
\makeindex

\makeatletter
\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax%
    \let\PYG@ul=\relax \let\PYG@tc=\relax%
    \let\PYG@bc=\relax \let\PYG@ff=\relax}
\def\PYG@tok#1{\csname PYG@tok@#1\endcsname}
\def\PYG@toks#1+{\ifx\relax#1\empty\else%
    \PYG@tok{#1}\expandafter\PYG@toks\fi}
\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{%
    \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}}
\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}}

\expandafter\def\csname PYG@tok@gd\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
\expandafter\def\csname PYG@tok@gu\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
\expandafter\def\csname PYG@tok@gt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
\expandafter\def\csname PYG@tok@gs\endcsname{\let\PYG@bf=\textbf}
\expandafter\def\csname PYG@tok@gr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}}
\expandafter\def\csname PYG@tok@cm\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}}
\expandafter\def\csname PYG@tok@vg\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}}
\expandafter\def\csname PYG@tok@m\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@mh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@cs\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}
\expandafter\def\csname PYG@tok@ge\endcsname{\let\PYG@it=\textit}
\expandafter\def\csname PYG@tok@vc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}}
\expandafter\def\csname PYG@tok@il\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@go\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.20,0.20,0.20}{##1}}}
\expandafter\def\csname PYG@tok@cp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@gi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}}
\expandafter\def\csname PYG@tok@gh\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\expandafter\def\csname PYG@tok@ni\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.84,0.33,0.22}{##1}}}
\expandafter\def\csname PYG@tok@nl\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.13,0.44}{##1}}}
\expandafter\def\csname PYG@tok@nn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}}
\expandafter\def\csname PYG@tok@no\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.38,0.68,0.84}{##1}}}
\expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@nc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}}
\expandafter\def\csname PYG@tok@nd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}}
\expandafter\def\csname PYG@tok@ne\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@nf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.49}{##1}}}
\expandafter\def\csname PYG@tok@si\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.44,0.63,0.82}{##1}}}
\expandafter\def\csname PYG@tok@s2\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@vi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}}
\expandafter\def\csname PYG@tok@nt\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.45}{##1}}}
\expandafter\def\csname PYG@tok@nv\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}}
\expandafter\def\csname PYG@tok@s1\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@gp\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}}
\expandafter\def\csname PYG@tok@sh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@ow\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@sx\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}}
\expandafter\def\csname PYG@tok@bp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@c1\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}}
\expandafter\def\csname PYG@tok@kc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@c\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}}
\expandafter\def\csname PYG@tok@mf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@err\endcsname{\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}
\expandafter\def\csname PYG@tok@mb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@ss\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.32,0.47,0.09}{##1}}}
\expandafter\def\csname PYG@tok@sr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.14,0.33,0.53}{##1}}}
\expandafter\def\csname PYG@tok@mo\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@kd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@mi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}}
\expandafter\def\csname PYG@tok@kn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@o\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYG@tok@kr\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@s\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@kp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@w\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
\expandafter\def\csname PYG@tok@kt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.56,0.13,0.00}{##1}}}
\expandafter\def\csname PYG@tok@sc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@sb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@k\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}}
\expandafter\def\csname PYG@tok@se\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}
\expandafter\def\csname PYG@tok@sd\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}}

\def\PYGZbs{\char`\\}
\def\PYGZus{\char`\_}
\def\PYGZob{\char`\{}
\def\PYGZcb{\char`\}}
\def\PYGZca{\char`\^}
\def\PYGZam{\char`\&}
\def\PYGZlt{\char`\<}
\def\PYGZgt{\char`\>}
\def\PYGZsh{\char`\#}
\def\PYGZpc{\char`\%}
\def\PYGZdl{\char`\$}
\def\PYGZhy{\char`\-}
\def\PYGZsq{\char`\'}
\def\PYGZdq{\char`\"}
\def\PYGZti{\char`\~}
% for compatibility with earlier versions
\def\PYGZat{@}
\def\PYGZlb{[}
\def\PYGZrb{]}
\makeatother

\renewcommand\PYGZsq{\textquotesingle}

\begin{document}

\maketitle
\tableofcontents
\phantomsection\label{index::doc}


Contents:


\chapter{Introduction}
\label{introduction:introduction}\label{introduction::doc}\label{introduction:welcome-to-pyoeis-s-documentation}
The \href{http://www.oeis.org}{Online Encyclopedia of Integer Sequences (OEIS)} is
a database of integer sequences. It contains many well-known sequences, such as
the primes and Fibonacci numbers as well as many more obscure sequences.

PyOEIS allows for the searching of the OEIS from within Python, as well as
allowing you to access sequence information through
{\hyperref[api:sequence.Sequence]{\emph{\code{Sequence}}}} objects.


\section{OEIS Search Syntax and Other Useful Links}
\label{introduction:oeis-search-syntax-and-other-useful-links}
While PyOEIS provides many porcelain methods which allow you to search by
sequence ID, author etc., it is also possible to query the OEIS using its
usual search syntax (as you would on the website). It may also be useful to
understand how the OEIS operates for debugging purposes. The following links
may therefore be of use:
\begin{itemize}
\item {} 
\href{http://oeis.org/hints.html}{Hints and search syntax}

\item {} 
\href{http://oeis.org/eishelp1.html}{Explanation of the OEIS internal format (which PyOEIS is built upon)}

\item {} 
\href{http://oeis.org/eishelp2.html}{Explanation of the fields in each sequence entry}

\end{itemize}


\chapter{API}
\label{api:api}\label{api::doc}

\section{\texttt{OEISClient} objects}
\label{api:oeisclient-objects}\index{OEISClient (class in client)}

\begin{fulllineitems}
\phantomsection\label{api:client.OEISClient}\pysigline{\strong{class }\code{client.}\bfcode{OEISClient}}
Maintains a \href{http://docs.python-requests.org/en/latest/api/\#requests.Session}{\code{Session}} and
contains all methods for querying the OEIS.
\index{get\_by\_id() (OEISClient method)}

\begin{fulllineitems}
\phantomsection\label{api:OEISClient.get_by_id}\pysiglinewithargsret{\bfcode{get\_by\_id}}{\emph{id}}{}
Returns a {\hyperref[api:sequence.Sequence]{\emph{\code{Sequence}}}} for the sequence with the
ID \emph{id}, or else raises {\hyperref[api:errors.NoResultsError]{\emph{\code{NoResultsError}}}}.

\begin{notice}{note}{Note:}
On the OEIS website, IDs are displayed with an uppercase letter and 6
(for A IDs) or 4 (for M and N IDs) digits. However, this method does not
require an uppercase letter or leading zeros to be used.
\end{notice}

\end{fulllineitems}

\index{lookup\_by\_name() (OEISClient method)}

\begin{fulllineitems}
\phantomsection\label{api:OEISClient.lookup_by_name}\pysiglinewithargsret{\bfcode{lookup\_by\_name}}{\emph{name}, \emph{max\_seqs=10}}{}
Returns a list of at most \emph{max\_seqs} {\hyperref[api:sequence.Sequence]{\emph{\code{Sequence}}}}
objects whose names contain \emph{name}.

\begin{notice}{note}{Note:}
Sequences are retrieved in sets of 10 and sequences are then removed if
necessary. So, there is no speed improvement between, for example, a
\emph{max\_seqs} of 10 and one of 15. This applies to all methods with a
\emph{max\_seqs} argument.
\end{notice}

\end{fulllineitems}

\index{lookup\_by\_author() (OEISClient method)}

\begin{fulllineitems}
\phantomsection\label{api:OEISClient.lookup_by_author}\pysiglinewithargsret{\bfcode{lookup\_by\_author}}{\emph{author}, \emph{max\_seqs=10}}{}
Returns a list of at most \emph{max\_seqs} {\hyperref[api:sequence.Sequence]{\emph{\code{Sequence}}}}
objects whose authors contain \emph{author}.

\end{fulllineitems}

\index{lookup\_by() (client.OEISClient method)}

\begin{fulllineitems}
\phantomsection\label{api:client.OEISClient.lookup_by}\pysiglinewithargsret{\bfcode{lookup\_by}}{\emph{prefix}, \emph{query}, \emph{max\_seqs=10}, \emph{list\_func=False}}{}
If \emph{prefix} is \emph{``''}, search OEIS with string \emph{query},
otherwise use string `\emph{prefix}:\emph{query}`.

If \emph{list\_func} is true, return a list of at most
\emph{max\_seqs} {\hyperref[api:sequence.Sequence]{\emph{\code{Sequence}}}} objects or
else an empty list if there are no results. If \emph{list\_func}
is false, return the first Sequence found, or else raise a
{\hyperref[api:errors.NoResultsError]{\emph{\code{NoResultsError}}}}.

\end{fulllineitems}

\index{lookup\_by\_keywords() (client.OEISClient method)}

\begin{fulllineitems}
\phantomsection\label{api:client.OEISClient.lookup_by_keywords}\pysiglinewithargsret{\bfcode{lookup\_by\_keywords}}{\emph{keywords}}{}
Returns a list of at most \emph{max\_seqs}
{\hyperref[api:sequence.Sequence]{\emph{\code{Sequence}}}} objects which are
tagged with \emph{keywords}.

\end{fulllineitems}

\index{lookup\_by\_terms() (client.OEISClient method)}

\begin{fulllineitems}
\phantomsection\label{api:client.OEISClient.lookup_by_terms}\pysiglinewithargsret{\bfcode{lookup\_by\_terms}}{\emph{terms}, \emph{**kwargs}}{}
Returns a list of at most \emph{max\_seqs}
{\hyperref[api:sequence.Sequence]{\emph{\code{Sequence}}}} objects which
contain \emph{terms} anywhere within them. If none exist,
returns an empty list. If \emph{ordered} is false, terms may be
in any order. If \emph{signed} is false, terms may be positive
or negative.

\end{fulllineitems}


\end{fulllineitems}



\section{\texttt{Sequence} objects}
\label{api:sequence-objects}\index{Sequence (class in sequence)}

\begin{fulllineitems}
\phantomsection\label{api:sequence.Sequence}\pysiglinewithargsret{\strong{class }\code{sequence.}\bfcode{Sequence}}{\emph{sequence\_entry}}{}
Takes internal format sequence entry as constructor argument.

Has attributes to contain information for each field of a
sequence entry in the OEIS and methods fot retrieving a certain
number of the sequence's signed or unsigned terms.
\index{generate() (Sequence method)}

\begin{fulllineitems}
\phantomsection\label{api:Sequence.generate}\pysiglinewithargsret{\bfcode{generate}}{\emph{n}}{}
If a parsable formula exists, returns the \emph{nth} term of the sequence, else
raises a {\hyperref[api:errors.NoFunctionError]{\emph{\code{NoFunctionError}}}}.

\end{fulllineitems}

\index{signed() (sequence.Sequence method)}

\begin{fulllineitems}
\phantomsection\label{api:sequence.Sequence.signed}\pysiglinewithargsret{\bfcode{signed}}{\emph{n}}{}
Returns the first \emph{n} signed integers in the sequence.

\end{fulllineitems}

\index{unsigned() (sequence.Sequence method)}

\begin{fulllineitems}
\phantomsection\label{api:sequence.Sequence.unsigned}\pysiglinewithargsret{\bfcode{unsigned}}{\emph{n}}{}
Returns the first \emph{n} unsigned integers in the sequence.

\end{fulllineitems}


\end{fulllineitems}



\subsection{Attributes}
\label{api:attributes}
\begin{tabulary}{\linewidth}{|L|L|}
\hline

id
 & 
The sequence's unique ID in the OEIS, as a string. Begins `A'.
\\
\hline
alt\_ids
 & 
Other IDs, as a list of strings beginning `M' and `N' which
the sequence carried in the ``The Encyclopedia of Integer
Sequences'', 1995 or the ``Handbook of Integer Sequences'', 1973,
respectively.
\\
\hline
unsigned\_list
 & 
A list of terms in the sequence without any minus signs.
\\
\hline
signed\_list
 & 
A list of terms in the sequence \emph{including} any minus signs.
\\
\hline
name
 & 
The name of the sequence, as a string.
\\
\hline
references
 & 
A list of references to the sequence.
\\
\hline
links
 & 
A list of links about the sequence.
\\
\hline
formulae
 & 
Formulae for generating the sequence, as a list of strings.
\\
\hline
cross\_references
 & 
Cross-references to the sequence from elsewhere in the OEIS,
as a list of strings.
\\
\hline
author
 & 
The author of the sequence entry, as a string.
\\
\hline
offset
 & 
The subscript of the first term and the position of the first
term whose modulus exceeds 1, as a tuple of two numbers.
\\
\hline
errors
 & 
Errors in the sequence entry, as a list of strings.
\\
\hline
examples
 & 
Examples to illustrate the sequence, as a list of strings.
\\
\hline
maple
 & 
Maple code to generate the sequence, as a string.
\\
\hline
mathematica
 & 
Mathematica code to generate the sequence, as a string.
\\
\hline
other\_programs
 & 
Code to generate the sequence in other programs/languages, as
a list of strings.
\\
\hline
keywords
 & 
The sequence's keywords, as a list of strings.
\\
\hline
comments
 & 
Comments on the sequence entry, as a list of strings.
\\
\hline\end{tabulary}


More information about the fields in a sequence entry can be found \href{http://oeis.org/eishelp2.html}{here}.


\section{\texttt{Errors}}
\label{api:module-errors}\label{api:errors}\index{errors (module)}\index{InvalidQueryError}

\begin{fulllineitems}
\phantomsection\label{api:errors.InvalidQueryError}\pysiglinewithargsret{\strong{exception }\code{errors.}\bfcode{InvalidQueryError}}{\emph{response}}{}
Raised when a search is invalid according to the OEIS search
syntax.

\end{fulllineitems}

\index{MalformedSequenceError}

\begin{fulllineitems}
\phantomsection\label{api:errors.MalformedSequenceError}\pysiglinewithargsret{\strong{exception }\code{errors.}\bfcode{MalformedSequenceError}}{\emph{malformed\_line}}{}
Raised when a sequence entry does not contain the required
information in a parsable format.

\end{fulllineitems}

\index{NoFunctionError}

\begin{fulllineitems}
\phantomsection\label{api:errors.NoFunctionError}\pysiglinewithargsret{\strong{exception }\code{errors.}\bfcode{NoFunctionError}}{\emph{seq}}{}
Raised when a sequence has no formula.

\end{fulllineitems}

\index{NoResultsError}

\begin{fulllineitems}
\phantomsection\label{api:errors.NoResultsError}\pysiglinewithargsret{\strong{exception }\code{errors.}\bfcode{NoResultsError}}{\emph{query}}{}
Raised when a search gives no results and it is unacceptable to
return an empty list.

\end{fulllineitems}

\index{OEISException}

\begin{fulllineitems}
\phantomsection\label{api:errors.OEISException}\pysigline{\strong{exception }\code{errors.}\bfcode{OEISException}}
Base class for PyOEIS exceptions.

\end{fulllineitems}

\index{TooManyResultsError}

\begin{fulllineitems}
\phantomsection\label{api:errors.TooManyResultsError}\pysiglinewithargsret{\strong{exception }\code{errors.}\bfcode{TooManyResultsError}}{\emph{query}}{}
Raised when too many results are found for a search for them to
be properly parsed.

\end{fulllineitems}



\chapter{Usage}
\label{usage:usage}\label{usage::doc}
The first thing you must do when using pyoeis is to initialise an
{\hyperref[api:client.OEISClient]{\emph{\code{OEISClient}}}}:

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{pyoeis}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{c} \PYG{o}{=} \PYG{n}{pyoeis}\PYG{o}{.}\PYG{n}{OEISClient}\PYG{p}{(}\PYG{p}{)}
\end{Verbatim}

This handles all queries to the OEIS and all methods for querying are accessed
from it. For example, say we want to access the entry for sequence A000040, the
primes:

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{primes} \PYG{o}{=} \PYG{n}{c}\PYG{o}{.}\PYG{n}{get\PYGZus{}by\PYGZus{}id}\PYG{p}{(}\PYG{l+s}{\PYGZsq{}}\PYG{l+s}{a40}\PYG{l+s}{\PYGZsq{}}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{primes}\PYG{o}{.}\PYG{n}{name}
\PYG{g+go}{u\PYGZsq{}The prime numbers\PYGZsq{}}
\end{Verbatim}


\chapter{Indices and tables}
\label{index:indices-and-tables}\begin{itemize}
\item {} 
\DUspan{xref,std,std-ref}{genindex}

\item {} 
\DUspan{xref,std,std-ref}{modindex}

\item {} 
\DUspan{xref,std,std-ref}{search}

\end{itemize}


\renewcommand{\indexname}{Python Module Index}
\begin{theindex}
\def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}}
\bigletter{e}
\item {\texttt{errors}}, \pageref{api:module-errors}
\end{theindex}

\renewcommand{\indexname}{Index}
\printindex
\end{document}
