Skip to main content

Generate a Cutter-Sanborn call number. Can be used as CLI tool or Python library.

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

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 number
  • csan.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.

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.1.tar.gz (69.1 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.1-py3-none-any.whl (69.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: csan-0.4.1.tar.gz
  • Upload date:
  • Size: 69.1 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.1.tar.gz
Algorithm Hash digest
SHA256 b48589f4c75a510362437a240430ebe3ea4e9bc7b6e86691e6725de977afcd3d
MD5 8352dd05fc605a1dbab8251e752dc4d9
BLAKE2b-256 bd69f31ff1a699166999261fccedce7a15a43d14ea35ef3e80e7c49a38d8bff8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csan-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 69.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 50e626bf8573528ba13b7b496d3c7c3c1b2d92c4be1bbb601164d0d0d0cea2b8
MD5 c92de07440e77ed43ca57c0d8c459c40
BLAKE2b-256 bed1a1223c32061cb5abc6bc82e167955eb140b0be396bfc268ab6dc18ac1cca

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