Skip to main content

padc

cli using python-ldap lib to create connections with Active Directory this project use poetry

Setup for development

create virtual environment

python -m venv .venv

activate environment

poetry shell 

install padc

poetry install

Create .env file inside root directory to establish a ldap connection

.env

URI='ldap://192.168.0.213'
BIND_DN='administrator@rts.local'
AUTH_PASS='Mypasswd@123'
CA_PATH='' 
BASE_DN='DC=RTS,DC=LOCAL'

padc has logging_settings.ini inside padc/config

[loggers]
keys = root

[handlers]
keys = FileHandler,StreamHandler

[formatters]
keys = simpleFormatter

[logger_root]
level = DEBUG
handlers = FileHandler,StreamHandler

[handler_FileHandler]
class     = FileHandler
formatter = simpleFormatter
args      = ('padc.log', 'a')

[handler_StreamHandler]
class     = StreamHandler
formatter = simpleFormatter
args      = (sys.stdout,)

[formatter_simpleFormatter]
format = %(asctime)s:%(levelname)s: %(message)s

Install padc from pypi

pip install padc

You can modify where log file will be created by editing logging_settings.ini the default file is created at current directory with name 'padc.log'

Running

cli written in Typer to manipulate operations in AD

padc --help

users is the main subcommand, every subcommand has a helper option

pacd users --help

padc has in users subcommand some basic operations if one of the supported operations run with --debug option when errors occurs the traceback and exception will be raised.

exp:

padc users create -f .env "Pingu pythonico" "Pingupassword@123" -c 514 --debug
padc users create-ldif -f .env --ldif example.ldif
padc users add-to-group --file .env "Pingu" "CN=testgroup,CN=Users,DC=RTS,DC=LOCAL" --debug
padc users remove-from-group --file .env "Pingu" "CN=testgroup,CN=Users,DC=RTS,DC=LOCAL"
padc users delete --file .env "Pingu pythonico"
padc users enable -f .env "Pingu" --debug
padc users disable "Pingu" --debug

Testing

Simple Unittest to create/delete/modify user account in AD

python -m unittest -v tests.test_msad

Building

poetry build

Metadata

Release files for padc 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for padc 1.0
File Size Uploaded Provenance Actions
padc-1.0.tar.gz 9.8 kB Without provenance Details for padc-1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for padc 1.0
File Interpreter ABI Platform Actions
padc-1.0-py3-none-any.whl Python 3 none any Details for padc-1.0-py3-none-any.whl

Total release size: 22.3 kB

Release files / padc-1.0.tar.gz

Download URL padc-1.0.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f3472f8b01247e4b1032c0e66eb1b46b9c2cb61627a13a1d951361b7af49e7f3
BLAKE2b-256 checksum
How to use checksums
a7c1e2d8ddabe77f353c618a223937554772b637a046e673090125461d4129e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.9 Linux/6.1.12-arch1-1

Release files / padc-1.0-py3-none-any.whl

Download URL padc-1.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5eda633ee88e69879cab7c0a5d03cf054b31252f4a4a0b9c54b3af0a46886716
BLAKE2b-256 checksum
How to use checksums
34a6c9fe9229bbb1e8ec8de42240f86d922c790c26ad5e430ea8daf0faa2b80c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.9 Linux/6.1.12-arch1-1

Security for padc 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page