This project has been archived by its maintainers, and is no longer receiving any updates.
This project is designed to facilitate the creation and management of pluggable software architectures using namespaces. The concept of pluggable namespaces enables the development of software that is modular and easy to extend.
Pluggable namespaces provide a framework for constructing applications composed entirely of interchangeable modules. This approach allows developers to scale their projects smoothly and integrate complex software components seamlessly.
Using pluggable namespaces, developers can build software in smaller, maintainable components. These components can then be combined and deployed as a single entity, simplifying the deployment process.
All of this is achieved using Python, one of the world’s most popular and powerful programming languages.
Installation
You can install pluggable-namespace from PyPI:
pip3 install pluggable-namespace
Creating a pluggable application can be accomplished with just a few lines of code. The heart of every pluggable-namespace project is the creation of a hub, adding dynamic subsystems, and interacting with them through the hub’s namespace.
import pns.shim
import asyncio
async def main():
hub = await pns.shim.loaded_hub()
await hub.my_sub.init.cli()
if __name__ == "__main__":
asyncio.run(main())
Configuration
When building a pluggable-namespace app, all configuration settings are stored in a config.yaml file.
# Each configuration option for your module
config:
my_namespace:
my_opt:
default: True
# Options exposed on the CLI when your app controls the CLI
cli_config:
my_namespace:
my_opt:
help: Description of this option
subcommands:
- my_subcommand
group: My arg group
# Subcommands to expose for your project
subcommands:
my_namespace:
my_subcommand:
help: My subcommand
# Dynamic namespaces that your app merges onto and which folders extend those namespaces
dyne:
my_dyne:
- src_dir
# Python imports that your app uses, to be added to hub.lib for your app
import:
- asyncio
- importlib
- importlib.resources
- os
- toml
From the example above, all arguments are loaded onto the namespace under hub.OPT.my_namespace. One config.yaml can add configuration options to multiple namespaces. They are merged in the order found in sys.path.
Extending Namespaces
locally
Extending pluggable-namespace is straightforward with dynamic namespaces. Extend any dynamic namespace on the hub by adding a directory containing a “config.yaml” to PYTHONPATH.
export PYTHONPATH=$PYTHONPATH:/path/to/project_root
Add a config.yaml to that directory:
# project_root/config.yaml
dyne:
namespace:
# This references the directory project_root/foo
- foo
Now, every Python file in project_root/foo will be added to the hub under hub.namespace.
With PyPI
You can use the seed command to create all the boiler-plate code you need for a pluggable-namespace project.
hub seed.init.cli /path/to/project_root name=my_project
Now you can add all your code to /path/to/project_root/src/my_project
Metadata
Release files for pluggable-namespace 2.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pluggable_namespace-2.2.1.tar.gz | 2.4 MB | Details |
Built distributions (wheels)
Total release size: 40.3 MB
Release files / pluggable_namespace-2.2.1.tar.gz
| Download URL | pluggable_namespace-2.2.1.tar.gz |
|---|---|
| Size | 2.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dbc0e5fb62c850fec62d98da203e734d23d605367e99a984c9d9eef21c222dda
|
|
BLAKE2b-256 checksum How to use checksums |
5eeebc4660b9587edcb78f3228818b9c34b5be683d91f7c62ad9afdfac0a37ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / pluggable_namespace-2.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl
| Download URL | pluggable_namespace-2.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
21059a6534022f07d639a7d71a66ed4e901dda33c61597c047d8887e95075b74
|
|
BLAKE2b-256 checksum How to use checksums |
5748b3f0f1becb61b83b6dfe4d20ae59fc75a935c041514e424a58d075d5cd00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / pluggable_namespace-2.2.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pluggable_namespace-2.2.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
5964ba32ed32c9231912b48ca4af5e04c00944b56d941fc4b042389ae17aa446
|
|
BLAKE2b-256 checksum How to use checksums |
ab8fbf7fc62bc26fa1f0b8d7f693547921b661ae3f7c861baadc2b160c168045
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / pluggable_namespace-2.2.1-cp314-cp314-musllinux_1_2_x86_64.whl
| Download URL | pluggable_namespace-2.2.1-cp314-cp314-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.14 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
535e8f8cafb6492f59f69660df39dae69ade84e53f55c7d0935442dd2828eb0b
|
|
BLAKE2b-256 checksum How to use checksums |
f94aedc8af69a13067b3ec2f2b2cfbc1cf0f58888d3b16ca79fb2e7f9e3297ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / pluggable_namespace-2.2.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pluggable_namespace-2.2.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
41993875b96a59b2edfb4155fede2a37ed3275fce7256ef9ee12aaac93085e3f
|
|
BLAKE2b-256 checksum How to use checksums |
01e91fadc08be62cedb62e26a7ed0597e5eba35e366402814688ce171fb8a9ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / pluggable_namespace-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | pluggable_namespace-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
23e18b7c92fa2b291a85c3139b78329af5bbae8eeeb2380c90f1b88d28bd1917
|
|
BLAKE2b-256 checksum How to use checksums |
d2093e3e0eb893b199210026a19191d33b6c0558716e8541fd8315d142f0d162
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / pluggable_namespace-2.2.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pluggable_namespace-2.2.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b35592e522804867f1eff5e5860e02dfeaccb514662f25d4362922bc04125c6c
|
|
BLAKE2b-256 checksum How to use checksums |
8454b13baad6ef1f23607071916c8f4130978358e754a376226823e359e3f6c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / pluggable_namespace-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | pluggable_namespace-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
e4b214f3192137214275d6169639e18d4ec3e2304bb5fa70fa5ee72f04e03cf4
|
|
BLAKE2b-256 checksum How to use checksums |
08b9c26f73deddafc8838f049c3802277ba8e4512e2d38bd4c61c4be7ed090e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / pluggable_namespace-2.2.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pluggable_namespace-2.2.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
85a15d54f95785771317b159bd0e1f2a0f4616f32726f01036a92650aaec5bca
|
|
BLAKE2b-256 checksum How to use checksums |
c731024bfae884707fa7f0f2247d01e575b937eff9bea6ceee17ac84c663978c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / pluggable_namespace-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | pluggable_namespace-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
31db97df0ab838232df7a04881ac3b493e9cc71ef3366052ee991cc111a72b5e
|
|
BLAKE2b-256 checksum How to use checksums |
15dd40a5cf978a3984512002cec3a6c0d11db6a3cd2e6e9cdf7dd09f8b8e755f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / pluggable_namespace-2.2.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pluggable_namespace-2.2.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b8e2c1aad6c0a71f0a94f521eb3237739cdfc19fe099cfeb17fd51a167f8a4b3
|
|
BLAKE2b-256 checksum How to use checksums |
d4c984d6c5818db3cbbdd0ee7785d563964eea3f2d070c49c43e0209687df6ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|