Circular iterator (Citerate)
Python bi-dimensional matrix iterator starting from any point (x, y) iterating layer by layer around some starting coordinates.
Usage
pip install citerate
As of 14 july 2021 it contains one method citerator
from citerate import citerator
Examples
Using the example data set:
DATA = [
[10, 11, 12, 13, 14],
[25, 2, 3, 4, 15],
[24, 9, 1, 5, 16],
[23, 8, 7, 6, 17],
[22, 21, 20, 19, 18],
]
Iterate over the set layer by layer starting from coordinates (x=2, y=2) and print each layer as a list of it's corresponding values.
for layer in citerator(DATA, x=2, y=2, layer=True):
print(layer)
Yields:
[1]
[2, 3, 4, 5, 6, 7, 8, 9]
[10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
Iterate over the set value by value starting from coordinates (x=2, y=2) and print each value individually.
for value in citerator(DATA, x=2, y=2):
print(value, end=' ')
Yields:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Footnotes
- It is NOT mandatory to iterate starting from the central coordinates or for the matrix to be uniform.
- It HAS to be bi-dimenstional and follow a "list of lists" pattern.
Metadata
Release files for citerate 0.1.1
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 | Actions |
|---|---|---|---|---|
| citerate-0.1.1.tar.gz | 3.9 kB | Without provenance | Details for citerate-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| citerate-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for citerate-0.1.1-py3-none-any.whl |
Total release size: 7.6 kB
Release files / citerate-0.1.1.tar.gz
| Download URL | citerate-0.1.1.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2287d2c28eb7b05e0fb04364b42ec972d084f92d92947ba9a263224c7d92ccb4
|
|
BLAKE2b-256 checksum How to use checksums |
090c03a7dce1298f4f3a24e099c0326e34d7275aeae6c81589743ba445e52a27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / citerate-0.1.1-py3-none-any.whl
| Download URL | citerate-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
247b54e04cd4447629dc36c921bf953b8e4cf3fb5c545d6e92a10a396f0f7119
|
|
BLAKE2b-256 checksum How to use checksums |
059cd0d78e53f7f9dcb25a7d6bfc78086672e27d13543c700c39ea0775b21957
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for citerate 0.1.1
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.