{ "info": { "author": "Jiri Tyr", "author_email": "jiri.tyr@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: POSIX", "Programming Language :: Python :: 2 :: Only", "Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP" ], "description": "PBook\n =====\n \n LDAP phone book written in Python.\n \n \n Output examples\n ---------------\n \n Default search result:\n \n $ pbook john\n First name: John\n Last name: Doe\n E-mail: john.doe@example.com\n Telephone: +44123456789\n 123\n Title: Placeholder name\n City: London\n User name: jdoe\n \n Default search results using pattern search filter recognition:\n \n $ pbook 789\n First name: John\n Last name: Doe\n E-mail: john.doe@example.com\n Telephone: +44123456789\n 123\n Title: Placeholder name\n City: London\n User name: jdoe\n \n Default search result using LDAP field name decoration:\n \n $ pbook -d john\n givenName: John\n sn: Doe\n mail: john.doe@example.com\n telephoneNumber: +44123456789\n 123\n title: Placeholder name\n l: London\n uid: jdoe\n \n Search result using custom search filter:\n \n $ pbook -S 'title=place*'\n First name: John\n Last name: Doe\n E-mail: john.doe@example.com\n Telephone: +44123456789\n 123\n Title: Placeholder name\n City: London\n User name: jdoe\n \n Search result using the `name` search template:\n \n $ pbook -s name doe\n First name: John\n Last name: Doe\n E-mail: john.doe@example.com\n Telephone: +44123456789\n 123\n Title: Placeholder name\n City: London\n User name: jdoe\n \n Search result using the `multicolumn` template:\n \n $ pbook -t multicolumn john\n Last name | First name | E-mail | Telephone\n -----------+------------+--------------------------------+----------------------\n Doe | John | john.doe@example.com | +44123456789, 123\n \n \n Requirements\n ------------\n \n * Python 2.7\n * Python LDAP module (http://www.python-ldap.org)\n \n \n Installation\n ------------\n \n In order to install pbook, just download the code, make sure all dependencies\n are installed (see [Requirements](https://github.com/jtyr/pbook#requirements)\n above) and configure it:\n \n $ git clone https://github.com/jtyr/pbook.git\n $ cd pbook\n $ chmod +x ./pbook\n $ # edit the pbook.conf file\n $ ./pbook -c ./pbook.conf john\n \n Or it's possible to use the Python setup script:\n \n $ git clone https://github.com/jtyr/pbook.git\n $ cd pbook\n $ python ./setup.py install\n $ # edit the /etc/pbook.conf file\n $ pbook john\n \n \n Configuration\n -------------\n \n Look at the `pbook.conf` for a full configuration example. The configuration\n can be defined globally (`/etc/pbook.conf`), per user (`~/.pbook`) or specified\n by an option on the command line (`pbook -c /path/to/pbook.conf john`). The\n configuration file is composed of the following 6 sections:\n \n \n **connection**\n \n In this section we configure the LDAP server connection. Server name, port and\n connection protocol is determined from the `uri` parameter. Password can be\n either defined in clear text or, if the value is set to `-1`, the user will be\n prompted. The recommended approach is to configure `ldapsearch` correctly\n first, and then re-use the parameters in this section. Example of the\n `ldapsearch` command:\n \n $ ldapsearch -H ldaps://ldap.example.com -D uid=jdoe,ou=Users,dc=example,dc=com -b ou=Users,dc=example,dc=com -W uid=jdoe\n \n From this command the configuration would be:\n \n [connection]\n uri=ldaps://ldap.example.com:636\n base_dn=ou=Users,dc=example,dc=com\n bind_dn=uid=jdoe,ou=Users,dc=example,dc=com\n password=-1\n \n \n **search_template**\n \n In this section we configure the LDAP search filter. The default search filter\n is defined by `_default` (e.g. `_default=nane`) or by the command line option\n `-s` (e.g. `pbook -s name john`). Example of search template definition:\n \n [search_template]\n _default=name\n name=(|(givenName=*%s*)(sn=*%s*))\n \n It's also possible to specify a custom search filter on the command line with\n the option `-S` (e.g. `pbook -S 'uid=%s' jdoe` or `pbook -S 'uid=jdoe'`).\n \n \n **search_pattern**\n \n On top of the default search filter, there is also pattern search filter\n recognition. This allows the configuration of a specific search filter based on\n a specified search string. For example, if all telephone numbers in the company\n have the same format except for the last 3 digits, we can define a pattern\n which will search the telephone number if the search string is a 3-digit\n number:\n \n [search_pattern]\n (\\d{3})=(telephoneNumber=+44123456\\1)\n \n Then we can search for a phone number `+44123456789` by executing `pbook 789`.\n \n \n **label**\n \n This section provides translation of the LDAP fields into a human readable\n format, which is then used in the `pbook` output. For example `givenName=First\n name` translates the `givenName` field to `First name` label. It's mandatory\n to have a label for every field used in the template (read more bellow).\n Example of label definition:\n \n [label]\n givenName=First name\n sn=Last name\n telephoneNumber=Telephone\n \n \n **template**\n \n The default template is specified by the `_default` parameter (e.g.\n `_default=basic`) or by the command line option `-t` (e.g. `pbook -t basic\n john`). Templates can be defined in two forms. The first of which is a simple\n list of LDAP fields which will be translated into a line-separated list of\n labels and values. For example the following template:\n \n [template]\n _default=basic\n basic=(givenName,sn)\n \n generates the following output:\n \n First name: John\n Last name: Doe\n \n The second form is using the `printf` string format. For example the following\n template:\n \n multicolumn=%(givenName)10.10s | %(sm)10.10s\n \n generates the following output:\n \n John | Doe\n \n It is possible to specify a header for the output by a parameter named the same\n the template itself appended with `_header`. The header can refer to labels by\n the label name prefixed with two underscores. The header for the above example\n could look like this:\n \n multicolumn_header=%(__givenName)10.10s | %(__sn)10.10s\\n-----------+-----------\n \n and the output would then look like this:\n \n First name | Last name\n -----------+-----------\n John | Doe\n \n \n **output**\n \n This section is optional and may contain definition of replacements for LDAP\n values. In other words, it allows the manipulation of values coming from the\n LDAP search by using a regular expression. For example, if we want to display\n only last three digits of the `telephoneNumber`, we would define the following\n output replacement:\n \n [output]\n telephoneNumber=.*(\\d{3})$;\\1\n \n \n License\n -------\n \n This software is licensed by the MIT License which can be found in the file\n [LICENSE](http://github.com/jtyr/pbook/blob/master/LICENSE).", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jtyr/pbook", "keywords": "phonebook ldap", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pbook", "package_url": "https://pypi.org/project/pbook/", "platform": "any", "project_url": "https://pypi.org/project/pbook/", "project_urls": { "Homepage": "http://github.com/jtyr/pbook" }, "release_url": "https://pypi.org/project/pbook/1.0/", "requires_dist": null, "requires_python": null, "summary": "LDAP phonebook written in Python", "version": "1.0" }, "last_serial": 1372574, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "c84ec711ec9ca09b016c9fc62eb57f0c", "sha256": "9f275405012cdf50c9ca99a2984ebc2c8931bc545ef2aa99694eb40b8e969b8b" }, "downloads": -1, "filename": "pbook-1.0.tar.gz", "has_sig": false, "md5_digest": "c84ec711ec9ca09b016c9fc62eb57f0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7316, "upload_time": "2015-01-06T12:16:17", "url": "https://files.pythonhosted.org/packages/dd/a4/d38d0db6ed59e129f286269e1dad1e064e92fffad17e4b9edf7623639a8c/pbook-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c84ec711ec9ca09b016c9fc62eb57f0c", "sha256": "9f275405012cdf50c9ca99a2984ebc2c8931bc545ef2aa99694eb40b8e969b8b" }, "downloads": -1, "filename": "pbook-1.0.tar.gz", "has_sig": false, "md5_digest": "c84ec711ec9ca09b016c9fc62eb57f0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7316, "upload_time": "2015-01-06T12:16:17", "url": "https://files.pythonhosted.org/packages/dd/a4/d38d0db6ed59e129f286269e1dad1e064e92fffad17e4b9edf7623639a8c/pbook-1.0.tar.gz" } ] }