https://github.com/ombucha/python-oeis
A basic API wrapper for OEIS.
https://github.com/ombucha/python-oeis
database math oeis python sequences
Last synced: 21 days ago
JSON representation
A basic API wrapper for OEIS.
- Host: GitHub
- URL: https://github.com/ombucha/python-oeis
- Owner: Ombucha
- License: mit
- Created: 2022-05-20T07:06:29.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-06-19T04:24:52.000Z (10 months ago)
- Last Synced: 2026-03-14T09:11:44.369Z (about 1 month ago)
- Topics: database, math, oeis, python, sequences
- Language: Python
- Homepage: https://oeis.readthedocs.io
- Size: 1.97 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
.. image:: https://raw.githubusercontent.com/Ombucha/python-oeis/main/banner.png
.. image:: https://img.shields.io/pypi/v/python-oeis
:target: https://pypi.python.org/pypi/python-oeis
:alt: PyPI version
.. image:: https://static.pepy.tech/personalized-badge/python-oeis?period=total&left_text=downloads&left_color=grey&right_color=red
:target: https://pypi.python.org/pypi/python-oeis
:alt: PyPI downloads
.. image:: https://sloc.xyz/github/Ombucha/python-oeis?lower=True
:target: https://github.com/Ombucha/python-oeis/graphs/contributors
:alt: Lines of code
.. image:: https://img.shields.io/github/repo-size/Ombucha/python-oeis?color=yellow
:target: https://github.com/Ombucha/python-oeis
:alt: Repository size
About
-----
**python-oeis** is a Python library for exploring and retrieving integer sequences from the `Online Encyclopedia of Integer Sequences (OEIS) `_. Use it to search for sequences by keywords, fetch classic sequences like the Fibonacci numbers (A000045), primes (A000040), or your favorite obscure sequence, and access OEIS metadata programmatically.
Requirements
------------
- Python 3.8 or higher
- `requests `_
Installation
------------
Install the latest stable release from PyPI:
.. code-block:: sh
# Unix / macOS
python3 -m pip install "python-oeis"
# Windows
py -m pip install "python-oeis"
To install the development version from GitHub:
.. code-block:: sh
git clone https://github.com/Ombucha/python-oeis
cd python-oeis
pip install .
Usage Example
-------------
Query the OEIS for sequences, just like searching for A-numbers or keywords on the OEIS website:
.. code-block:: python
import oeis
# Search for sequences related to 'prime numbers'
results = oeis.search('prime numbers')
for seq in results[:3]:
print(seq.id, seq.name, seq.data[:10])
# Fetch the Fibonacci sequence (A000045)
fib = oeis.Sequence('A000045')
print(fib.name)
print(fib.data[:10]) # First 10 Fibonacci numbers
Links
-----
- `OEIS Main Site `_
- `Documentation `_
- `PyPI Project `_