CSH LDAP ORM
Project description
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 group member uids
rtp = instance.get_group('rtp').get_member_uids()
# returns ['spaced', ...]
# get group member uids (other way)
rtp = instance.get_group_member_uids(groups=["rtp"])
# get uids of members in two (or more) groups and not in groups
fancy = instance.get_group_member_uids(groups=["rtp", "onfloor"], excluded=["eboard-opcomm"])
# get uuids of members in two (or more) groups and not in groups
# that's right! ipaUniqueId
fancy = instance.get_group_member_uuids(groups=["rtp", "onfloor"], excluded=["eboard-opcomm"])
# get other miscellaneous attributes of members in group
# look how rich drink admins are (admin abuse!!!)
admin_abuse = instance.get_group_member_attributes(group=["drink"], attributes=["uid", "drinkBalance"])
# returns dicts for each member
"""
I wonder what happened here
[
{
'uid': 'cole',
'drinkBalance': '996246'
},
{
'uid': 'zxcv',
'drinkBalance': '3847173'
}
]
"""
# 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)
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file csh_ldap-0.0.0.tar.gz.
File metadata
- Download URL: csh_ldap-0.0.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54525308cae3684b2951bebf06f9fc52ef5ad1ffcb78887a45465a84a4b6c0b0
|
|
| MD5 |
1f5e6abd8530089a66081906f1661d10
|
|
| BLAKE2b-256 |
aeb8cb16b3ddb9ae1849352fde9561f04f8a03bfb7590db06b65d2658c3ecfdd
|
Provenance
The following attestation bundles were made for csh_ldap-0.0.0.tar.gz:
Publisher:
pypi-release.yaml on ComputerScienceHouse/csh-ldap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
csh_ldap-0.0.0.tar.gz -
Subject digest:
54525308cae3684b2951bebf06f9fc52ef5ad1ffcb78887a45465a84a4b6c0b0 - Sigstore transparency entry: 2053799374
- Sigstore integration time:
-
Permalink:
ComputerScienceHouse/csh-ldap@408d94d8ce007f8d6ebf2b14edd2496562254826 -
Branch / Tag:
refs/tags/v.2.5.6 - Owner: https://github.com/ComputerScienceHouse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yaml@408d94d8ce007f8d6ebf2b14edd2496562254826 -
Trigger Event:
release
-
Statement type:
File details
Details for the file csh_ldap-0.0.0-py3-none-any.whl.
File metadata
- Download URL: csh_ldap-0.0.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a48b571afb207b0ace1a3650014185f62a317e5bd67b9c104079b0dd25b2bc3
|
|
| MD5 |
19652bd268ccbddce89dc635ed116d91
|
|
| BLAKE2b-256 |
18cddc340e1a064f551a1013f2d2f94521e7abd2952533b2aac301c0bf11fce2
|
Provenance
The following attestation bundles were made for csh_ldap-0.0.0-py3-none-any.whl:
Publisher:
pypi-release.yaml on ComputerScienceHouse/csh-ldap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
csh_ldap-0.0.0-py3-none-any.whl -
Subject digest:
4a48b571afb207b0ace1a3650014185f62a317e5bd67b9c104079b0dd25b2bc3 - Sigstore transparency entry: 2053799813
- Sigstore integration time:
-
Permalink:
ComputerScienceHouse/csh-ldap@408d94d8ce007f8d6ebf2b14edd2496562254826 -
Branch / Tag:
refs/tags/v.2.5.6 - Owner: https://github.com/ComputerScienceHouse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yaml@408d94d8ce007f8d6ebf2b14edd2496562254826 -
Trigger Event:
release
-
Statement type: