A Python package for Dam, Dictor, and ScreenOpp and more utilities
Project description
Dampy
Dampy is a Python project that provides utilities for handling operations with arguments, dictionaries, .Ntps files, and displaying data in a graphical shell-like interface using Flet.
Features
- Dam Class: Perform operations with arguments and extra values.
- Dictor Class: A dynamic dictionary-like structure with nested capabilities.
- ScreenOpp Class: Display data in a graphical shell-like interface.
- Ntps_ Class: Handle
.Ntpsfiles and display their data. - Ntps_exec Class: Execute the contents of
.Ntpsfiles. - alg Class: Create and manage algorithms in
.Ntpsfiles. - shell Class: Simulate a shell-like interface for displaying file content.
Installation
Prerequisites
- Python 3.8 or higher
- Install required dependencies:
pip install flet
Usage
1. Dam Class
The Dam class provides methods for performing operations with arguments and extra values.
Methods:
-
opp(args, extra=0):- Performs an operation with
argsandextra. - Args:
args (str): The main argument.extra (int): An additional value.
- Returns:
extraifargsis provided, otherwiseargs.
- Performs an operation with
-
write(value):- Compares a value with stored
argsorextra. - Args:
value (str): The value to compare.
- Returns: The matching value or
0if no match.
- Compares a value with stored
-
conv(value):- Converts a value to binary.
- Args:
value (int): The value to convert.
- Returns: The binary representation of the value.
Example:
from testNor import Dam
dam_instance = Dam()
result = dam_instance.opp("example", extra=42)
print(result) # Output: 42
2. Dictor Class
The Dictor class is a dynamic dictionary-like structure with nested capabilities.
Methods:
-
__call__():- Returns the dictionary contents.
-
__setitem__(key, value):- Adds a key-value pair to the dictionary.
-
__getitem__(key):- Retrieves a value by key. Creates a nested
Dictorif the key doesn't exist.
- Retrieves a value by key. Creates a nested
Example:
from testNor import Dictor
dictor_instance = Dictor()
dictor_instance["key"] = "value"
nested_dictor = dictor_instance["nested"]
nested_dictor["nested_key"] = "nested_value"
print(dictor_instance()) # Output: {'key': 'value', 'nested': {'nested_key': 'nested_value'}}
3. ScreenOpp Class
The ScreenOpp class displays data in a graphical shell-like interface.
Methods:
-
__init__(name, datas_, page):- Initializes the screen with a name, data, and page.
- Args:
name (str): The name to display.datas_ (str): The data to display.page (str): The page to display.
-
display():- Displays the screen using Flet.
Example:
from testNor import ScreenOpp
screen = ScreenOpp(name="Example Name", datas_="Example Data", page="Example Page")
screen.display()
4. Ntps_ Class
The Ntps_ class handles .Ntps files and displays their data.
Methods:
-
Ntps(data_file_creation):- Creates or reads an
.Ntpsfile. - Args:
data_file_creation (str): The name of the.Ntpsfile to create or read.
- Creates or reads an
-
data_screen(Name_of_Ntps_file):- Displays data from an
.Ntpsfile on a graphical screen. - Args:
Name_of_Ntps_file (str): The name of the.Ntpsfile to read.
- Displays data from an
Example:
from testNor import Ntps_
Ntps_.Ntps("example_file") # Creates or reads an .Ntps file
Ntps_.data_screen("example_file") # Displays data from an .Ntps file
5. Ntps_exec Class
The Ntps_exec class extends Ntps_ and executes the contents of .Ntps files.
Methods:
execute_(file):- Executes the contents of an
.Ntpsfile by generating a Python script and running it. - Args:
file (str): The name of the.Ntpsfile to execute.
- Executes the contents of an
Example:
from testNor import Ntps_exec
ntps_exec_instance = Ntps_exec()
ntps_exec_instance.execute_("example_file") # Executes the contents of an .Ntps file
6. alg Class
The alg class creates and manages algorithms in .Ntps files.
Methods:
create(algs):- Writes the raw input string to an
.Ntpsfile. - Args:
algs (str): The algorithm to write.
- Writes the raw input string to an
Example:
from testNor import alg
alg.create("1+2+3") # Writes "1+2+3" to algorithms.Ntps
7. shell Class
The shell class simulates a shell-like interface for displaying file content.
Methods:
window():- Displays the content of
shell.pyin a graphical shell-like interface.
- Displays the content of
Example:
from testNor import shell
shell.window() # Displays the content of shell.py
Dependencies
- Flet: Used for graphical screen rendering.
- Python 3.8 or higher
Install dependencies using:
pip install flet
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Syed
Feel free to contribute to this project by submitting issues or pull requests!
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
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 nortools-1.2.3.tar.gz.
File metadata
- Download URL: nortools-1.2.3.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1eb5f86a107314889253e6e93d35127a9efe9f5e26d13a37393be7f47541d9ad
|
|
| MD5 |
a383f45208ad5e16be032ec0679f2591
|
|
| BLAKE2b-256 |
87d24a4a31a70cf7cedb89ee71b2e99077323c66731ce89f72f4bb290372bfb3
|
File details
Details for the file nortools-1.2.3-py3-none-any.whl.
File metadata
- Download URL: nortools-1.2.3-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e84372225c126cef345b918fb615b318de73cb5f290f710aced2928704045d2
|
|
| MD5 |
49f8c2e34bbe34f9bd4493523f0595f8
|
|
| BLAKE2b-256 |
10fda047a2db5890723997d5c03b61be99053d8804a6de39e345ed7b46c8713e
|