使用电子元件(如电阻器和电容器)的E系列首选数字
eseries的Python项目详细描述
E系列是一个与电子产品一起使用的首选数字系统 电阻器和电容器等元件。例如,e6 系列包含六个值(10、15、22、33、47、68),涵盖 数值的一个数量级范围(十年)从10到99。 这些基本价值再次重复,涵盖从100 至999,等于100、220、330、470和680。
这个eseries库对于从 标准E3、E6、E12、E24、E48、E96和E192几十年。
python接口
有关完整帮助:
>>> import eseries >>> help(eseries)
同时,这里有一些亮点。
要查找最接近319的E24值,请使用:
>>> from eseries import find_nearest, E24 >>> find_nearest(E24, 319) 330
在E96系列中查找下一个大于或等于184的值 使用:
>>> from eseries import find_greater_than_or_equal, E96 >>> find_greater_than_or_equal(E96, 184) 187
要查找指定值周围的一些值,请使用:
>>> from eseries import find_nearest_few, E24 >>> find_nearest_few(E24, 5000) (4700, 5100, 5600)
命令行界面
还有一个方便的命令行界面。运行eseries --help 查看命令列表:
$ eseries --help eseries Usage: eseries [options] <command> [<args> ...] Options: -h --help Show this screen. -v --verbose Use verbose logging Available commands: ge gt help le lower-tolerance-limit lt nearby nearest range series tolerance tolerance-limits upper-tolerance-limit See 'eseries help <command>' for help on specific commands.
要查找附近的值,请使用:
$ eseries nearest E24 37726 39e3
如果您喜欢si指数符号,请提供--symbol或-s:
$ eseries nearest E24 37726 -s 39 k
要显示给定值周围的值,请使用nearby命令:
$ eseries nearby E48 52e6 -s 48.7 M 51.1 M 53.6 M
要显示大于或等于给定值的最小值,请使用ge命令:
$ eseries ge E48 52e3 -s 53.6 k To show the upper and lower tolerance limits of a nominal value, use the ``tolerance-limits`` command:: $ eseries tolerance-limits E48 35 34.3 35.7 To show all values in an inclusive range, use the ``range`` command:: $ eseries range E6 74e-9 34e-6 --symbol 100 n 150 n 220 n 330 n 470 n 680 n 1 µ 1.5 µ 2.2 µ 3.3 µ 4.7 µ 6.8 µ 10 µ 15 µ 22 µ 33 µ