Skip to main content

Noo-lib, Now is Simple Python list() Extensions

Project description

noopy

For singleton dimension(same flatten) simple tiny list and array(array.array) library. This module could be str transpose and flip on like 2D singleton dims as result of list extends. This module useful if limited ext modules(numpy, torch, and others) and also passes values to those modules.

lispy

Based on list lispy therefore this class suite for str treat.

arrpy (appendix)

Based on array.array arrpypy therefore few memory cost and process speed more than lispy. On the other hand, this library is not suite for str treat.


Features

  • Processing on Basic Module: Only!
  • Splitter:Array splitter have get of best split position function and others.
  • Transpose: Transposer is equivalent 2D free transpose on 1D it's make as possible for str array too.
  • Flip: Flipper is equivalent 2D free Flip on 1D it's make as possible for str array too.

Installation

You can install noopy directly from PyPI:

pip install noopy

Quick Start

Get started with lispy in just a few lines of code:

import noopy as nop
from noopy import lispy, arrpy # Example for array disassembly

my_lst = nop.lispy([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
my_arr = nop.arrpy([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

Basic Usage

Impremented Features.

API Reference

noopy Modules Methods

  • is_spl(arr:list, n:int) Check could be split specified value count.
    • arr: (list) Wanted list.
    • n: (int) This value specified for check availability of split count.
  • splpos(arr:list) Get could can be split positions as list(e.g. [2 ,4 ,6 ,8...]).
    • arr: (list) Wanted list.
  • splmax(arr:list, n:int) Get first upper split positions from splpos function resusts list.
    • arr: (list) Wanted list.
    • n: (int) Search start index.
  • splmin(arr:list, n:int) Get first under split positions from splpos function resusts list.
    • arr: (list) Wanted list.
    • n: (int) Search start index.
  • splist(arr:list, n:int, r:bool)
    • arr: (list) Wanted list.
    • n: (int) between separation of array split, raise error not match like dimensions.
    • r: (bool) Reverse split elements, default is False.
  • transpose(arr:list, x:int, y:int) Get Split Positions.
    • arr: (list) Wanted list.
    • x: (int) strict of X direction, raise error not match like dimensions.
    • y: (int) strict of Y direction, raise error not match like dimensions.
  • flip(arr:list=None, x:int, y:int, z:str) Get Split Positions.
    • arr: (list) Wanted list.
    • x: (int) strict of X direction, raise error not match like dimensions.
    • y: (int) strict of Y direction, raise error not match like dimensions.
    • z: (str) specified direction x or y or z(full flip).

lispy Class Methods

Still not feature as similar torch functions, wanna be,,, not be self update (self) values yet.

e.g. xyz = xyz.flip(x, y, z)

  • is_spl(n:int) Check could be split specified value count.
    • n: (int) This value specified for check availability of split count.
  • splpos() Get could can be split positions as list(e.g. [2 ,4 ,6 ,8...]).
  • splmax(n:int) Get first upper split positions from splpos function resusts list.
    • n: (int) Search start index.
  • splmin(arr:list, n:int) Get first under split positions from splpos function resusts list.
    • arr: (list) Wanted list.
    • n: (int) Search start index.
  • splist(n:int, r:bool)
    • n: (int) between separation of array split, raise error not match like dimensions.
    • r: (bool) Reverse split elements, default is False.
  • transpose(x:int, y:int) Get Split Positions.
    • x: (int) strict of X direction, raise error not match like dimensions.
    • y: (int) strict of Y direction, raise error not match like dimensions.
  • flip(x:int, y:int, z:str) Get Split Positions.
    • x: (int) strict of X direction, raise error not match like dimensions.
    • y: (int) strict of Y direction, raise error not match like dimensions.
    • z: (str) specified direction x or y or z(full flip).

arrpy Class Methods

Same above(listpy), still not feature as similar torch functions, wanna be,,, not be self update (self) values yet.

e.g. xyz = xyz.flip(x, y, z)

  • is_spl(n:int) Check could be split specified value count.
    • n: (int) This value specified for check availability of split count.
  • splpos() Get could can be split positions as list(e.g. [2 ,4 ,6 ,8...]).
  • splmax(n:int) Get first upper split positions from splpos function resusts list.
    • n: (int) Search start index.
  • splmin(arr:list, n:int) Get first under split positions from splpos function resusts list.
    • arr: (list) Wanted list.
    • n: (int) Search start index.
  • splist(n:int, r:bool)
    • n: (int) between separation of array split, raise error not match like dimensions.
    • r: (bool) Reverse split elements, default is False.
  • transpose(x:int, y:int) Get Split Positions.
    • x: (int) strict of X direction, raise error not match like dimensions.
    • y: (int) strict of Y direction, raise error not match like dimensions.
  • flip(x:int, y:int, z:str) Get Split Positions.
    • x: (int) strict of X direction, raise error not match like dimensions.
    • y: (int) strict of Y direction, raise error not match like dimensions.
    • z: (str) specified direction x or y or z(full flip).

See Officials:

array — Efficient arrays of numeric values (JP)

Type code C Type Python Type Minimum size in bytes Notes numpy,torch
'b' signed char int 1 int8
'B' unsigned char int 1 uint8
'u' wchar_t Unicode character 2 (1) str
'w' Py_UCS4 Unicode character 4 (2) ucs
'h' signed short int 2 short8, fp16
'H' unsigned short int 2 ushort16
'i' signed int int 2 int16
'I' unsigned int int 2 uint16
'l' signed long int 4 int32
'L' unsigned long int 4 uint32
'q' signed long long int 8 int64
'Q' unsigned long long int 8 uint64
'f' float float 4 float32
'd' double float 8 loat64

Command Line Usage

noopy includes a simple command-line interface for testing its console output capabilities.

To run the test, simply execute:

python -m noopy
By the first, this is original array.

0, 1, 2, 3, 4, 5, 
6, 7, 8, 9, a, b, 
c, d, e, f, g, h, 
i, j, k, l, m, n, 
o, p, q, r, s, t, 
u, v, w, x, y, z, 

Available split positions.

2, 3, 6, 
9, 18, 

Available split to 9(9x4)?

True

Split to 9(9x4).

['0', '1', '2', '3', '4', '5', '6', '7', '8'], ['9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], ['i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q'], 
['r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], 

[ Transpose ]

0, 6, c, i, o, u, 
1, 7, d, j, p, v, 
2, 8, e, k, q, w, 
3, 9, f, l, r, x, 
4, a, g, m, s, y, 
5, b, h, n, t, z, 

[ Flip LR ]

5, 4, 3, 2, 1, 0, 
b, a, 9, 8, 7, 6, 
h, g, f, e, d, c, 
n, m, l, k, j, i, 
t, s, r, q, p, o, 
z, y, x, w, v, u, 

[ Flip UD ]

u, v, w, x, y, z, 
o, p, q, r, s, t, 
i, j, k, l, m, n, 
c, d, e, f, g, h, 
6, 7, 8, 9, a, b, 
0, 1, 2, 3, 4, 5, 

[ Flip XX ]

z, y, x, w, v, u, 
t, s, r, q, p, o, 
n, m, l, k, j, i, 
h, g, f, e, d, c, 
b, a, 9, 8, 7, 6, 
5, 4, 3, 2, 1, 0, 

These are 2D Array Simulation from on there.

Split to 9(9x4).

['0', '1', '2', '3', '4', '5', '6', '7', '8'], ['9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], ['i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q'], 
['r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], 

[ Transpose ]

0, 3, 6, 
1, 4, 7, 
2, 5, 8, 
9, c, f, 
a, d, g, 
b, e, h, 
i, l, o, 
j, m, p, 
k, n, q, 
r, u, x, 
s, v, y, 
t, w, z, 

[ Flip LR ]

2, 1, 0, 
5, 4, 3, 
8, 7, 6, 
b, a, 9, 
e, d, c, 
h, g, f, 
k, j, i, 
n, m, l, 
q, p, o, 
t, s, r, 
w, v, u, 
z, y, x, 

[ Flip UD ]

6, 7, 8, 
3, 4, 5, 
0, 1, 2, 
f, g, h, 
c, d, e, 
9, a, b, 
o, p, q, 
l, m, n, 
i, j, k, 
x, y, z, 
u, v, w, 
r, s, t, 

[ Flip XX ]

8, 7, 6, 
5, 4, 3, 
2, 1, 0, 
h, g, f, 
e, d, c, 
b, a, 9, 
q, p, o, 
n, m, l, 
k, j, i, 
z, y, x, 
w, v, u, 
t, s, r, 

Contributing

We welcome contributions to noopy! If you find a bug, have a feature request, or would like to contribute code, please check out our GitHub repository and open an issue or pull request.


License

noopy is licensed under the GPLv3 AND LicenseRef-RPTv1.

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

noopy-0.0.1.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

noopy-0.0.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file noopy-0.0.1.tar.gz.

File metadata

  • Download URL: noopy-0.0.1.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for noopy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 283489f296c9110fb3b0a5a4ab318c69577acb131f39e9bf34631d39a8eda400
MD5 038de9ad57a6ec8e67385e357abc1d5b
BLAKE2b-256 204ac432c53fe59f768d452d8edd19169b516e1db3b15172bdbb94e99dcc3503

See more details on using hashes here.

File details

Details for the file noopy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: noopy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for noopy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e83638ee65a8323fc4260e95526aa27e56c45d6229068ede870b916e0b356a30
MD5 f45f0bd4b4bd021d08352a4030b16201
BLAKE2b-256 e1d2e970571570f435a4ae8fbfcba5ac6a3166fccca2dcf9fc142ec848f8b3e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page