Skip to main content

A Python library for generating, validating and converting academic content using Typst format.

Project description

fabricatio-typst

A Python library for generating, validating and converting academic content using Typst format.

📦 Installation

This package is part of the fabricatio monorepo and can be installed as an optional dependency:

pip install fabricatio[typst]

Or install all components:

pip install fabricatio[full]

🔍 Overview

Provides tools for:

  • Generating academic article proposals and outlines This feature uses natural language processing and machine learning techniques to generate well - structured academic article proposals and outlines. It analyzes the research topic and relevant literature to come up with a comprehensive proposal that includes a proposed title, research problem, technical approaches, and an outline of the article's structure. For example, given a research topic on "The impact of climate change on coastal ecosystems", it can generate a proposal with a clear statement of the problem, possible methods for data collection and analysis, and an outline of the main sections of the article.
  • Writing full articles using RAG (Retrieval-Augmented Generation) The RAG - based article writing feature combines retrieval and generation capabilities. It retrieves relevant information from a knowledge base, such as academic papers, reports, and datasets, and uses this information to generate high - quality article content. For example, it can search for existing research on a particular topic, extract relevant facts and figures, and incorporate them into the article while maintaining a coherent narrative.
  • Converting LaTeX math to Typst format This feature is designed to help users convert LaTeX math expressions to the Typst format. It parses the LaTeX math code and translates it into the equivalent Typst syntax. This is useful for users who are migrating from LaTeX to Typst or want to use Typst for academic writing with math content. For example, it can convert a LaTeX equation like "(E = mc^2)" to the Typst format.
  • Managing bibliographies and citations The bibliography and citation management feature allows users to easily manage references in their academic articles. It can import bibliographic data from various sources, such as BibTeX files, and generate formatted citations and bibliographies in the desired style. For example, it can generate APA, MLA, or Chicago style citations and bibliographies based on the user's requirements.
  • Validating and improving article structure This feature checks the structure of the academic article for coherence and logical flow. It can identify issues such as missing sections, inconsistent headings, or weak transitions between paragraphs. It then provides suggestions for improving the structure, such as adding or reordering sections, and strengthening the connections between different parts of the article.

Built on top of Fabricatio's agent framework with support for asynchronous execution.

🧩 Usage Example

from fabricatio_typst.actions.article import GenerateArticleProposal
The `GenerateArticleProposal` class is responsible for generating article proposals. It takes a research topic or article briefing as input and uses a set of algorithms and templates to generate a detailed proposal. It interacts with other components of the library, such as the data models and retrieval mechanisms, to ensure the proposal is comprehensive and relevant.
from fabricatio_typst.models.article_proposal import ArticleProposal
The `ArticleProposal` model represents the generated article proposal. It contains attributes such as the title, research problem, technical approaches, and outline of the article. It provides methods for accessing and manipulating these attributes, as well as for validating the proposal's structure.


async def create_proposal():
    # Create a proposal based on a research topic
    proposer = GenerateArticleProposal()
    This line creates an instance of the `GenerateArticleProposal` class. Once created, the instance can be used to generate an article proposal by calling its `_execute` method with an appropriate article briefing.
    proposal: ArticleProposal = await proposer._execute(
    The `_execute` method of the `GenerateArticleProposal` class takes an article briefing as input and generates an `ArticleProposal` object. It performs a series of operations, such as retrieving relevant information, analyzing the topic, and applying templates, to generate the proposal.
        article_briefing="Research topic: The impact of climate change on coastal ecosystems"
    )

    print(f"Proposed title: {proposal.title}")
    print(f"Research problem: {proposal.focused_problem}")
    print(f"Technical approaches: {proposal.technical_approaches}")

📁 Structure

fabricatio-typst/
├── actions/          - Article generation workflows
│   ├── article.py    - Core article generation actions
│   └── article_rag.py- RAG-based content creation
├── capabilities/     - Citation and reference management
│   └── citation_rag.py
├── models/           - Data models for academic content
│   ├── article_base.py - Base classes for article components
│   ├── article_outline.py - Outline structure definitions
│   ├── article_proposal.py - Research proposal model
│   └── article_essence.py - Semantic fingerprint of papers
├── workflows/        - Predefined content generation pipelines
└── rust.pyi          - Rust extension interfaces

🔗 Dependencies

Built on top of other Fabricatio modules:

  • fabricatio-core - Core interfaces and utilities
  • fabricatio-rag - Retrieval-Augmented Generation capabilities
  • fabricatio-capabilities - Base capability patterns

