pyNamespace
pyNamespace is an Application Framework supporting creation of the in-application data storage, simulating organization and behavior of the Unix filesystem graph. You can create "directories" and data objects. Refer those directories and data using Unix-like path. Also, you can create internal links between an objects and link one data object to more than one "directory".
Creation of a namespace
from pyNamespace import *
ns = Namespace()
After you import pyNamespace module, you shall create an object of type Namespace. The "filesystem" root - "/" will be created automatically.
Reading and writing into a namespace
from pyNamespace import *
ns = Namespace()
ns.set("home/answer", 42)
print(ns.get("home/answer"))
.set and .get methods will store and read objects from Namespace. Parameters for .set will be the path and a value which will be stored at that path. For .get it'll be a path, from which value will be retrieved.
Removing objects from namespace
from pyNamespace import *
ns = Namespace()
ns.set("home/answer", 42)
ns.rm("home/answer")
.rm with path parameter will remove an object from the namespace. .rm also removes all "orphan" (nodes which do not have an incoming connections) nodes from the graph.
Refer one node to another in the namespace.
There are two types of the references Soft-reference assumes that the object will be created in the graph, which will have a reference to another object. Method .get will recognize the reference and return the value of the original (source) object. Hard-reference will actually link source object with destination object in the graph.
.link method will create a "soft-link" and .ref will create a hard-reference.
from pyNamespace import *
ns = Namespace()
ns.set("home/answer", 42)
print(ns.link("home/answer", "etc/answer"))
print(ns.get("etc/answer"))
This is an example of the soft-reference.
from pyNamespace import *
ns = Namespace()
ns.set("home/answer", 41)
ns.ref("home/answer", "etc")
ns.set("home/answer", 42)
This is an example of the hard-reference
Metadata
Release files for pyNamespace 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pyNamespace-0.0.7.tar.gz | 16.6 kB | Without provenance | Details |
Release files / pyNamespace-0.0.7.tar.gz
| Download URL | pyNamespace-0.0.7.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f4869f40a6a105e342dfdc8dc7e7b7a47bb91a397ee57b1e9454ef9c1a55f12
|
|
BLAKE2b-256 checksum How to use checksums |
ad62aa2e7591b5adab9a29babc02cfeff0151a2449644311fbb892a819a89357
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7
|
Security for pyNamespace 0.0.7
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.