Skip to main content

CLI tool that generates a Cutter-Sanborn identifier, given a first and a last name.

Project description

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 -> D649
  • csan -f John -l Doe -t "My Book" -> D649m
  • csan -f First -l Last -v -> L349, with log output to the console
  • csan -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

There are two relevant functions in csan package:

  • csan.cutter.cutter_number: return the integer part of the cutter call number
  • csan.cutter.cutter_call_number: return the 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()

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

csan-0.4.0.tar.gz (69.0 kB view details)

Uploaded Source

Built Distribution

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

csan-0.4.0-py3-none-any.whl (69.3 kB view details)

Uploaded Python 3

File details

Details for the file csan-0.4.0.tar.gz.

File metadata

  • Download URL: csan-0.4.0.tar.gz
  • Upload date:
  • Size: 69.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","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}

File hashes

Hashes for csan-0.4.0.tar.gz
Algorithm Hash digest
SHA256 edf7447ac6ca909ac75677ceeaa708acc52b9225eaf781704b9b5756a6771707
MD5 c3b9918fa8232f37080806d1492eb9d8
BLAKE2b-256 e64ab4b6b06820fa9944285360d7913bef8ad6a9bca06639562304c42f9bc5e6

See more details on using hashes here.

File details

Details for the file csan-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: csan-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 69.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","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}

File hashes

Hashes for csan-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b8a79476a880724e40d79149dd20490c83b8647c9fd7b89c7e6d59b4455514b
MD5 47708ce39fad3bc80da450d754625262
BLAKE2b-256 4a2a1d9f8b3827b4f579ae768930f1bdd7dc7b40155e05d5907e0efe9657cfa0

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