圣经参考CLI应用程序
pybible-cli的Python项目详细描述
Pybible cli-圣经参考
pybible cli是参考圣经书籍、章节和经文的基本模块。使用命令行,可以引用King James Bible。在
安装
您可以从PyPI安装pybible cli:pip install pybible-cli
此模块至少需要Python版本3。在
如何使用
pybible cli是一个命令行应用程序,名为pybible
。要引用(在终端上打印)经文、章节、书籍甚至整本圣经,只需调用命令:
$ pybible
In the beginning God created the heaven and the earth.
...
The grace of our Lord Jesus Christ be with you all. Amen.
可以参考上面的整本圣经或只是其中的一部分,例如:
参考旧约:
^{pr2}$参考新约:
$ pybible -nt
The book of the generation of Jesus Christ, the son of David, the son of Abraham.
...
The grace of our Lord Jesus Christ be with you all. Amen.
参考约翰的书:
$ pybible --book john
In the beginning was the Word, and the Word was with God, and the Word was God.
...
And there are also many other things which Jesus did, the which, if they should be written every one, I suppose that even the world itself could not contain the books that should be written. Amen.
参考约翰书第三章:
$ pybible --chapter john 3
There was a man of the Pharisees, named Nicodemus, a ruler of the Jews:
...
He that believeth on the Son hath everlasting life: and he that believeth not the Son shall not see life; but the wrath of God abideth on him.
参考约翰书第三章第四节:
$ pybible --verse john 3 4
Nicodemus saith unto him, How can a man be born when he is old? can he enter the second time into his mother's womb, and be born?
获取一个带有--qotd
参数的随机韵文:
$ pybible --qotd
"And the house which I build is great: for great is our God above all gods." - 2 Chronicles 2:5 (King James Bible)
可以添加参数以包括输出上的引用(-r
,--reference
),并计算被引用内容的大小(-s
,--size
)。在
如需帮助,请执行:
$ pybible -h
usage: pybible [-h] [--bible BIBLE]
[-ot | -nt | --qotd | --book BOOK_NAME | --chapter BOOK_NAME CHAPTER_NUMBER | --verse BOOK_NAME CHAPTER_NUMBER VERSE_NUMBER]
[-r] [-s]
Bible reference
optional arguments:
-h, --help show this help message and exit
--bible BIBLE Bible version to use
-ot, --old_testament Reference the old testament
-nt, --new_testament Reference the new testament
--qotd Quote a single, random verse
--book BOOK_NAME Reference book
--chapter BOOK_NAME CHAPTER_NUMBER
Reference book and chapter
--verse BOOK_NAME CHAPTER_NUMBER VERSE_NUMBER
Reference book, chapter and verse
-r, --reference Include book, chapter number and verse reference
-s, --size Size of bible, book, chapter or vere referenced
✞
您也可以在python代码中使用pybible-cli
来引用圣经,只需从pybible
包导入pybible_load
模块:
>>> from pybible import pybible_load
>>> bible = pybible_load.load()
>>> bible.name
'King James Bible'
贡献
如果您喜欢这个模块,可以随意贡献并使pybible-cli
模块成为python圣经参考模块(这就是目标)。在
此时只有一个圣经版本可用(King James版本),您可以帮助向该模块添加更多版本的圣经,只需遵循classes
包中的OOP结构并将其pickle到一个文件中。在
有些性能问题涉及取消拾取,您也可以帮助解决;)
请随时与我联系,寻求新的功能和想法。。。在
- 项目
标签: