Skip to main content

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 信息与文献 参考文献著录规则

Metadata

Release files for gb7714 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gb7714 0.1.1
File Size Uploaded Provenance Actions
gb7714-0.1.1.tar.gz 9.5 kB Without provenance Details for gb7714-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gb7714 0.1.1
File Interpreter ABI Platform Actions
gb7714-0.1.1-py3-none-any.whl Python 3 none any Details for gb7714-0.1.1-py3-none-any.whl

Total release size: 21.4 kB

Release files / gb7714-0.1.1.tar.gz

Download URL gb7714-0.1.1.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a7c9dd4e7d1df6795a10306178b25444f7eafcb5e319720e9a812649beb5422e
BLAKE2b-256 checksum
How to use checksums
0b5fa079ff70aa57b3d2a4cd077cc3b9fdef21b9cf240ccc127b2fea3a5f766b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / gb7714-0.1.1-py3-none-any.whl

Download URL gb7714-0.1.1-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76bfe8f9c4e8d85de0e075c296f04f29d165ad3dd17c08cc34acbd93ea82b032
BLAKE2b-256 checksum
How to use checksums
b8915b14772558b70ee41f10a987953c4c507772bdbf6c327814042c659c5049
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for gb7714 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page