Skip to main content

Ce module permet de d'analyser les données d'LDAP à l'EPFL

Project description

epflldap

Installation

pip install dist/epflldap-<version>-py3-none-any.whl

Build new version

python setup.py bdist_wheel

Basic usages

1. Get and save locally the data of EPFL Ldap

import epflldap
data = epflldap.db()
data.to_pickle()

This will create locally a ldap_epfl.pickle file.

To load the local data:

import epflldap
data = epflldap.db(read_from_pickle=True)

2. Get users data only

import epflldap
users = epflldap.db(read_from_pickle=True).get_users()

You will get a Users object.

3. Filter users data

Filter by group

import epflldap
users = epflldap.db(read_from_pickle=True).get_users()
users_filtered = users.filter_by_group('webmasters')

You will get an other Users object with only the filtered data. Available groups are here: https://groups.epfl.ch/

Filter by status

import epflldap
users = epflldap.db(read_from_pickle=True).get_users()
users_filtered = users.filter_by_group('webmasters')

Les status possibles sont les suivants:

  • Personnel
  • Etudiant
  • Hôte
  • Hors EPFL

Certaines entrées dans Ldap n'ont pas de status.

Filter by unit

import epflldap
users = epflldap.db(read_from_pickle=True).get_users()
users_filtered = users.filter_by_unit('SISB')

Cette requête va retourner tous les collaborateurs du SISB avec y compris les assistants étudiants.

Filter by sciper

import epflldap
users = epflldap.db(read_from_pickle=True).get_users()
users_filtered = users.filter_by_sciper(['sciper1', 'sciper2'])

Cette requête permet de filtrer une liste d'utilisateurs en fonction d'une liste de scipers.

In order to get information about a specific user you can:

import epflldap
epflldap.db(read_from_pickle=True)
    .get_users()
    .filter_by_sciper(['sciper1'])
    .data[0]
    .get_info()

4. Get all the email addresses of a Users object

import epflldap
users = epflldap.db(read_from_pickle=True).get_users()
users_filtered = users.filter_by_group('webmasters')
users_filtered.get_emails()

You will get all the email addresses of the group 'webmaster'. If you want a txt file, you can add an argument:

users.get_emails(output='addresses.txt')

5. Get Excel file with personal information data

import epflldap
users = epflldap.db(read_from_pickle=True).get_users()
users_filtered = users.filter_by_group('webmasters')
users_filtered.to_excel(webmasters.xlsx)

This will create a xlsx file with personal information about the users.

Project details


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

epflldap-0.2.4-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

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