python 3框架,用于以yaml格式构建、管理和组织电子邮件地址。

contactList的Python项目详细描述


pipeline statuscoverage analysis

PyPI Version

python 3实用程序,用于以yaml格式构造、管理和组织电子邮件地址。

1   Installation

最简单的安装方法是使用pip

pip install contactList

2   Getting Started

yaml文件的结构非常简单。将电子邮件地址组织成任意命名的组,然后组织 这些组被任意命名为“集群”。

groups:g1:-'u1@some.domain'g2:-'u3@some.other.domain'g3:-'u4@this.domain'-'u2@some.domain'clusters:c1:['g1']c2:['g1','g2']c3:['g2','g3']

没有要求将电子邮件地址仅限于一个组。

3   ^{tt1}$ utility

一旦安装了wheel包,就可以使用命令行实用程序contact-list。此实用程序可用于 从命令行管理yaml文件中的联系人列表数据。

> contact-list --help
usage: contact-list [-h][--file CONTACTSFILE]{cluster,email,group} ...

positional arguments:
  {cluster,email,group}

optional arguments:
  -h, --help            show this help message and exit
  --file CONTACTSFILE, -f CONTACTSFILE
                        Contacts file to manage (default contacts.yml)

子命令允许修改文件中的各个实体,clusteremailgroup

4   Using the framework

使用contactList框架,您的应用程序可以使用集群来构建必要电子邮件的列表。由 默认情况下,from_yamlFileclassmethod尝试从当前目录中的contacts.yml加载yaml,否则 用户指定要使用的文件名。

fromcontactListimportContactsmyContacts=Contacts.from_yamlFile()# A list of the groups loaded from YAMLassertisinstance(myContacts.groups,list)# A list of the clusters loaded from YAMLassertisinstance(myContacts.clusters,list)# Check that the groups and clusters are correctly specified.myContacts.validate()# Generate a Python set of email addresses for the chosen cluster.emailList=myContacts.emails('c2')assertisinstance(emailList,set)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java将Map<String,String>传递给需要Map<String,Object>   java在循环中使用字符串而不是StringBuilder是否会造成内存损失?   jnlp如何更新java控制台JRE?   java更改、修改和重新打包CXFAPI源文件   JavaFXJava应用程序在Fedora上运行一段时间后关闭   使用来自不同类的方法的java   java如何通过ant脚本在linux中使用subst?   java在使用camunda modeler进行base64编码/解码时出错   获取java。netbeans、weblogic和fastswap设置为true时的lang.NoSuchMethodError   java如何提高FinalizerThread在GC中收集对象的优先级   java检测具有相同根的单词   netbeans crud应用程序中的java错误