CSAN: Cutter-Sanborn Call Number Generator
csan generates a Cutter-Sanborn call number, given a last name and an optional first name. It can be used as a CLI tool or as a Python library.
The Cutter-Sanborn call number, commonly called "Cutter number", is an alphanumeric code that forms part of the call number in library classification systems in order to arrange books alphabetically by author. It consists of the first letter of the author's last name followed by three-digit number derived from a predefined table. This system was originally developed by Charles Cutter, and revised by Kate Sanborn and Swanson-Swift.
Installation
You can install this tool using uv or pip:
uv tool install csan
pip install csan
CLI Usage
usage: csan [-h] [-f FIRST_NAME] -l LAST_NAME [-t TITLE] [-v]
Cutter-Sanborn identifier generator.
options:
-h, --help show this help message and exit
-f, --first-name FIRST_NAME
-l, --last-name LAST_NAME
-t, --title TITLE
-v, --verbose
For instance:
Examples
csan -f John -l Doe-> D649csan -f John -l Doe -t "My Book"-> D649mcsan -f First -l Last -v-> L349, with log output to the consolecsan -f Jorge -l "De la Cruz"-> D332
The following table shows expected Cutter call numbers for their respective names, using CLI:
| First Name | Last Name | Cutter Call Number |
|---|---|---|
| Jane | Austen | A933 |
| Eric | Blair | B635 |
| Agatha | Christie | C555 |
| Samuel | Clemens | C625 |
| Jorge | De la Cruz | D332 |
| Charles | Dickens | D548 |
| Emily | Dickinson | D553 |
| Fyodor | Dostoyevsky | D724 |
| Stephen | King | K52 |
| VERA | LVX | L979 |
| Herman | Melville | M531 |
| George | Orwell | O79 |
| William | Shakespeare | S527 |
| Lord | Sith | S622 |
| Ivan | Smith | S649 |
| William | Smith | S664 |
| Leo | Tolstoy | T654 |
| Mark | Twain | T969 |
| Virginia | Woolf | W913 |
| Emile | Zola | Z86 |
Library Usage
Add package to virtual environment:
uv add csan
There are two relevant functions in csan package:
csan.cutter.cutter_number: return the integer part of the Cutter call numbercsan.cutter.cutter_call_number: return the Cutter call number
Also, the entire Cutter-Sanborn table can be retrieved as a Python dict:
csan.table.CUTTER_TABLE
Example
from csan.cutter import cutter_call_number, cutter_number
from csan.table import CUTTER_TABLE
def main():
print(CUTTER_TABLE)
cutter_num = cutter_number("First", "Last")
cutter_call_num = cutter_call_number("Last", cutter_num)
print(cutter_num)
print(cutter_call_num)
if __name__ == "__main__":
main()
License
This project is released under the Apache-2.0 license.
Metadata
Release files for csan 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| csan-0.4.2.tar.gz | 69.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| csan-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 138.8 kB
Release files / csan-0.4.2.tar.gz
| Download URL | csan-0.4.2.tar.gz |
|---|---|
| Size | 69.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea7727398b86aca0718ad2c5686f0f60fd190641b35d91a675992f6582e6cbfb
|
|
BLAKE2b-256 checksum How to use checksums |
d63e8c4df731c3fd9c9ea928febb89a865c58e4211af7f98ebabf98cf5795b98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / csan-0.4.2-py3-none-any.whl
| Download URL | csan-0.4.2-py3-none-any.whl |
|---|---|
| Size | 69.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e57a5bd159d35ff197f57f3c7ab3a65a496add22fa3691cbb5f0d3d050dd4ce
|
|
BLAKE2b-256 checksum How to use checksums |
29c7c5dfeaeba1efc0e86ae43114a80388458f7cb224b9989147470e6ae2192e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|