#python

py_literal

Read and write Python literals

7 unstable releases (3 breaking)

0.4.0 Apr 7, 2021
0.3.0 Jan 20, 2021
0.2.2 Feb 23, 2020
0.2.1 Sep 24, 2019
0.1.1 Apr 22, 2018

#111 in Parser implementations

Download history 596/week @ 2020-12-23 1032/week @ 2020-12-30 1215/week @ 2021-01-06 1181/week @ 2021-01-13 1588/week @ 2021-01-20 1565/week @ 2021-01-27 1709/week @ 2021-02-03 2111/week @ 2021-02-10 1790/week @ 2021-02-17 1844/week @ 2021-02-24 1962/week @ 2021-03-03 1912/week @ 2021-03-10 1632/week @ 2021-03-17 1710/week @ 2021-03-24 1249/week @ 2021-03-31 1455/week @ 2021-04-07

7,032 downloads per month
Used in 9 crates (2 directly)

MIT/Apache

52KB
1K SLoC

py_literal

Continuous integration Coverage Dependencies status Crate Documentation

This is a pure-Rust crate for parsing/formatting Python literals. See the documentation for more information.

This crate is a work-in-progress. The goal is for the parser to support everything ast.literal_eval() does, but it supports only a subset. See the docs for the FromStr implementation for Value for details.

Releases

  • 0.4.0

    • Updated num-bigint and num-complex dependencies to 0.4.
  • 0.3.0

    • Updated num-bigint and num-complex dependencies to 0.3.
    • Disabled default features of num-complex and num-traits dependencies.
    • Disabled std feature of num-bigint dependency.
    • Bumped required Rust version to 1.42.
  • 0.2.2

    • Updated pest and pest_derive dependencies to 2.0, by @nagisa.
  • 0.2.1

    • Added .is_*() and .as_*() methods to Value.
    • Updated to the new style of Error. (Implemented source, and removed the non-default implementations of description and cause.)
    • Bumped required Rust version to 1.33.
  • 0.2.0

    • Updated num-* dependencies to 0.2.
    • Switched from depending on all of num to depending on the individual num-* crates.
  • 0.1.1

    • Improved crate metadata and documentation (no functional changes).
  • 0.1.0

    • Initial release.

Contributing

Please feel free to create issues and submit PRs. PRs adding more tests would be especially appreciated.

License

Copyright 2018–2021 Jim Turner and py_literal developers

Licensed under the Apache License, Version 2.0, or the MIT license, at your option. You may not use this project except in compliance with those terms.

Dependencies

~2.5MB
~55K SLoC