Opinionated, testable Python wrappers for Slack’s Web, Admin, and SCIM APIs, organized by object domain (users, conversations, messages, files, workspaces, and IdP groups). Designed for automation and administration workflows.
Project description
slack-objects
A focused Python package for working with Slack objects commonly used in administration and automation workflows.
slack-objects provides opinionated, testable wrappers around the Slack Web API, Admin API, and SCIM API—favoring object-based access over raw endpoint calls.
Supported Slack Objects
The following Slack object types are supported:
- Users
- Conversations (e.g, channels)
- Messages
- Files
- Workspaces
- IDP Groups (SCIM - e.g., Okta groups)
Overview
slack-objects is designed for:
- Slack administration automation
- Identity and access management (IAM) workflows
- Internal tooling and bots
- Auditing and cleanup scripts
This package is not a replacement for slack_sdk.
Instead, it focuses on higher-level object operations that typically require:
- multiple API calls
- pagination
- rate limiting
- Admin API or SCIM usage
- non-trivial orchestration logic
Design Highlights
Factory-based API
All object helpers are created from a single entry point:
from slack_objects import SlackObjectsClient, SlackObjectsConfig
cfg = SlackObjectsConfig(
bot_token="xoxb-...",
user_token="xoxp-...",
scim_token="xoxp-...",
# see SlackObjectsConfig for additional options (scim_base_url, http_timeout_seconds, etc.)
)
slack = SlackObjectsClient(cfg)
users = slack.users() # unbound
alice = slack.users("U123") # bound to user_id
conversations = slack.conversations()
conversations = slack.conversations("C123") # bound to channel_id
files = slack.files("F123") # bound to file_id
msgs = slack.messages(channel_id="C123", ts="...") # bound to message
ws = slack.workspaces("T123") # bound to workspace_id
idp = slack.idp_groups("S123") # bound to group_id
This avoids global state while keeping usage concise and consistent.
Explicit token model
Slack APIs have different authorization requirements. This package keeps tokens explicit and separate:
| Token | Used for |
|---|---|
bot_token |
Slack Web API (most read/write operations) |
user_token |
Slack Admin API |
scim_token |
Slack SCIM API (IdP / provisioning) |
Tokens are optional in configuration, but required by methods that need them. Errors are raised at call time with clear messages.
Strict method boundaries
Each object follows a consistent internal structure:
public method
→ wrapper method
→ SlackApiCaller / SCIM request
Keyword-only APIs
Methods with multiple optional parameters use keyword-only arguments to avoid ambiguity and future breaking changes.
Testability
The codebase is designed to be tested without hitting Slack.
Installation
pip install slack-objects
Configuration
from slack_objects import SlackObjectsClient, SlackObjectsConfig, RateTier
cfg = SlackObjectsConfig(
bot_token="xoxb-...",
user_token="xoxp-...",
scim_token="xoxp-...",
default_rate_tier=RateTier.TIER_3, # fallback sleep between API calls when no specific tier matches
)
Testing
Run all smoke tests:
python -m tests.run_all_smoke
Notes
- SCIM v2 is the default; v1 is supported where applicable
PC_Utilsis an optional dependency (used for datetime handling inset_guest_expiration_date)- This package is intended for automation and administration workflows
resolve_user_idaccepts flexible identifiers (user ID, email, or @username) and verifies existence via Web API + SCIM fallbackis_user_authorizedsupports IdP-group-based authorization checks with configurable read/write access levels
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 slack_objects-0.0.6.tar.gz.
File metadata
- Download URL: slack_objects-0.0.6.tar.gz
- Upload date:
- Size: 70.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9437b1e7419f44b9e2c1e8619479c23c3eefb6609c9733020286a95ede669371
|
|
| MD5 |
45d9d654c481997a2d06d2077a7cfb91
|
|
| BLAKE2b-256 |
40f60d064ddff531575fc99df3c65976db530618c5e8a3e431cd24fca0b7da00
|
Provenance
The following attestation bundles were made for slack_objects-0.0.6.tar.gz:
Publisher:
publish-pypi.yml on mmercad0/slack-objects
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
slack_objects-0.0.6.tar.gz -
Subject digest:
9437b1e7419f44b9e2c1e8619479c23c3eefb6609c9733020286a95ede669371 - Sigstore transparency entry: 960978761
- Sigstore integration time:
-
Permalink:
mmercad0/slack-objects@a78830a74bdda87a4b6da7e051fdcc02e85e9bed -
Branch / Tag:
refs/tags/v0.0.6 - Owner: https://github.com/mmercad0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@a78830a74bdda87a4b6da7e051fdcc02e85e9bed -
Trigger Event:
release
-
Statement type:
File details
Details for the file slack_objects-0.0.6-py3-none-any.whl.
File metadata
- Download URL: slack_objects-0.0.6-py3-none-any.whl
- Upload date:
- Size: 33.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8e0b7ea9b81c6eba7c19285aff8c17ae51c2f7906c081944f1b501b935c3db2
|
|
| MD5 |
0cb2a66b9deb812fba0c99a01a4c0b90
|
|
| BLAKE2b-256 |
401df4c961ae07c9c739f39d96da851a535cc769a3c1c8ce220a1bfe031a5376
|
Provenance
The following attestation bundles were made for slack_objects-0.0.6-py3-none-any.whl:
Publisher:
publish-pypi.yml on mmercad0/slack-objects
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
slack_objects-0.0.6-py3-none-any.whl -
Subject digest:
a8e0b7ea9b81c6eba7c19285aff8c17ae51c2f7906c081944f1b501b935c3db2 - Sigstore transparency entry: 960978824
- Sigstore integration time:
-
Permalink:
mmercad0/slack-objects@a78830a74bdda87a4b6da7e051fdcc02e85e9bed -
Branch / Tag:
refs/tags/v0.0.6 - Owner: https://github.com/mmercad0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@a78830a74bdda87a4b6da7e051fdcc02e85e9bed -
Trigger Event:
release
-
Statement type: