Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liam-middlebrook/csh_ldap
Python 3 ORM for CSH LDAP
https://github.com/liam-middlebrook/csh_ldap
csh ldap ldap-client python
Last synced: 17 days ago
JSON representation
Python 3 ORM for CSH LDAP
- Host: GitHub
- URL: https://github.com/liam-middlebrook/csh_ldap
- Owner: liam-middlebrook
- License: mit
- Created: 2016-09-22T23:15:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-05-30T20:51:12.000Z (over 2 years ago)
- Last Synced: 2024-12-07T20:45:39.470Z (about 1 month ago)
- Topics: csh, ldap, ldap-client, python
- Language: Python
- Size: 64.5 KB
- Stars: 2
- Watchers: 3
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
- License: LICENSE
Awesome Lists containing this project
README
# csh_ldap
[![PyPI version](https://badge.fury.io/py/csh_ldap.svg)](https://badge.fury.io/py/csh_ldap)
[![Build Status](https://travis-ci.org/liam-middlebrook/csh_ldap.svg?branch=master)](https://travis-ci.org/liam-middlebrook/csh_ldap)Python 3 ORM for CSH LDAP
## Installation
`pip install csh_ldap`
## Usage
```
import csh_ldap# Create an unbatched instance
instance = csh_ldap.CSHLDAP(bind_dn, bind_pw)# Create an batched instance
instance_batched = csh_ldap.CSHLDAP(bind_dn, bind_pw, batch_mods=True)# Create a Read-Only instance that will only echo your changes
instance_ro = csh_ldap.CSHLDAP(bind_dn, bind_pw, ro=True)# Get member by UUID
liam = instance.get_member(uuid_of_liam)# Get member by UID
liam = instance.get_member(uid_of_liam, uid=True)# Get member by iButton ID
liam = instance.get_member_ibutton(ibutton_id)# Get member by Slack UID
liam = instance.get_member_slackuid(slack_uid)# Get group by cn
rtp = instance.get_group('rtp')# Get cn of member
print(liam.cn)# Set cn of member
liam.cn = "Liam Middlebrook"# Setting attributes to None removes them
liam.roomNumber = None# Process batched writes per-dn
instance_batched.flush_mod()# Get EBoard Directorship
# Directorships: ['chairman', 'evaluations', 'financial', 'history', 'imps', 'opcomm', 'research', 'social']
social = instance.get_directorship_heads('social')for director in social:
# Directorships are always lists, since it can be multiple people.
print(director.cn)```