Instagram/LibCST hiện có 2.0k sao trên GitHub, viết chủ yếu bằng Python. A concrete syntax tree parser and serializer library for Python that preserves many aspects of Python's abstract syntax tree
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
.. |support-ukraine| image:: https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat&labelColor=005BBB
:alt: Support Ukraine - Help Provide Humanitarian Aid to Ukraine.
:target: https://opensource.fb.com/support-ukraine
LibCST parses Python 3.0 -> 3.15 source code as a CST tree that keeps
all formatting details (comments, whitespaces, parentheses, etc). It's useful for
building automated refactoring (codemod) applications and linters.
.. intro-end
.. why-libcst-intro-start
LibCST creates a compromise between an Abstract Syntax Tree (AST) and a traditional
Concrete Syntax Tree (CST). By carefully reorganizing and naming node types and
fields, we've created a lossless CST that looks and feels like an AST.
.. why-libcst-intro-end
You can learn more about the value that LibCST provides <https://libcst.readthedocs.io/en/latest/why_libcst.html>__ and our motivations for the project <https://libcst.readthedocs.io/en/latest/motivation.html>__
in our documentation <https://libcst.readthedocs.io/en/latest/index.html>.
Try it out with notebook examples <https://mybinder.org/v2/gh/Instagram/LibCST/main?filepath=docs%2Fsource%2Ftutorial.ipynb>.
For a more detailed usage example, see our documentation <https://libcst.readthedocs.io/en/latest/tutorial.html>__.
Installation
LibCST requires Python 3.9+ and can be easily installed using most common Python
packaging tools. We recommend installing the latest stable release from
PyPI <https://pypi.org/project/libcst/>_ with pip:
.. code-block:: shell
pip install libcst
For parsing, LibCST ships with a native extension, so releases are distributed as binary
wheels as well as the source code. If a binary wheel is not available for your system
(Linux/Windows x86/x64 and Mac x64/arm are covered), you'll need a recent
Rust toolchain <https://rustup.rs>_ for installing.
Further Reading
Static Analysis at Scale: An Instagram Story. <https://instagram-engineering.com/static-analysis-at-scale-an-instagram-story-8f498ab71a0c>_
Refactoring Python with LibCST. <https://chairnerd.seatgeek.com/refactoring-python-with-libcst/>_
Development
See CONTRIBUTING.md <CONTRIBUTING.md>_ for more details.
Building
In order to build LibCST, which includes a native parser module, you
will need to have the Rust build tool ``cargo`` on your path. You can
usually install ``cargo`` using your system package manager, but the
most popular way to install cargo is using
`rustup <https://rustup.rs/>`_.
To build just the native parser, do the following from the ``native``
directory:
.. code-block:: shell
cargo build
The ``libcst.native`` module should be rebuilt automatically, but to force it:
.. code-block:: shell
uv sync --reinstall-package libcst
Type Checking
We use Pyre <https://github.com/facebook/pyre-check>_ for type-checking.
To verify types for the library, do the following in the root:
.. code-block:: shell
uv run poe typecheck
Generating Documents
To generate documents, do the following in the root:
.. code-block:: shell
uv run --group docs poe docs
Future
======
- Advanced full repository facts providers like fully qualified name and call graph.
License
=======
LibCST is `MIT licensed <LICENSE>`_, as found in the LICENSE file.
.. fb-docs-start
Privacy Policy and Terms of Use
===============================
- `Privacy Policy <https://opensource.facebook.com/legal/privacy>`_
- `Terms of Use <https://opensource.facebook.com/legal/terms>`_
.. fb-docs-end
Acknowledgements
================
- Guido van Rossum for creating the parser generator pgen2 (originally used in lib2to3 and forked into parso).
- David Halter for parso which provides the parser and tokenizer that LibCST sits on top of.
- Zac Hatfield-Dodds for hypothesis integration which continues to help us find bugs.
- Zach Hammer improved type annotation for Mypy compatibility.
Instagram/LibCST có 2.0k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/Instagram/LibCST. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
Instagram/LibCST có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho Instagram/LibCST. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
Instagram/LibCST còn đang phát triển không?
Commit gần nhất trên Instagram/LibCST là 3 tháng trước (theo timestamp GitHub). Repo có 240 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Instagram/LibCST là gì?
Instagram/LibCST (Instagram/LibCST) là dự án Python trên GitHub. Theo mô tả gốc: A concrete syntax tree parser and serializer library for Python that preserves many aspects of Python's abstract syntax tree
Instagram/LibCST viết bằng ngôn ngữ gì?
Instagram/LibCST chủ yếu viết bằng Python. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về LibCST?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về LibCST.