Skip to main content
![](resources/markovx_banner.png)

### Intro ###
[Markov Chains](https://en.wikipedia.org/wiki/Markov_chain) implementation <br>

### Installation ###
in your terminal:

> pip install markovx

### Examples ###

Adding Chains
```python
from markovx.models import MarkovModel

mx = MarkovModel()
mx.add_one('123456')
mx.add_one('qwerty')
mx.add_many(['admin', 'root', 'user'])
```

Generating Chains
```python
mx.generate(6) # len of tokens in chain
```
```python
mx.generate(6, random_init=True)
# when True first token in chain would be assigned randomly
# when False first token would be assigned based on observed firs tokens
# default to False
```
```python
mx.generate(6, smart_ending=True)
# when False chain wouldn't be terminated before len(chain) == n even if model got to an end token
# when True if model got to an end token while len(chain) < n chain would terminate
# default to False
```
Ordinal Markov Chains (position dependent chains)
```python
from markovx.models import OrdinalMarkovModel

mx = OrdinalMarkovModel()
mx.add_one('123456')
mx.add_one('123qwe')
mx.add_many(['qwerty', 'qwe123', 'qwe123456'])
mx.generate(6)
```

### Contact ###
[Tal Peretz](https://www.linkedin.com/in/tal-per/)





Metadata

Release files for ezds 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ezds 1.0.0
File Size Uploaded
ezds-1.0.0.tar.gz 21.1 kB Details

Release files / ezds-1.0.0.tar.gz

Download URL ezds-1.0.0.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1475d05c46802acde6c8453fcee34fb7707575c9ea1495f46b2c0867f051adbd
BLAKE2b-256 checksum
How to use checksums
8b2278f66da2001e3a21adaf3a0ae54a5e07bd73a376956375d4b82a5a80577c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page