Skip to main content

Minimal utilities for managing SyftBox file permissions

Project description

CI PyPI version PyPI downloads Python versions Code style: black License

SyftPerm

File permission management for SyftBox made simple.

SyftPerm provides intuitive Python APIs for managing SyftBox file permissions with powerful pattern matching, inheritance, and debugging capabilities.

📚 Complete Documentation

Installation

pip install syft-perm

Quick Start

import syft_perm as sp

# Open a file or folder
file = sp.open("my_data.txt")

# Grant permissions (higher levels include lower ones)
file.grant_read_access("reviewer@external.org")
file.grant_write_access("colleague@company.com")  # Gets read + write
file.grant_admin_access("boss@company.com")       # Gets everything

# Use patterns for multiple files
project = sp.open("my_project/")
project.grant_write_access("*.py", "dev@company.com")
project.grant_read_access("docs/**/*.md", "*")  # Public docs

# Debug permissions
print(file.explain_permissions("colleague@company.com"))

# Check access
if file.has_write_access("colleague@company.com"):
    print("Colleague can modify this file")

# Display beautiful permission tables in Jupyter notebooks
file._repr_html_()  # Shows permissions table with compliance info

Permission Hierarchy

  • Read - View file contents
  • Create - Read + create new files
  • Write - Read + Create + modify existing files
  • Admin - Read + Create + Write + manage permissions

Key Features

  • 🎯 Intuitive Permission Hierarchy - Higher permissions include all lower ones
  • 🌟 Powerful Pattern Matching - Use *.py, docs/**/*.md to control multiple files
  • 🔍 Nearest-Node Algorithm - Predictable inheritance from closest permission rules
  • 🐛 Built-in Debugging - Trace exactly why permissions work or don't work
  • 📁 Folder-Level Efficiency - Set permissions once on directories, files inherit automatically
  • 🎮 Interactive Web Editor - Google Drive-style permission management interface

Beautiful Table Display

SyftPerm provides rich table displays for Jupyter notebooks:

# Display permissions table with compliance information
file._repr_html_()  # Shows user permissions, file limits, and compliance status

# The table includes:
# • User permissions (Read/Create/Write/Admin)
# • File size vs limits
# • File type compliance (directories, symlinks)
# • Overall compliance status
# • Direct link to web editor

Web Editor

For non-technical users, SyftPerm includes a web interface:

# Get editor URL for any file or folder
url = sp.get_editor_url("my_project/")
print(f"Edit permissions at: {url}")

Learn More

Requirements

  • Python 3.9+
  • Works on Windows, macOS, and Linux

Contributing

  1. Check out our GitHub Issues
  2. Read the Contributing Guide
  3. Join the OpenMined Community

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syft_perm-0.3.89.tar.gz (136.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

syft_perm-0.3.89-py3-none-any.whl (64.4 kB view details)

Uploaded Python 3

File details

Details for the file syft_perm-0.3.89.tar.gz.

File metadata

  • Download URL: syft_perm-0.3.89.tar.gz
  • Upload date:
  • Size: 136.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.20

File hashes

Hashes for syft_perm-0.3.89.tar.gz
Algorithm Hash digest
SHA256 2008c6b9be548ae5883f97427bf550e0f80b1ffa7a6a01f258f2f5b94842ee45
MD5 4a4f8150cea2b2179246d2c162ba752e
BLAKE2b-256 5a98c06b80d04a10fc104ff6e77e93608b467528e57f96c91b69c3053845fc7f

See more details on using hashes here.

File details

Details for the file syft_perm-0.3.89-py3-none-any.whl.

File metadata

  • Download URL: syft_perm-0.3.89-py3-none-any.whl
  • Upload date:
  • Size: 64.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.20

File hashes

Hashes for syft_perm-0.3.89-py3-none-any.whl
Algorithm Hash digest
SHA256 dcb279c0332dfec4f19f0d74781ac23cb1bc34add0ef2fb487c8cc4d2efb6ac2
MD5 94ce4b5718472383b033423c3ff7f09d
BLAKE2b-256 f5f4b45ee7a89750d56ca90cac11adbf1f3e61d6462346e19a6bfeac6c676c2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page