Skip to main content

A Python 3 framework for constructing, managing and organising email addresses in YAML format.

Project description

pipeline status coverage analysis

PyPI Version

A Python 3 utility for constructing, managing and organising email addresses in YAML format.

1 Installation

The simplest way to install is using pip

pip install contactList

2 Getting Started

The structure of YAML file is very simple. Organise email addresses into arbitrarily named groups and then organise those groups into arbitrarily named “clusters”.

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' ]

There is no requirement restricting an email address to only one group.

3 contact-list utility

Once the wheel package is installed the command line utility contact-list is available. This utility can be used to manage contact list data in a YAML file from the command line.

> 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)

Subcommands enable the modification of the respective entities in the file, cluster, email, group.

4 Using the framework

Using the contactList framework, your application can then use the clusters to build a list of the necessary emails. By default, the from_yamlFile classmethod tries to load YAML from contacts.yml in the current directory, otherwise the user specifies the file name to use.

from contactList import Contacts

myContacts = Contacts.from_yamlFile()

# A list of the groups loaded from YAML
assert isinstance( myContacts.groups, list )
# A list of the clusters loaded from YAML
assert isinstance( 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' )

assert isinstance( emailList, set )

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

contactList-0.1.0.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

contactList-0.1.0-py3-none-any.whl (216.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: contactList-0.1.0.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.20.0

File hashes

Hashes for contactList-0.1.0.tar.gz
Algorithm Hash digest
SHA256 797ad64a9888cb363cd98aace151d79dd46b9c1dc440f08018e93805a866ed4a
MD5 0cbe36afb060f280c3c2b4f7211d5dae
BLAKE2b-256 f07b35ebe044c393f04fc63f646f9ae1c65eef315fcae4faf3665f50b74d05e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: contactList-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 216.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.20.0

File hashes

Hashes for contactList-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a57b86846343ae08d80634ac01e3eac749c89a3252363e9c7549e0a54389f6d
MD5 83bfe3c5c1a72537e429b5383c90a936
BLAKE2b-256 24845a969f9de8e5bb1f7034ab8736d07b3a373b61bcba3427572d08ee7c2f49

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page