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.0.tar.gz (9.2 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.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gb7714-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 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.0.tar.gz
Algorithm Hash digest
SHA256 a86d080b54f7f6f9a738448b826ca3ae9e5e40ba83f162c991918f086d24d09e
MD5 4270c4287e23b70d55d4e752f75e9e4a
BLAKE2b-256 4d5cb32fc9ec442a208b29a45dc173b53c41c2a29a901c821b8e514e6ce75b1f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gb7714-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7b473090995f4f668a42cabe6281b6b9878730b4d4d4f1839b09dba36e4ea65
MD5 7bfecac5b8367d25655d1f41d3d4a0a6
BLAKE2b-256 c5e0d8d91ee9065d0c2b852f368e187e910c69784383ff612d69c1bb42735ac8

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