Browse TLG indices
Project description
About
This Python package facilitates the browsing of the indices of the old TLG CD-ROMs. It expects that texts have been processed by the tlgu package (tlgu homepage, rehosted code), which offers a variety of ways to convert the Beta Code of the original files into Unicode text files.
Install
Install from PyPI with:
pip install tlg-indices
Disclaimer
This repository makes no claim to ownership of the contents of the original TLG CD-ROM, which are owned by the University of California, Irvine. It is an independent effort to facilitate study of texts and does not represent or imply endorsement by the University of California, Irvine or the TLG project.
Usage overview
The main entry point is the utility functions in src/tlg_indices/utils.py, which expose prebuilt indices and convenience lookups. The quickest way to see how to call these helpers is in tlg_index_examples.py, which demonstrates:
- Reading index data (epithets, geographies, dates, and author/work mappings).
- Looking up authors by epithet or geography, and reversing those lookups.
- Looking up works by author and retrieving a single work title.
- Sorting and querying date ranges using
ParsedDateandget_dates_in_range().
For a runnable walkthrough, open tlg_index_examples.py and follow the patterns there.
Converting Beta Code with tlgu
If you have Beta Code files from the original TLG/PHI distributions, you can convert them using the tlgu wrapper in this package. See tlgu_examples.py for runnable examples of:
- Converting a single file into an author-level file (
grouping="author"). - Splitting a single file into work-level files (
grouping="work"). - Converting an entire corpus for either grouping.
Open tlgu_examples.py and adjust the file paths for your local setup.
Packaging
% uv build --no-sources
% uv publish --token "pypi-xxxxxxxxxxxxxxxx"
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 tlg_indices-1.2.2.tar.gz.
File metadata
- Download URL: tlg_indices-1.2.2.tar.gz
- Upload date:
- Size: 325.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7b28fc37685d95e85dcb07ecce1fd6c68b64332db96c15e32cd9dd1de1b4199
|
|
| MD5 |
ed6d99248d4ea21d06300d075be3be03
|
|
| BLAKE2b-256 |
0f871d876b59377ffc6f763eea81c1e6225c26fa36eb05c44ff463fd6a62157f
|
File details
Details for the file tlg_indices-1.2.2-py3-none-any.whl.
File metadata
- Download URL: tlg_indices-1.2.2-py3-none-any.whl
- Upload date:
- Size: 333.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27915d253567f4aed749e3fbd25fe4661aa86a8b3a241133c14058a73879326c
|
|
| MD5 |
96d0273894fc0f7a3b928b436ec262ec
|
|
| BLAKE2b-256 |
4798d1d17de3f96833dc30c0c0b60c78ddac67ac4b9984e082e5729ac943ebfa
|