Skip to main content

parsemon2

This is yet another attempt to bring monadic parsing to python. The problem the author saw with many other implementations is a limit to their composability. A lot of the times these otherwise quite well written implementations suffer pretty bad from pythons lack of TCO. This implementation uses trampolines to get around that.

Right now this implementation is nothing more but a toy, but the tests that come with this package show already that it’s parsing ability is not dependent on pythons recursion limit.

We also have error messages.

There is a (tested!) example implementation of a json parser included in the package. See src/parsemon/json.py for more information.

installation

This package should be available as a manylinux_2_24_x86_64 wheel on pypi. On a update to date linux machine pip should do the job just fine:

pip install parsemon2

Currently MS Windows and macOS are not supported.

building the package

Building the package from source can be done in multiple ways.

building from sdist

You need to have the rust toolchain installed. Check out your GNU/Linux distribution to learn how to install it. Another handy resource to consider is https://www.rust-lang.org/tools/install.

Now you can build the package from source via pip:

pip install setuptools_rust wheel
pip wheel parsemon2 --no-binary :all:

Now you should have a wheel for your platform in your working directory.

build from the repository

The easiest way to build wheels from the git repository is to use docker since there is a handy build script included in the repo. Make sure the your user has access to docker. Consult the documentation of your system for more information on how to install docker.

With docker installed run the following in the root folder of the source code repository:

bin/build-wheels

After the program finishes you should find wheels for various python versions in the dist/ directory.

documentation

If you want to learn about the library we recommend checking out our readthedocs page.

Changes

3.2.2

  • Further performance improvements

3.2.1

  • Fixed minor bug in error handling code

3.2.0

  • Slight performance improvements

  • Implement repeat combinator that tries to run a parser for a specified number of times

3.1.0

  • Serious peformance improvements were made

  • Minor bug fix in json example parser

3.0.1

  • Update README

3.0

  • Remove pyrsistent deque implementation

  • Improve fmap performance

  • Implement end-of-input parser

  • run_parser now returns a ParsingResult object instead of the raw value of the supplied parser

  • run_parser won’t fail if the parser did not consume all of the supplied input

  • Got rid of NotEnouhInput exception.

  • Drop official support for Python 3.6

  • Change semantics of until parser.

2.0

  • Parsers constructed with do can now take arguments

  • New parser for floating point numbers: parsmon.basic.floating_point

  • Implement x | y operator for parsers, it is a short hand for choice(x,y)

  • Improved performance parsing speed by factor 4 - 6

  • There is now an example of a parser included in this package. It is the worlds slowest json parser

1.1

  • Implement validators

  • chain now accepts 1 or more arguments

  • Implement do notation

  • New whitespace parser

  • New parser for integers

Metadata

Release files for parsemon2 3.2.2

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

Source distribution (sdist)

Source distribution for parsemon2 3.2.2
File Size Uploaded Provenance Actions
parsemon2-3.2.2.tar.gz 32.1 kB Without provenance Details for parsemon2-3.2.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for parsemon2 3.2.2
File Actions
parsemon2-3.2.2-cp39-cp39-manylinux_2_24_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.24+ x86-64 Details for parsemon2-3.2.2-cp39-cp39-manylinux_2_24_x86_64.whl
parsemon2-3.2.2-cp38-cp38-manylinux_2_24_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.24+ x86-64 Details for parsemon2-3.2.2-cp38-cp38-manylinux_2_24_x86_64.whl
parsemon2-3.2.2-cp38-cp38-manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details for parsemon2-3.2.2-cp38-cp38-manylinux2014_x86_64.whl
parsemon2-3.2.2-cp37-cp37m-manylinux_2_24_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.24+ x86-64 Details for parsemon2-3.2.2-cp37-cp37m-manylinux_2_24_x86_64.whl
parsemon2-3.2.2-cp36-cp36m-manylinux_2_24_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.24+ x86-64 Details for parsemon2-3.2.2-cp36-cp36m-manylinux_2_24_x86_64.whl

Total release size: 5.3 MB

Release files / parsemon2-3.2.2.tar.gz

Download URL parsemon2-3.2.2.tar.gz
Size 32.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a988f7b25bf3de04607776ab05444335b8d6a5c7a522832b23ebd419234868d2
BLAKE2b-256 checksum
How to use checksums
f27c9166b779a681b2d7d6e6c531fc9de4d3716334351812b3092b7d4475f3e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.2.0.post0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

Release files / parsemon2-3.2.2-cp39-cp39-manylinux_2_24_x86_64.whl

Download URL parsemon2-3.2.2-cp39-cp39-manylinux_2_24_x86_64.whl
Size 1.2 MB
Tags CPython 3.9 Linux glibc 2.24+ x86-64
SHA-256 checksum
How to use checksums
70e4a8286a2bc3536ad7a5e223868da820ef93fcdb7fa737f9aa0cb42399fbb8
BLAKE2b-256 checksum
How to use checksums
2e743675b0194395af2cb1be52dcb52fdc5665d23e77987fc90bb6bf73393e8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.2.0.post0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

Release files / parsemon2-3.2.2-cp38-cp38-manylinux_2_24_x86_64.whl

Download URL parsemon2-3.2.2-cp38-cp38-manylinux_2_24_x86_64.whl
Size 910.9 kB
Tags CPython 3.8 Linux glibc 2.24+ x86-64
SHA-256 checksum
How to use checksums
997f4aca3a251c63a131a91df7b3108f0576793c87580b138bfe9a368f91e243
BLAKE2b-256 checksum
How to use checksums
e4d8e5379a96cde3992e49da7e484f7458be7975c8437a703d9497792f72807c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.2.0.post0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

Release files / parsemon2-3.2.2-cp38-cp38-manylinux2014_x86_64.whl

Download URL parsemon2-3.2.2-cp38-cp38-manylinux2014_x86_64.whl
Size 910.9 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
9a84f3385a95fa044ba470ead5990c8df486001d5ac74fc92534d1327bf0775c
BLAKE2b-256 checksum
How to use checksums
01374c20685f2226aedeededfb33a11b6a0f9d2d1ce3d25fa3e903f213370d42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.2.0.post0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

Release files / parsemon2-3.2.2-cp37-cp37m-manylinux_2_24_x86_64.whl

Download URL parsemon2-3.2.2-cp37-cp37m-manylinux_2_24_x86_64.whl
Size 1.2 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.24+ x86-64
SHA-256 checksum
How to use checksums
53dcbeac54cb74e7411332bad5edc144af450b5065a7991265cbe6cfe122b005
BLAKE2b-256 checksum
How to use checksums
63af5d19744aed580db1839beaf82b085c2ee4bf76b650850da31cea7a985c66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.2.0.post0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

Release files / parsemon2-3.2.2-cp36-cp36m-manylinux_2_24_x86_64.whl

Download URL parsemon2-3.2.2-cp36-cp36m-manylinux_2_24_x86_64.whl
Size 1.2 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.24+ x86-64
SHA-256 checksum
How to use checksums
0b8a2375e52e3a893bd035b1e25cb3720965349ec04e401f088834278796562e
BLAKE2b-256 checksum
How to use checksums
9cd631a155731e6a64ced2646854a6c22815071843e91a40f492f04cc8c53e30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.2.0.post0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

Security for parsemon2 3.2.2

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.

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