Skip to main content

Static typed-style access modifiers and patterns for Python

Project description

🐍 lockpy — Access Control for Python

lockpy brings powerful, enforced access control patterns to Python — something you normally only get in languages like Java or C#.

It provides decorators like:

  • @singleton — ensures only one instance of a class exists.
  • @private — prevents external access to methods (enforced at runtime).
  • I'm currently working on modifiers like : @protected, @final, @readonly - will include in other releases

🚀 Features

  • Lightweight: no dependencies required
  • Inspired from static typed languaged: private/protected/final behavior
  • Runtime Enforcement: enfore rules at runtime (no special interpreter required)
  • Flexible: works with instance methods, classmethods, and staticmethods

📦 Installation

pip install lockpy

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

lockpy-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

lockpy-1.0.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file lockpy-1.0.0.tar.gz.

File metadata

  • Download URL: lockpy-1.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.0

File hashes

Hashes for lockpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7d141a6b2c54a1e40718e1bea10363e08ca7682b3a0eaee2d5439e263dd2ef8f
MD5 de94df250706e813a476281c916cd921
BLAKE2b-256 8974096f1450d6820b5c0db0871173b52a352369baab26c554717d996eb3a6c4

See more details on using hashes here.

File details

Details for the file lockpy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lockpy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.0

File hashes

Hashes for lockpy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6c0571353ef52a75219d75202a1ac9f6da171ef8d57495ea3baa8d14bba273f
MD5 9d5fb17e964328923591005049c1d365
BLAKE2b-256 57b36ab4451bdfaf35dc3e27c6c0adf4eca7d063c104c46203923666466cdf01

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