Skip to main content
<h1 align="center">
<br>
<a href="https://github.com/aabbfive/PPark">
<img src="PPark.svg" alt="PPark" width="200">
</a>
<br>
PPark
<br>
<br>
</h1>

<h4 align="center">The best lexing library available any python version confused (2.x, 3.x, PyPy...)</h4>

## &#x1F4BE; Install

Download the latest version of PPark from
the [GitHub releases](https://github.com/aabbfive/PPark/releases) page.


## &#x1F4AC; How to Contribute

### Get the code

```
$ git clone https://github.com/aabbfive/PPark.git
$ cd PPark
```

### Install the library

```
$ pip install PPark
```

#### Or

```
$ pip install git+https://github.com/aabbfive/PPark
```

### Examples

```
from PPark import Lexer
from PPark.constant import Keyword, Keywords

lexer = Lexer()
lexer.addRule('INTEGER', r'([0-9]+)')
lexer.addRule('OP', Keywords([
Keyword('}'),
Keyword('{'),
Keyword('^'),
Keyword(']'),
Keyword('['),
Keyword('>'),
Keyword('<'),
Keyword('='),
Keyword('.'),
Keyword('-'),
Keyword(','),
Keyword('+'),
Keyword('**'),
Keyword('*'),
Keyword('/'),
Keyword('//'),
Keyword('%'),
Keyword(')'),
Keyword('(')
]))
@lexer.on_match(r'"([^"\n]|(\\"))*"')
def STRING(token):
token.value = token.value[1:][:-1]
@lexer.on_match(r'[a-zA-Z_$]\w*')
def IDENTIFIER(token):
if keywords.contains(token.value):
token.type = token.value.upper()
return token
lexer.input("""
t = 12*2
""")
for token in lexer:
print(token)
```

## &#x00A9;&#xFE0F; License

MIT. Copyright (c) [Aabbfive](https://github.com/aabbfive).

Metadata

Release files for PPark 1.0.1

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

Source distribution (sdist)

Source distribution for PPark 1.0.1
File Size Uploaded Provenance Actions
PPark-1.0.1.tar.gz 3.3 kB Without provenance Details for PPark-1.0.1.tar.gz

Release files / PPark-1.0.1.tar.gz

Download URL PPark-1.0.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
445744646f67593a67148465f2fa55ea3982aed91b6423e126fba20b6da56142
BLAKE2b-256 checksum
How to use checksums
eaded7367a328247aa26e6649138950657062484d205f6b83a5003be9a383c07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for PPark 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

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