{"id":27993258,"url":"https://github.com/xwmx/lcclasses","last_synced_at":"2026-03-15T05:16:26.754Z","repository":{"id":822868,"uuid":"536664","full_name":"xwmx/lcclasses","owner":"xwmx","description":"Ruby gem for listing and manipulating Library of Congress Classification classes and subclasses","archived":false,"fork":false,"pushed_at":"2021-11-14T02:50:46.000Z","size":52,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-03T18:03:09.625Z","etag":null,"topics":["classification","congress-classification","ruby","rubygems"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xwmx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-02-26T01:39:01.000Z","updated_at":"2021-11-14T02:50:10.000Z","dependencies_parsed_at":"2022-07-15T03:46:49.639Z","dependency_job_id":null,"html_url":"https://github.com/xwmx/lcclasses","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwmx%2Flcclasses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwmx%2Flcclasses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwmx%2Flcclasses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwmx%2Flcclasses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xwmx","download_url":"https://codeload.github.com/xwmx/lcclasses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253133115,"owners_count":21859108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","congress-classification","ruby","rubygems"],"created_at":"2025-05-08T18:48:29.791Z","updated_at":"2026-03-15T05:16:21.734Z","avatar_url":"https://github.com/xwmx.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LCCLasses\n\n[![Build Status](https://travis-ci.org/xwmx/lcclasses.svg?branch=master)](https://travis-ci.org/xwmx/lcclasses)\n\nA Ruby gem that provides the\n[Library of Congress Classification](https://www.loc.gov/catdir/cpso/lcc.html)\nsystem main classes and subclasses along with some convenience methods.\n\n## Installation\n\nLCCLasses is available on [RubyGems](https://rubygems.org/gems/lcclasses):\n\n```bash\ngem install lcclasses\n```\n\nTo install with [Bundler](https://bundler.io/), add the following to your\nGemfile:\n\n```ruby\ngem 'lcclasses'\n```\n\nThen run `bundle install`\n\n## Usage\n\nTo find a classification code:\n\n```ruby\nLCClasses.find_main_class_by_code(\"T\")\n=\u003e [\"T\", \"Technology (General)\"]\nLCClasses.find_subclass_by_code(\"AM\")\n=\u003e [\"AM\", \"Museums. Collectors and collecting\"]\nLCClasses.find_all_by_code(\"E\")\n=\u003e # returns the main \"E\" class and all subclasses in nested array\nLCClasses.main_classes\n=\u003e # returns all main classes\nLCClasses.subclasses\n=\u003e # returns all subclasses\n```\n\nThe entire set of classes can be retrieved in 3 formats:\n\n```ruby\nLCClasses::CLASS_HASH\n=\u003e # nested hash of classes and subclasses\nLCClasses.nested\n=\u003e # nested array of classes and subclasses as LCClasses::LCClass objects\nLCClasses.flat\n=\u003e # flat array of classes and subclasses as LCClasses::LCClass objects\n```\n\nThe `CLASS_HASH` constant is in the following format (truncated example):\n\n```ruby\n{ \"A\" =\u003e {\n    :name =\u003e \"General Works\",\n    :subclasses =\u003e {\n      \"AC\" =\u003e { :name =\u003e \"Collections; Series; Collected works\" }\n    }\n  }\n}\n```\n\nClasses are returned as specialized LCClasses::Class arrays in the format\n`[code, name]`. In the case of nested LCClasses:LCClass objects, they are in\nthe format\n`[main_class_code, main_class_name, [[subclass_code, subclass_name]]]`.\nThese objects are normal arrays with the following methods added:\n\n```ruby\n@class = LCClasses.find_main_class_by_code(\"M\")\n@class.code\n=\u003e \"M\"\n@class.name\n=\u003e \"Music\"\n@class.subclasses\n=\u003e [[\"M\", \"Music\"], [\"ML\", \"Literature on music\"], [\"MT\", \"Instruction and study\"]]\n```\n\n## Note on Patches/Pull Requests\n\n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so I don't break it in a\n  future version unintentionally.\n* Commit, do not mess with rakefile, version, or history.\n  (if you want to have your own version, that is fine but\n   bump version in a commit by itself I can ignore when I pull)\n* Send me a pull request. Bonus points for topic branches.\n\n## Copyright\n\nCopyright (c) 2010 William Melody. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwmx%2Flcclasses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxwmx%2Flcclasses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwmx%2Flcclasses/lists"}