Skip to main content

Easy to get classification data from Chinese library classification

Project description

Chinese-library-classification

一个好用的中文图书分类数据获取工具!!!Please read this in English.

介绍


这是一个获取中文图书分类数据的python包!《中国图书馆分类法》是我国建国后编制出版的一部具有代表性的大型综合性分类法,简称《中图法》。它是我国图书馆,信息文献机构使用最广泛的分类法体系,目前已经编制到第五版。我在硕士期间做过许多涉及到中图分类数据的项目,发现目前的结构化中图分类数据比较难获得,用来做一些任务比较不方便。于是想写这样一个python包,可以直接检索中图分类数据,也能获取其各级分类数据,优化一下类似工作流程。

数据源


中图分类官网给出的电子版链接也比较难用,由于想要获取的是结构化的中图分类数据,所以只能从目前的一些中图分类号检索网站进行数据爬取。本python包用到的中图分类数据由两个网站爬取并最终综合得来: 网站1 网站2。爬取代码看项目CLC-data-crawl

安装


install via pip (from PyPI):

pip install chinese-library-classification

功能


由分类号获取其相关信息(其中两个link是两个数据爬取网站对应的此分类号页面)

>>> from chinese_library_classification import Chineselibraryclassification
>>> CLC = Chineselibraryclassification()
>>> print(CLC.num2info('A2'))

{"name":"列宁著作","level":2,"link1":"https://ztflh.xhma.com/html/17.html","link2":"https://www.clcindex.com/category/A2/","up_level":"A","next_level":['A21','A22','A23','A25','A26','A28']}


#由分类号获取其所在的上层所有类目

>>> print(CLC.num2upper('P455'))

[['P45','天气预报'],['P4','大气科学(气象学)'],['P','天文学、地球科学']]

#由分类号获取其所在的下一级所有分类
>>> print(CLC.num2next('U655'))

[('U655.1','施工技术管理'),('U655.2','施工组织与设计'),('U655.3','施工设备'),('U655.4','施工技术'),('U655.5','各种工程')]

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

chinese_library_classification-0.0.1.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file chinese_library_classification-0.0.1.tar.gz.

File metadata

File hashes

Hashes for chinese_library_classification-0.0.1.tar.gz
Algorithm Hash digest
SHA256 edcaaeb0c8a2271b3e53b3a5520ca4c1eaa8276f8d5d1a58934a93fa1389fced
MD5 f1039dfdd78250df978abe4f3d2aaeb1
BLAKE2b-256 f04d8849bcf1d12dd121f015f32a5d91985e31487ae7e44c79357ae33c706b32

See more details on using hashes here.

File details

Details for the file chinese_library_classification-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for chinese_library_classification-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c56287e65cf0da3bc298bf418431fabb44a5d6c40953eabaf719fe7f374956e4
MD5 bba2131eaf7ae09f284223b11243c7d7
BLAKE2b-256 dc2cc146b7ebd20c9663aebf97d88ae961863601f6a0185b2609b14de6db7e9c

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