Simple essentials extension library of additions to vanilla python.
Project description
pyvorse
Simple essentials extension library of additions to vanilla python.
Includes:
- [core]:
- @attribute - converts any function with (arg: str) to attribute processor
- w. - attribute processor to faster writing short words, dont use it in speed is important. For obvious reasons, such a word notation is guaranteed to conform to python's naming conventions. w.var_name = "var_name"
- class: basis - extended base class
- @throws(*exceptions_cls) - marks function with classes, that can be thrown
- isthrows(exception_cls) - test function to be marked with
@throws() - trycall(func, *args, **kwargs) -> tuple[result, exception] - catches exceptions in function call
- @safe - converts function to its copy, but automatically called inside
trycall(), and returns tuple[result, exception] - Operators - enum for @calloperators
- @calloperators(op: Operators = Operators.All) - converts function to object, that calls with secon operand and returns result of it function on using operator, selected in argument. Operand still can be called as function.
- reprint() - operand-variation of print function, can be called like
reprint - w.text_to_show. If prints only one value, value will be returned as result. - @functor - allows function to be called with self object as first argument. to work with its fields as example.
- class: unibox - class, that locks value inside field
.inbox, and contains dict for metadata, and can be stopped with.stop(), and be test for it by.stopped, or.isStopped() - copyAllProps(dest, source) - function copies all attributes from source to dest, but ignores attributes with name starting with duble underscore '__'
- [data]:
- //ALL_FROM_SUBMODULES//
- [deep]
- deep - Implements a simplified version of javascript objects based on the "dict" class. Can be created directly or through a class of similar objects that extends "dci". Prototypal inheritance. All methods to look deeper starts with word «deep», like
.deepget(name). More details on the wiki. - dci - empty base deepclass, use its
.extend(new_prototype: deep, *names: str)method, that returns new deepclass object - class: DeepCalss - ignore it, nothing more then python`s class of «dci»
- deep - Implements a simplified version of javascript objects based on the "dict" class. Can be created directly or through a class of similar objects that extends "dci". Prototypal inheritance. All methods to look deeper starts with word «deep», like
- [positioned]
- class: poslist - list, based on dict. Aloows to contain skips inside.
- [simple]
- class: loop - list, but handles index overload like list is lopped
- class: scope - dict, but allows get-access to items like access to attributes, and attribute-like set access, but onky for keys, already present in dict. Allows to find item by number of a key (it automatically sorted in dicts). Allows getting values dynamic/ Value is a function to be called with self dict as first argument.
.getDynamic(key) - class: stack - list, extended only, no changes.
.setvalidation(validator: Callable)- validates values on pushing to the stack..push(value)and.leftpush(value),.pushes(value)and.leftpushes(value). Raises ValueError, if loses validation..pull()and.leftpull(value)- works like default.pop()but without arguments, for last and first element.
- [smart]
- class: smartlist - list, but with additional methods. find, select, filtered (iter), filter, any, all, astuole, asslist, asset, foreach, mapper, reducer, sort, sliced, slicedstart, slicedend. Working with predicates and callbacks. Details on wiki.
- class: handle - Primitive handlers container, simplest pipeline. Objects can be used as decorators, or called with callback passed. On each step calls callback with box on first argument.
- class: objectAddress - Create, object
adr = objectAddress(), write your wayadr["Configs"]["chances"]["spawn"](lambda pos: pos[SNEED]), and use it on data structireadr.use(CONFIGS_ROOT). It returns same forCONFIGS_ROOT["Configs"]["chances"]["spawn"][SNEED], but can be used nultiple times and dynamically.
- [spiders]
- class: spider(seeker: Callable, worker: Callable) - spiders can work with complex data structures. Seeker selexts new node, worker does something here. Seeker and worker will be called with (struct, dot, box). Use
box.stop()to finish spiders`s walk. But worker will be called even if you stop it in seeker.
- class: spider(seeker: Callable, worker: Callable) - spiders can work with complex data structures. Seeker selexts new node, worker does something here. Seeker and worker will be called with (struct, dot, box). Use
- [table]
- class: Table - contains headers and rows. use
table[index_column][index_row]or bettertable.getitem(row:int, col:int)for extracting values. Useadddefaultheader(self, name: str, align: int = 0, default=None)to add new column. You can use.getdynamic(row:int, col:int)to work with dynamic values. functions, that will be called with (table: Table, row:int, col:int). For example - auto-numerations. Rendering method not presented! Inherit class, and add any render you want, markdown or html for example. - class: Column - saves names and align for headers. Saves default values for tables.
- class: Row: poslist - class represents rows in the table
- class: Table - contains headers and rows. use
- [mathematics] - Whole default math, but with 2 new functions.
trin(n)for triangular number and count of diagonals in any shape.hexcount(n)- for calculatinc number of hexagonal cells in radius from one. - [pipeline] - simple tools for complex piplines
- //ALL_FROM_SUBMODULES//
- [datacell]
- class: dcell: core.unibox - just container for value in pipeline.
- [mains] - Default pipline functions containers:
- DictionaryPipeline
- ListPipeline
- [routers] - full pipeline conveyor build. Cotains static metadata. Uses pointer to select new function, and it can be method from pipeline container.
- class: router - Read on wiki! Use
r.launch(cell)orr(cell). All functions in pipeline will be called with(cell, staticmeta), with staticmeta from router.
- class: router - Read on wiki! Use
- [tests]
- //ALL_FROM_SUBMODULES//
- [exprs]
- iterable(o) - allows to get iterator from object, and using
oinside for..in cycle - nextable(o) - allows to use
next(o) - forable(o) - deeper version of
iterable(o)test. - instanceof(o, *cls) - alternative notation to isinstance, like
instanceof(my_num, int, float, complex) - withable(o) - allows with.. as..
- awithable(o) - allows async with.. as..
- isinrange(_list, index) - test index for a range in the index
- iterable(o) - allows to get iterator from object, and using
- [other]
- hashable(o) - can be used as key for dictionary or not.
- haskey(o, key) - like hasattr, but tests for
o[key] - isand(o, *t) - tests o to be all of *t
- isor(o, *t) - tests o to be any of *t
- eqand(o, *t) - tests o to be equal to all of *t
- eqor(o, *t) - tests o to be equal to any of *t
- haslen(o) - can be item used in
len(o)or not.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyvorse-1.0.4.tar.gz
(32.6 kB
view details)
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
pyvorse-1.0.4-py3-none-any.whl
(19.5 kB
view details)
File details
Details for the file pyvorse-1.0.4.tar.gz.
File metadata
- Download URL: pyvorse-1.0.4.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.10 CPython/3.9.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86993e5709fa2c30c082b22662cba261416fa16731d7bc37626de6fb44781270
|
|
| MD5 |
5eaa7b2e0c5f43be8da2564c42720704
|
|
| BLAKE2b-256 |
36a86f8cd49c91f41cb405e419325ffc76d429fa367c5f52a19a7bb93574159e
|
File details
Details for the file pyvorse-1.0.4-py3-none-any.whl.
File metadata
- Download URL: pyvorse-1.0.4-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.10 CPython/3.9.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63e7a52cadcffe92201235f4e29036736b779240ea07155735dfa285e2a0fcb2
|
|
| MD5 |
0c72bacdae0263eb139bc58f41a41bce
|
|
| BLAKE2b-256 |
f5e76c459fe2a01716af9fe6c17cf52984ed6d25fd4dc4a07b3d8d37fafd6df0
|