Skip to main content

A basic API wrapper for OEIS.

Project description

https://raw.githubusercontent.com/Ombucha/python-oeis/main/banner.png PyPI version PyPI downloads Lines of code 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

Installation

Install the latest stable release from PyPI:

# Unix / macOS
python3 -m pip install "python-oeis"

# Windows
py -m pip install "python-oeis"

To install the development version from GitHub:

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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_oeis-1.1.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_oeis-1.1.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file python_oeis-1.1.1.tar.gz.

File metadata

  • Download URL: python_oeis-1.1.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for python_oeis-1.1.1.tar.gz
Algorithm Hash digest
SHA256 e27bf800a1da53ef7a54e186b3034d6e37db03ce77a1e333abcb61b8150bf6d7
MD5 98224e439b6d2d03548559c6c9ba6392
BLAKE2b-256 74112c6e24783a435230383ae0bbfda9ff1682a87a7d0c7fa0f35adb53da6ecf

See more details on using hashes here.

File details

Details for the file python_oeis-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: python_oeis-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for python_oeis-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 262486f6b42f8fbd0b10fe5a7a118fef4c4930d98c65bafb4dfa375060a01814
MD5 45e5d7f092a26ec6ad1805fa3ed471ff
BLAKE2b-256 68f8fcb2332fe0fad81f852d56e3e5389a6bc097af869a341d437136c106e497

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page