Skip to main content

GB/T 7714-2025 参考文献格式转换工具

Project description

GB/T 7714-2025 参考文献格式转换工具

PyPI version Python versions License: MIT

一个符合中国国家标准 GB/T 7714-2025 的参考文献格式转换工具,支持 BibTeX 解析、DOI 查询、自动生成标准格式。

功能特性

  • ✅ 完整支持 GB/T 7714-2025 标准
  • ✅ 解析 BibTeX 格式文件
  • ✅ 通过 DOI 自动获取文献信息(使用 CrossRef API)
  • ✅ 支持多种文献类型:期刊、图书、会议、学位论文、报告、标准、专利、网页、数据集、预印本等
  • ✅ 自动格式化作者姓名(支持中英文)
  • ✅ 导出格式化后的参考文献列表

安装

pip install gb7714

快速开始

1. 解析 BibTeX 文件

from gb7714 import GB7714Converter

converter = GB7714Converter()

# 从文件加载
references = converter.load_bibtex_file("references.bib")

# 格式化输出
for line in converter.format_all():
    print(line)

2. 解析 BibTeX 字符串

from gb7714 import GB7714Converter

converter = GB7714Converter()

bibtex_text = """
@article{zhang2023ai,
    title = {人工智能在医疗诊断中的应用研究},
    author = {张三 and 李四 and 王五},
    journal = {中华医学杂志},
    year = {2023},
    volume = {103},
    number = {15},
    pages = {1234--1240},
    doi = {10.3760/cma.j.cn112137-20230101-00001}
}
"""

references = converter.load_bibtex_string(bibtex_text)
for line in converter.format_all():
    print(line)

3. 通过 DOI 查询

from gb7714 import GB7714Converter

converter = GB7714Converter()

# 单个 DOI
ref = converter.add_doi("10.1038/nature12373")

# 多个 DOI
refs = converter.add_dois([
    "10.1038/nature12373",
    "10.1126/science.1234567"
])

for line in converter.format_all():
    print(line)

4. 导出文件

from gb7714 import GB7714Converter

converter = GB7714Converter()
converter.load_bibtex_file("references.bib")
converter.export("output.txt")

命令行使用

# 解析 BibTeX 文件并输出
gb7714 references.bib

# 解析并导出到文件
gb7714 references.bib -o output.txt

# 通过 DOI 查询
gb7714 --doi 10.1007/978-3-032-27358-1_3

支持的文献类型

BibTeX 类型 GB/T 7714 类型 说明
article J 期刊文章
book M 图书
inproceedings C 会议论文
phdthesis / mastersthesis D 学位论文
techreport R 技术报告
standard S 标准
patent P 专利
online EB 网页
dataset DS 数据集
preprint PP 预印本

依赖

  • Python >= 3.8
  • 无外部依赖(仅使用标准库)

开发

# 克隆仓库
git clone https://github.com/wxd2zrx/gb7714.git
cd gb7714

# 安装开发依赖
pip install -e .

# 运行测试
python -m pytest

许可证

MIT License - 详见 LICENSE 文件

贡献

欢迎提交 Issue 和 Pull Request!

相关标准

  • GB/T 7714-2025 信息与文献 参考文献著录规则

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

gb7714-0.1.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

gb7714-0.1.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file gb7714-0.1.1.tar.gz.

File metadata

  • Download URL: gb7714-0.1.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for gb7714-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a7c9dd4e7d1df6795a10306178b25444f7eafcb5e319720e9a812649beb5422e
MD5 c4bf7a9c732b3a80210fa9d79c429ae7
BLAKE2b-256 0b5fa079ff70aa57b3d2a4cd077cc3b9fdef21b9cf240ccc127b2fea3a5f766b

See more details on using hashes here.

File details

Details for the file gb7714-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gb7714-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for gb7714-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 76bfe8f9c4e8d85de0e075c296f04f29d165ad3dd17c08cc34acbd93ea82b032
MD5 cbb532bd9350514849d91ac10141b9e3
BLAKE2b-256 b8915b14772558b70ee41f10a987953c4c507772bdbf6c327814042c659c5049

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