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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymaktub-0.1.1.tar.gz
  • Upload date:
  • Size: 50.2 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.1.tar.gz
Algorithm Hash digest
SHA256 51d4ae00e5dd4760a78972f4ccddc5fbe0b27dbba8e7fbe4467c0f45c4e89cd9
MD5 f27f4f7ec4a34c1180e264ada6230b2d
BLAKE2b-256 98fea639b113b929c2af26a8aab009071805869f9059449b4627dfd878ec13f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMakTub-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 86b7830bebe3b58825b7ea85a4586c85888cc7169e629a882b9a720c1c809bfe
MD5 0e93820eb36abc98caa369f4b285ba27
BLAKE2b-256 0ddae60c196bd734d1cbf9427cf09bb3f78318724ecbc17199c2b89c422cdc0f

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