Tools and utilities for working with OEIS integer sequences
Project description
oeis-tools
oeis-tools is a Python package for working with the
Online Encyclopedia of Integer Sequences (OEIS).
It provides:
- OEIS ID validation
- URL and b-file helpers
- A
Sequenceclass for OEIS JSON entries - A
BFileclass for b-file numeric data
Installation
From PyPI:
pip install oeis-tools
From source:
git clone https://github.com/oeistools/oeis-tools.git
cd oeis-tools
pip install -e .
Development dependencies (tests):
pip install -e ".[dev]"
Quick Start
import oeis_tools
# Utilities
print(oeis_tools.check_id("A000001")) # True
print(oeis_tools.oeis_bfile("A000001")) # b000001.txt
print(oeis_tools.oeis_url("A000001", fmt="json")) # https://oeis.org/search?q=id:A000001&fmt=json
# Sequence API
seq = oeis_tools.Sequence("A000045")
print(seq.name) # Fibonacci numbers
print(seq.data) # comma-separated terms
print(seq.author) # list[str]
print(seq.json["id"]) # raw JSON field access
# B-file API
bfile = oeis_tools.BFile("A000045")
print(bfile.get_filename()) # b000045.txt
print(bfile.get_url()) # https://oeis.org/A000045/b000045.txt
print(bfile.get_bfile_data()[:5])
API Overview
check_id(oeis_id: str) -> booloeis_bfile(oeis_id: str) -> stroeis_url(oeis_id: str, fmt: str | None = None) -> strSequence(oeis_id: str)- Key attributes:
id,json,name,data,author,link,bfile
- Key attributes:
BFile(oeis_id: str)- Methods:
get_filename(),get_url(),get_bfile_data()
- Methods:
Running Tests
pytest -q
License
MIT. See LICENSE.
Author
Enrique Pérez Herrero - energycode.org@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oeis_tools-0.1.0.tar.gz.
File metadata
- Download URL: oeis_tools-0.1.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09e1fb36587b1d14acfe1bbb1cc78f65b5c34e6ca25b90ec72cc682ae332e782
|
|
| MD5 |
2d5da4d2217cad6248a572f9ab0accb2
|
|
| BLAKE2b-256 |
e0e333df6561ba89fc6495e42d12dfddba3cfb7002294168647344ce9e92e845
|
Provenance
The following attestation bundles were made for oeis_tools-0.1.0.tar.gz:
Publisher:
publish.yml on oeistools/oeis-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oeis_tools-0.1.0.tar.gz -
Subject digest:
09e1fb36587b1d14acfe1bbb1cc78f65b5c34e6ca25b90ec72cc682ae332e782 - Sigstore transparency entry: 958135048
- Sigstore integration time:
-
Permalink:
oeistools/oeis-tools@a5ac0ff50de0e7b50c0420371633cd85beafa3c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/oeistools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a5ac0ff50de0e7b50c0420371633cd85beafa3c3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file oeis_tools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: oeis_tools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
768d4308b461a13170b3e1aa9c11c4dcfac6a233efa1c6d5b383cab7db4d7645
|
|
| MD5 |
f402d8e10a4427b18ba41590db312de6
|
|
| BLAKE2b-256 |
d2864ac0d6946792e643cc42f94bd182c66f0551a3efdbaf43a8c9e83cbf9c73
|
Provenance
The following attestation bundles were made for oeis_tools-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on oeistools/oeis-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oeis_tools-0.1.0-py3-none-any.whl -
Subject digest:
768d4308b461a13170b3e1aa9c11c4dcfac6a233efa1c6d5b383cab7db4d7645 - Sigstore transparency entry: 958135091
- Sigstore integration time:
-
Permalink:
oeistools/oeis-tools@a5ac0ff50de0e7b50c0420371633cd85beafa3c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/oeistools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a5ac0ff50de0e7b50c0420371633cd85beafa3c3 -
Trigger Event:
workflow_dispatch
-
Statement type: