Tiny python package to parse the GECOS field.
Project description
ez-gecos (v0.2.1)
Tiny package to parse the GECOS field.
Version
ez-gecos is only tested on Python 3.7
Installation
Simply install using pip (or pipenv).
PyPi
pip install ez-gecos
Github
pip install git+https://github.com/thohell/ez-gecos.git
From source
git clone https://github.com/thohell/ez-gecos.git
pip install ./ez-gecos
Usage
from gecos import GECOS
# If username is not supplied, GECOS tries to parse the GECOS
# field of the username found in environment variable 'USER'
gecos = GECOS(username='someuser')
# or
gecos = GECOS()
# Full name from GECOS field or None.
print(gecos.full_name)
# Room from GECOS field or None.
print(gecos.room)
# Work phone from GECOS field or None.
print(gecos.work_phone)
# Home phone from GECOS field or None
print(gecos.home_phone)
# Other from GECOS field or None.
# If there are more than one other, they are returned
# as a comma separated list.
print(gecos.other)
# Full GECOS field or None
print(gecos.full)
# or
print(gecos)
# Returns email address from GECOS field or None.
# The email address is parsed from 'other', and
# returns first entry that looks like an email address.
print(gecos.email_address)
Links
License
ez-gecos: GPLv3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
ez_gecos-0.2.1-py3-none-any.whl
(17.3 kB
view details)
File details
Details for the file ez_gecos-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: ez_gecos-0.2.1-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8dfd2820e2749bd1aaf605822662535c3441b379e4c00830adce31e38b709cc |
|
MD5 | a6cb8fe1019863aa193504e4c4e97004 |
|
BLAKE2b-256 | 62b4d6b38e9643d1ba7f079ca5c6c43f14a1a5144ee2b75a820ba24b52570a81 |