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.post2.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cereja-1.1.4.post2.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.post2.tar.gz
Algorithm Hash digest
SHA256 4818836e2af0503e789f284a5a57649c883805cd98756f79fced5fbb12fc4cab
MD5 bddb559049d98ed0302d6a562a432a92
BLAKE2b-256 b6cc5d33720803e7de2c5ae10e91d6dcb559360342e5105ba13fcb4bf0d03699

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cereja-1.1.4.post2-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.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e1ae6b79e323890a1ae1ee001baab9426c6d54a2c111d34c0d08d9b5eca41c9
MD5 3082c66135bde76237340f5db8a509ad
BLAKE2b-256 f1229549c75d339d22a0e9e6927c69f823274a43299e6c241c89a60c017399e8

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