Skip to main content

A Procedural Generation Python Lib

Project description

PyMaktube

a Python Library for Procedural Pseudo Randon Generation

Instalation,for instalation just type:

pip install git+https://github.com/OUIsolutions/PyMaktube

Quick Usage

For making anything on Maktub , first you need to setup a seed, than you can generate numbers, itens ,choices , etc

Generating a Number

from PyMaktube.MakTub import MakTub

r = MakTub("your seed here")
print(r.generate_num(0,100))

Generating a Choice

from PyMaktube.MakTub import MakTub

r = MakTub("your seed here")
names = ["Mateus","Samuel","Danilo"]
print(r.choice(names))

Generating tokens

from PyMaktube.MakTub import MakTub
r = MakTub("your seed here")
size = 10
valid_chars = "ABCDEF"
print(r.generate_token(size,valid_chars))

Probabilitys

from PyMaktube.MakTub import MakTub
r = MakTub("your seed here")
p = r.new_probability()
a = p.add_probability(0.33)
b = p.add_probability(0.33)
c = p.add_probability(0.33)
result = p.perform()
if a  == result:
    print("generated A")
if b == result:
    print("generated B")
if c == result:
    print("generated C")

Multiple Generations

you can generate any itens you want with the same seed

from PyMaktube.MakTub import MakTub

r = MakTub("your seed here")

for i in range(0,100):
    print(r.generate_num(0,100))

skping generation

you also can skip genrations easly

from PyMaktube.MakTub import MakTub

r = MakTub("your seed here")
r.set_generation(5)# will skip the first 5
for i in range(0,100):
    print(r.generate_num(0,100))
print("generation ",r.get_generation())

Modifiyng the Seed

its possible to modify the seed , to test diferent results

from PyMaktube.MakTub import MakTub

r = MakTub("your seed here")
for i in range(0,10):
    r.set_seed(f'test {i}')
    print(r.generate_token())

Making randon seed modifications

from PyMaktube.MakTub import MakTub
from PyMaktube.MakTubSeqs import MakTubSeqs
r = MakTub("your seed here")
for i in range(0,10):
    r.aply_seed_modification([0,1,2],MakTubSeqs.ALFHA_NUNS)#will modfiy the first 3 chars
    print(r.get_seed())

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

pymaktub-0.1.0.tar.gz (50.1 kB view details)

Uploaded Source

Built Distribution

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

PyMakTub-0.1.0-py3-none-any.whl (51.7 kB view details)

Uploaded Python 3

File details

Details for the file pymaktub-0.1.0.tar.gz.

File metadata

  • Download URL: pymaktub-0.1.0.tar.gz
  • Upload date:
  • Size: 50.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for pymaktub-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ac6c3de279228cada94fce999c5d8363df069970b74780ce2d9ab05735582e09
MD5 3fa1534905e8281a7e0c5ab75e36dfc9
BLAKE2b-256 c3b7222a7ff390e5095c8c9f7211d6b7a6fae9458b0d41a9fe527167135a7dfc

See more details on using hashes here.

File details

Details for the file PyMakTub-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: PyMakTub-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for PyMakTub-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56a8e65627a75d37d1f59ddcd3ef0cc31b72f45e6f1c8bfe1c533a2e2e493774
MD5 f5a6b28262069bc6f625fa76737ec725
BLAKE2b-256 d6e984715caaa5c09787b4b8ca7333c245b92fc199a9fc05c2f6e27011acfbe5

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