Skip to main content

PyLahman

pylahman is a Python package for accessing the Lahman Baseball Database via pandas.

The data used in this package is provided by SABR and is licensed under CC BY-SA 3.0. The data was last updated based on the source data available from https://sabr.org/lahman-database/ on 2026-01-08.

The surrounding software is licensed under the MIT License.

Installation

The pylahman package is available on PyPI and can be installed via pip.

pip install pylahman

Documentation and Usage

Each table in the Lahman Baseball Database has a corresponding data loading function in pylahman with the same name. For example, the Pitching table is accessed via the Pitching() function. Descriptions of each data table can be found in the documentation for the corresponding data loading function in the API Reference.

import pylahman

Pitching = pylahman.Pitching()
print(Pitching.head())
    playerID  yearID  stint teamID lgID  W  L   G  GS  CG  ...  IBB  WP  HBP  \
0  aardsda01    2004      1    SFN   NL  1  0  11   0   0  ...    0   0    2   
1  aardsda01    2006      1    CHN   NL  3  0  45   0   0  ...    0   1    1   
2  aardsda01    2007      1    CHA   AL  2  1  25   0   0  ...    3   2    1   
3  aardsda01    2008      1    BOS   AL  4  2  47   0   0  ...    2   3    5   
4  aardsda01    2009      1    SEA   AL  3  6  73   0   0  ...    3   2    0   

   BK  BFP  GF   R  SH  SF  GIDP  
0   0   61   5   8   0   1     1  
1   0  225   9  25   1   3     2  
2   0  151   7  24   2   1     1  
3   0  228   7  32   3   2     4  
4   0  296  53  23   2   1     2  

[5 rows x 30 columns]

Metadata

Release files for pylahman 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylahman 0.7.0
File Size Uploaded
pylahman-0.7.0.tar.gz 8.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pylahman 0.7.0
File Interpreter ABI Platform
pylahman-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 MB

Release files / pylahman-0.7.0.tar.gz

Download URL pylahman-0.7.0.tar.gz
Size 8.3 MB
Tags Source
SHA-256 checksum
How to use checksums
a910ca3e3982876347bf093854393c90dc924635a810b3b2a87fc9f5c4660090
BLAKE2b-256 checksum
How to use checksums
46c4247e4c506c18ada591ee85905a2ab6bee994b1ddf311be283e657cc29e4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / pylahman-0.7.0-py3-none-any.whl

Download URL pylahman-0.7.0-py3-none-any.whl
Size 8.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a20f97a76d6414dbdf58d4e40f1d9e80dcef6f27eb0be913198f4c29778269d4
BLAKE2b-256 checksum
How to use checksums
6a7c079c043375e5582b78b6b52239a298f413f9794efd37a8e5f235070f19e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.2

2 release files

0.4.0

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page