Skip to main content

Cereja is a bundle of useful functions that I don't want to rewrite.

Project description

Cereja 🍒

Python package PyPI version Downloads MIT LICENSE Issues Get start on Colab

Cereja is a bundle of useful functions that I don't want to rewrite.

How many times have you needed to rewrite that function or base class? Well, I thought then of joining all my lines of code, bit by bit, in one place.

Not well structured yet :( ... But you can help me !!!

Getting Started DEV

Do not be shy \0/ ... Clone the repository and submit a function or module you made or use some function you liked.

See CONTRIBUTING 💻

Prerequisites

Installing

Install Cereja Package

python3 -m pip install --user cereja

or for all users

python3 -m pip install cereja

Note: If you are using Windows, you do not need to use python3, but make sure your python path settings are correct.

Cereja Example usage

Progress

import cereja as cj
import time

def process_data(i: int):
    # simulates some processing 
    time.sleep(cj.rand_n()/max(abs(i), 1))

my_iterable = range(1, 500)
my_progress = cj.Progress("My Progress")

for i in my_progress(my_iterable):
    process_data(i)
Custom Display
import cereja as cj
import time

progress = cj.Progress("My Progress")
print(progress)

print(progress[0])
print(progress[1])
print(progress[2])

class MyCustomState(cj.StateBase):
    def display(self, current_value, max_value, *args, **kwargs):
        return f'{current_value} -> {max_value}'
    def done(self, *args, **kwargs):
        return f'FINISHED'

progress[0] = MyCustomState

for i in progress(range(1, 500)):
    time.sleep(1/i)
With statement
import cereja as cj
import time

with cj.Progress("My Progress") as prog:
    time.sleep(5)
    for i in prog(range(1, 500)):
        time.sleep(1/i)

See Usage - Jupyter Notebook

License

This project is licensed under the MIT License - see the LICENSE file for details

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

cereja-1.1.4.post1.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

cereja-1.1.4.post1-py3-none-any.whl (52.4 kB view details)

Uploaded Python 3

File details

Details for the file cereja-1.1.4.post1.tar.gz.

File metadata

  • Download URL: cereja-1.1.4.post1.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for cereja-1.1.4.post1.tar.gz
Algorithm Hash digest
SHA256 c7468b7c51451b39095b9dbe3648594a9a34bab9a51f9e98fc54ba5f611efe3e
MD5 a2473afb6a5b5bb89145c899fd1fc6f1
BLAKE2b-256 58a0f34d1c651ad75bc33d6721c5ed30748b5d86e97808b6a793426a0aff95bd

See more details on using hashes here.

File details

Details for the file cereja-1.1.4.post1-py3-none-any.whl.

File metadata

  • Download URL: cereja-1.1.4.post1-py3-none-any.whl
  • Upload date:
  • Size: 52.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for cereja-1.1.4.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 290b72d5e38582ead7994ae93fd81afb3e3f950ef58d2c6c587017c17be046a0
MD5 c24c7da6146bf6b7ee9311eea2638b4b
BLAKE2b-256 92ebb896f694fc721db6f4b5fd8a0e38f4bde53de5a1983452945b96cb781936

See more details on using hashes here.

Supported by

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