Skip to main content

A Procedural Generation Python Lib

Project description

PyMaktube

a Python Library for Procedural Pseudo Randon Generation

Instalation from pip

pip install PyMakTub

Instalation from github

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.2.tar.gz (50.0 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.2-py3-none-any.whl (51.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymaktub-0.1.2.tar.gz
  • Upload date:
  • Size: 50.0 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.2.tar.gz
Algorithm Hash digest
SHA256 0031344146641bceda544927003e5326be1001c0cc0e33462d53206887ce35e4
MD5 08c997d168a95bcbfdbdfd0d1c41028a
BLAKE2b-256 82f3e1f9f399dc26f4f4f3d1831d2d2f3330f911af9d258cd823685dfcc497a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMakTub-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 902e11597a50acd06dcd756487d04c614d63e7641c357ec80cb022be0d66ded0
MD5 5aa308fb397533cc022fe026d07c6f1f
BLAKE2b-256 dd63651c24ef198f3ee9ba1ca0b5dc7ff05d7fa99435091e64a37b7be1c8a026

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