Skip to main content

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»
    • [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 way adr["Configs"]["chances"]["spawn"](lambda pos: pos[SNEED]), and use it on data structire adr.use(CONFIGS_ROOT). It returns same for CONFIGS_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.
    • [table]
      • class: Table - contains headers and rows. use table[index_column][index_row] or better table.getitem(row:int, col:int) for extracting values. Use adddefaultheader(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
  • [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) or r(cell). All functions in pipeline will be called with (cell, staticmeta), with staticmeta from router.
  • [tests]
    • //ALL_FROM_SUBMODULES//
    • [exprs]
      • iterable(o) - allows to get iterator from object, and using o inside 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
    • [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.

Metadata

Release files for pyvorse 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyvorse 1.0.4
File Size Uploaded
pyvorse-1.0.4.tar.gz 32.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyvorse 1.0.4
File Interpreter ABI Platform
pyvorse-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 52.2 kB

Release files / pyvorse-1.0.4.tar.gz

Download URL pyvorse-1.0.4.tar.gz
Size 32.6 kB
Tags Source
SHA-256 checksum
How to use checksums
86993e5709fa2c30c082b22662cba261416fa16731d7bc37626de6fb44781270
BLAKE2b-256 checksum
How to use checksums
36a86f8cd49c91f41cb405e419325ffc76d429fa367c5f52a19a7bb93574159e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.10 CPython/3.9.7 Windows/10

Release files / pyvorse-1.0.4-py3-none-any.whl

Download URL pyvorse-1.0.4-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63e7a52cadcffe92201235f4e29036736b779240ea07155735dfa285e2a0fcb2
BLAKE2b-256 checksum
How to use checksums
f5e76c459fe2a01716af9fe6c17cf52984ed6d25fd4dc4a07b3d8d37fafd6df0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.10 CPython/3.9.7 Windows/10

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page