Includes Rust extensions for:

  • TeX-to-Typst conversion
  • Bibliography management
  • Language detection
  • Text processing

📄 License

MIT – see LICENSE

GitHub: github.com/Whth/fabricatio

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fabricatio_typst-0.1.15-cp313-cp313-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.13Windows x86-64

fabricatio_typst-0.1.15-cp313-cp313-manylinux_2_34_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

fabricatio_typst-0.1.15-cp313-cp313-manylinux_2_34_aarch64.whl (3.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

fabricatio_typst-0.1.15-cp313-cp313-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fabricatio_typst-0.1.15-cp312-cp312-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.12Windows x86-64

fabricatio_typst-0.1.15-cp312-cp312-manylinux_2_34_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

fabricatio_typst-0.1.15-cp312-cp312-manylinux_2_34_aarch64.whl (3.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

fabricatio_typst-0.1.15-cp312-cp312-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file fabricatio_typst-0.1.15-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_typst-0.1.15-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 311010657742512743f66d5098159d2a81d24440097d6897d94daf21c74ace23
MD5 8881d76c8694fe2813e0def4fb4d00cf
BLAKE2b-256 716a299fe4e9abd478841f3a5a791e8fbd1acf50767f13d0355c6192c734d454

See more details on using hashes here.

File details

Details for the file fabricatio_typst-0.1.15-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fabricatio_typst-0.1.15-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e84abebf9e59b07c475b404dabb1344abd1e19b43e9f47174c929363a7563360
MD5 07f005bb0650c881257db6a2c7e9b696
BLAKE2b-256 b4ee348797f6d60a9f2a7023360be4e0e8bf814d88c84fbab65221cc899082b8

See more details on using hashes here.

File details

Details for the file fabricatio_typst-0.1.15-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for fabricatio_typst-0.1.15-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 6fbb9d45dd431bfd42f3904a39005183a81904b130043a1be6229d9b2dbea530
MD5 6274cb27878b776ad4e5cdfc0c162065
BLAKE2b-256 b35cfbf6dce140842f0f93124469fe2f9614f8d7ce516a301b6216ea75c03e4d

See more details on using hashes here.

File details

Details for the file fabricatio_typst-0.1.15-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fabricatio_typst-0.1.15-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00b59f51b7dcac8d7d8a9bcec8e0e9c86c9d1b06a34e861c19e15b2ce7633b63
MD5 3011a967c63b37311034e6624e304aeb
BLAKE2b-256 b1ea9f70680bd18fcbb47bee4aa68f22e1750b44b6f142b6fe374e1fbf919b06

See more details on using hashes here.

File details

Details for the file fabricatio_typst-0.1.15-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for fabricatio_typst-0.1.15-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f1df2deb3a5eb82e8da4a7c44d8031677ee05383b0ca4307f1cfba5423d5c95e
MD5 e5e18feaa5bb2645a187c2d78a06ceb8
BLAKE2b-256 416e3fe9519b87ef505ee3b0be6f59fdcf635b8bf501007141b9bdf62dc6d6b8

See more details on using hashes here.

File details

Details for the file fabricatio_typst-0.1.15-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fabricatio_typst-0.1.15-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d9cfb32ec7ae9ccc144a0f6561d73cbfed8147a1c48f5796a47a611a118de9b0
MD5 727ce66a653b2fba0ae4641022166490
BLAKE2b-256 59b7cc453ec776240a0148928fa312194ec1e0ed61dc835a5abdad9be2000aef

See more details on using hashes here.

File details

Details for the file fabricatio_typst-0.1.15-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for fabricatio_typst-0.1.15-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 3dc2a5108c8689c302d9fca6aff86618d708079dcc99fbee9f1e7f758bf1c29c
MD5 e71dc3d3144c474b53cbb67c0ca72af8
BLAKE2b-256 4c31ec2ed8de9ab4a307d46a448fa741256344266018abc91fb113b266295853

See more details on using hashes here.

File details

Details for the file fabricatio_typst-0.1.15-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fabricatio_typst-0.1.15-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fceeb11bee31247da67145ac7b5dd04be89b79ab6d0ba85f2b670f5016c14f98
MD5 ce3a05564d32f3e33216322e65131b4e
BLAKE2b-256 b4120af21cbe7ba2816e9351f98f14a6b999daa0022a9ff1a9fac2861699aa2c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page