# Beancount برگزیده

یک راهنمای منتخب برای اکوسیستم Beancount. Beancount یک سیستم حسابداری قدرتمند و متن‌باز است که از یک قالب متنی ساده برای مدیریت امور مالی شما با دقت حسابداری دوطرفه استفاده می‌کند. این صفحه لیست‌های جمع‌آوری شده توسط جامعه و بررسی‌های کلی اکوسیستم را در یک منبع جامع ترکیب می‌کند.

## چرا حسابداری متن‌ساده؟

حسابداری متن‌ساده (PTA) روشی برای مدیریت امور مالی با استفاده از فایل‌های متنی ساده و ابزارهای قدرتمند خط فرمان است. این رویکرد به شما مالکیت کامل داده‌هایتان را می‌دهد، ماندگاری آن‌ها را تضمین می‌کند و انعطاف‌پذیری بی‌نظیری برای اتوماسیون و تحلیل ارائه می‌دهد.

- **مرکز رسمی PTA:** [Plain Text Accounting](https://plaintextaccounting.org/)
- **مقدمه‌ای ساده:** [حسابداری برای ذهن‌های ساده با حسابداری متن‌ساده](https://dustri.org/b/accounting-for-the-simple-minds-with-plain-text-accounting.html)
- **از وب‌اپلیکیشن‌ها تا خط فرمان:** [حسابداری خط فرمان: از mint.com به Ledger](https://muehe.org/posts/command-line-accounting/)

***

## اکوسیستم Beancount

اکوسیستم Beancount مجموعه‌ای از ابزارها، پلاگین‌ها و منابعی است که حول یک موتور مرکزی ساخته شده‌اند. هر بخش نقش مشخصی در ایجاد یک گردش کار کامل برای مدیریت مالی ایفا می‌کند.

### ۱. هسته اصلی و منابع رسمی

این‌ها عناصر بنیادی Beancount هستند که توسط سازنده و مشارکت‌کنندگان رسمی نگهداری می‌شوند.

| منبع                 | توضیحات                                                                                                                                                                                                                                               |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Beancount (هسته)** | موتور پردازشی که فایل دفتر کل شما را می‌خواند، قوانین حسابداری دوطرفه را اجرا می‌کند و گزارش‌ها را تولید می‌کند. این هسته ابزارهای خط فرمان پایه‌ای مانند `bean-check` و `bean-format` را فراهم می‌کند. تمام ابزارهای دیگر بر پایه این ساخته شده‌اند. |
| **صفحه اصلی**        | [beancount.github.io](https://beancount.github.io/)                                                                                                                                                                                                   |
| **سورس کد**          | [github.com/beancount/beancount](https://github.com/beancount/beancount)                                                                                                                                                                              |
| **مستندات**          | [GitHub Pages](https://beancount.github.io/docs/) و [Google Docs](https://docs.google.com/document/d/1RaondTJCS_IUPBHFNdT8oqFKJjVJDsfsn6JEjBG04eA/edit)                                                                                               |
| **مشارکت‌های خارجی** | [لیست رسمی مشارکت‌های جامعه](https://beancount.github.io/docs/external_contributions.html)                                                                                                                                                            |
| **Beanquery**        | یک ابزار پرس‌وجوی قدرتمند و مشابه SQL (نسخه ۳) برای اجرای پرس‌وجوهای پیشرفته (مانند `SELECT ... FROM ... WHERE ...`) روی دفتر کل شما جهت تولید تحلیل‌های سفارشی.                                                                                      |

### ۲. رابط‌های کاربری

این ابزارها رابط‌های بصری برای بررسی و ویرایش داده‌های مالی شما فراهم می‌کنند.

| ابزار                      | توضیحات                                                                                                                                                                        |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Fava**                   | داشبورد وب نهایی و کامل برای Beancount. این ابزار نمودارهای تعاملی، جداول جزئیات، ویرایش در مرورگر و یک سیستم افزونه برای افزودن قابلیت‌هایی مانند بودجه‌بندی را ارائه می‌دهد. |
| **Fava-GTK**               | یک اپلیکیشن دسکتاپ بومی GNOME که Fava را برای یک تجربه دسکتاپ یکپارچه بسته‌بندی می‌کند.                                                                                        |
| **Beancount Mobile**       | یک اپلیکیشن موبایل برای ثبت داده‌ها جهت افزودن تراکنش‌ها در حین حرکت.                                                                                                          |
| **Beancount Telegram Bot** | یک ربات تلگرام برای افزودن سریع تراکنش‌ها به دفتر کل از طریق چت.                                                                                                               |

### ۳. وارد کردن تراکنش‌ها

وارد کردن (Importing) فرآیند تبدیل داده‌ها از موسسات مالی (مانند فایل‌های CSV بانکی یا PDF) به ورودی‌های Beancount است.

| ابزار                       | توضیحات                                                                                                                                                                  |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Beangulp (v3)**           | فریم‌ورک مدرن و مستقل برای ساخت واردکننده‌ها. این ابزار فایل‌های خارجی را از طریق اسکریپت‌های پایتون (پلاگین‌ها) پردازش می‌کند تا دستورالعمل‌های Beancount را تولید کند. |
| **Smart Importer**          | ابزاری که واردکننده‌ها را با یادگیری ماشین تقویت می‌کند تا به‌طور خودکار دسته‌بندی‌ها را پیش‌بینی و تخصیص دهد.                                                           |
| **Beancount Reds Ingestor** | مجموعه‌ای از واردکننده‌ها با یک کتابخانه مشترک برای مدیریت فایل‌های CSV و OFX.                                                                                           |
| **double-entry-generator**  | یک واردکننده مبتنی بر قانون که بر سرویس‌های چینی مانند Alipay و WeChat Pay تمرکز دارد.                                                                                   |

#### واردکننده‌های جامعه (بر اساس کشور)

مجموعه‌ای گسترده از اسکریپت‌ها برای بانک‌ها و سرویس‌های خاص که توسط جامعه نگهداری می‌شود.

- **چین**

  - Alipay / 支付宝: [deb-sig/double-entry-generator](https://github.com/deb-sig/double-entry-generator), [wzyboy/importer](https://github.com/wzyboy/awesome-beancount/blob/master/importers/alipay_acclog.py)
  - بانک بازرگانان چین (CMB): [کارت نقدی](https://github.com/wzyboy/awesome-beancount/blob/master/importers/cmb_debit_cards.py)، [کارت اعتباری](https://github.com/wzyboy/awesome-beancount/blob/master/importers/cmb_credit_cards.py)
  - WeChat Pay / 微信支付: [deb-sig/double-entry-generator](https://github.com/deb-sig/double-entry-generator)

- **فرانسه**

  - Caisse d'Epargne: [beancount-ce](https://github.com/ArthurFDLR/beancount-ce)
  - Boursorama, Amex: [Beancount-myTools](https://github.com/grostim/Beancount-myTools)

- **آلمان**

  - Commerzbank: [beancount-commerzbank](https://github.com/siddhantgoel/beancount-commerzbank)
  - Deutsche Kredit Bank (DKB): [beancount-dkb](https://github.com/siddhantgoel/beancount-dkb)
  - ING: [beancount-ing](https://github.com/siddhantgoel/beancount-ing)
  - N26: [beancount-n26](https://github.com/siddhantgoel/beancount-n26)
  - Volksbank & GLS-Bank: [beancount-importer-volksbank](https://github.com/Fjanks/beancount-importer-volksbank)

- **هند**
  - SBI, BOI, Paytm, HSBC, ICICI: [beancount-importers-india](https://github.com/dumbPy/beancount-importers-india)

- **هلند**
  - ABN AMRO: [beancount-abnamro](https://github.com/deepakg/beancount-abnamro)

- **سوئیس**

  - عمومی: [tariochbctools](https://tariochbctools.readthedocs.io/) (BCGE, Neon, Raiffeisen, ZKB, Fidelity)
  - Finpension: [drnuke-bean](https://github.com/Dr-Nuke/drnuke-bean?tab=readme-ov-file#finpension-importer)
  - PostFinance: [tariochbctools](https://github.com/tarioch/beancounttools/blob/master/src/tariochbctools/importers/postfinance/importer.py), [drnuke-bean](https://github.com/Dr-Nuke/drnuke-bean?tab=readme-ov-file#postfinance-importer-swiss)

- **بریتانیا**

  - Monzo, Revolut, Wise: [Evernight/beancount-importers](https://github.com/Evernight/beancount-importers/)
  - Revolut, Wise: [tariochbctools](https://tariochbctools.readthedocs.io/en/latest/importers.html#revolut)

- **ایالات متحده**

  - Amex, Chase, Citi, Schwab: [mterwill/gist](https://gist.github.com/mterwill/7fdcc573dc1aa158648aacd4e33786e8#file-importers-amex-py)
  - Capital One: [mtlynch/beancount-capitalone](https://github.com/mtlynch/beancount-capitalone)
  - Chase: [mtlynch/beancount-chase-bank](https://github.com/mtlynch/beancount-chase-bank), [ArthurFDLR/beancount-chase](https://github.com/ArthurFDLR/beancount-chase)
  - Clipper: [beancount-clipper](https://git.sr.ht/~goorzhel/beancount-clipper)
  - Mercury: [mtlynch/beancount-mercury](https://github.com/mtlynch/beancount-mercury)

- **بلاک‌چین**
  - [tariochbctools](https://tariochbctools.readthedocs.io/en/latest/importers.html#blockchain)

### ۴. پشتیبانی ویرایشگر و ابزارها

ابزارهایی که Beancount را در محیط توسعه شما ادغام می‌کنند تا ویرایش و نگهداری را ساده‌تر کنند.

- **پشتیبانی IDE:** پلاگین‌هایی که قابلیت‌هایی مانند برجسته‌سازی نحو (syntax highlighting)، تکمیل خودکار و بررسی آنی موجودی را فراهم می‌کنند.

  - [VSCode](https://marketplace.visualstudio.com/items?itemName=Lencerf.beancount)
  - [Emacs](https://github.com/beancount/beancount-mode)
  - [Vim](https://github.com/nathangrigg/vim-beancount)
  - [Zed](https://github.com/zed-extensions/beancount)
  - [Sublime Text](https://github.com/norseghost/sublime-beancount)
  - [Atom](https://atom.io/packages/beancount)
  - [Beancount Language Server](https://github.com/polarmutex/beancount-language-server) (برای هر ویرایشگر سازگار با LSP)

- **اتوماسیون و ابزارهای کاربردی:**

  - `bean-add`: افزودن تراکنش‌ها به‌صورت تعاملی از خط فرمان.
  - `beancount-black`: یک فرمت‌کننده کد با ساختار مشخص برای فایل‌های Beancount.
  - `beancount-categorizer`: دسته‌بندی خودکار تراکنش‌ها با استفاده از قوانین عبارت باقاعده (regex).
  - `beanahead`: مدیریت و پیش‌بینی تراکنش‌های آینده.

- **ابزارهای انتقال داده:** ابزارهایی برای تبدیل داده‌ها از سایر سیستم‌های حسابداری.

  - از GnuCash: [henriquebastos/gc-to-bc](https://github.com/henriquebastos/gnucash-to-beancount/), [dtrai2/gc-to-bc](https://github.com/dtrai2/gnucash-to-beancount/)
  - از Ledger/hledger: [travisdahlke/gist](https://gist.github.com/travisdahlke/71152286b0a8826249fe), [zacchiro/ledger2beancount](https://github.com/zacchiro/ledger2beancount)
  - از YNAB: [hoostus/beancount-ynab](https://github.com/hoostus/beancount-ynab)

### ۵. پلاگین‌ها (افزونه‌های دفتر کل)

ماژول‌های پایتون درون دفتر کل (In-ledger) که هنگام پردازش برای اجرای قوانین سفارشی، خودکارسازی تراکنش‌ها یا افزودن ویژگی‌های جدید اجرا می‌شوند.

- **بودجه‌بندی:**
  - [fava-envelope](https://github.com/polarmutex/fava-envelope): یک افزونه Fava برای بودجه‌بندی به روش پاکتی (envelope-style).

- **اتوماسیون و بررسی‌ها:**

  - [autobean.share](https://github.com/SEIAROTg/autobean/tree/master/autobean/share): تقسیم هزینه‌ها و مدیریت بدهی.
  - [autobean.sorted](https://github.com/SEIAROTg/autobean/tree/master/autobean/sorted): اطمینان از اینکه تراکنش‌ها به ترتیب زمانی مرتب شده‌اند.
  - [beancount-checkclosed](https://github.com/daniel-wells/beancount_checkclosed): بررسی خودکار برای موجودی صفر در حساب‌های بسته‌شده.

- **دست‌کاری داده‌ها:**

  - [autobean.narration](https://github.com/SEIAROTg/autobean/tree/master/autobean/narration): تولید خودکار شرح تراکنش‌ها.
  - [beancount-lazy-plugins.filter\_map](https://github.com/Evernight/beancount-lazy-plugins/tree/main?tab=readme-ov-file#filter_map): اعمال عملیات روی گروه فیلتر شده‌ای از تراکنش‌ها.

### ۶. منابع قیمت

اسکریپت‌هایی که قیمت‌های تاریخی و جاری کالاها، سهام و ارزها را برای ردیابی ارزش سرمایه‌گذاری دریافت می‌کنند.

- [beancount-exchangerates](https://github.com/xuhcc/beancount-exchangerates): برای ارزهای فیات از طریق APIهایی مانند `frankfurter.dev`.
- [pricehist](https://gitlab.com/chrisberkhout/pricehist): یک دریافت‌کننده قیمت چندمنبعی.
- [beancount-cryptoassets](https://github.com/xuhcc/beancount-cryptoassets): برای دریافت قیمت ارزهای دیجیتال.
- [tariochbctools](https://tariochbctools.readthedocs.io/): شامل یک منبع قیمت برای Interactive Brokers.

***

## آموزش و انجمن

### کتاب‌ها و راهنماهای جامع

- **ردیابی امور مالی شخصی با استفاده از پایتون:** کتابی که راهنمایی جامع برای ساخت یک سیستم مالی شخصی با Beancount ارائه می‌دهد. ([وب‌سایت](https://personalfinancespython.com/))
- **مجموعه وبلاگ چینی (BYVoid):** [بخش ۱: چرا؟](https://byvoid.com/zhs/blog/beancount-bookkeeping-1)، [بخش ۲: بدهکار و بستانکار](https://byvoid.com/zhs/blog/beancount-bookkeeping-2)

### پست‌های منتخب وبلاگ

- **انگلیسی**

  - [شمارش دانه‌ها - و بیشتر - با Beancount](https://lwn.net/Articles/751874/)
  - [مدیریت امور مالی شخصی با استفاده از پایتون](https://sgoel.dev/posts/managing-personal-finances-using-python/)
  - [معرفی بدون حاشیه Beancount](https://web.archive.org/web/20221119110728/https://blog.leononame.dev/2019/08/beancount/)

- **فرانسوی**
  - [Beancount یا حسابداری برای هکرها](https://cyril.deguet.com/fr/2015/09/03/beancount-comptabilite-pour-hackers/)

- **چینی**
  - [Beancount —— دفترداری دوطرفه در خط فرمان](https://wzyboy.im/post/1063.html)

### انجمن

- **لیست پستی:** [Google Groups](https://groups.google.com/g/beancount) (انجمن اصلی گفتگو)
- **گفتگوی زنده (IRC):** [#beancount در web.libera.chat](https://web.libera.chat/gamja/?channels=%23beancount)
- **تلگرام (چینی):** [t.me/beancount\_zh](https://t.me/beancount_zh)

***

## خدمات و اپلیکیشن‌های تجاری

برای کاربرانی که قدرت Beancount را بدون مدیریت زیرساخت توسط خودشان می‌خواهند.

| سرویس            | توضیحات                                                                                                                                                                                                                                                                            |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Beancount.io** | یک پلتفرم SaaS (نرم‌افزار به عنوان سرویس) که یک نمونه آماده Beancount و Fava را ارائه می‌دهد. همچنین اپلیکیشن‌های موبایل اختصاصی برای [iOS](https://apps.apple.com/app/id1527950512) و [Android](https://play.google.com/store/apps/details?id=io.beancount.android) ارائه می‌کند. |

## متن ساده را به کار بگیرید.

یک دفتر حساب در Beancount بسازید یا با راهنما، محیط خودتان را راه‌اندازی کنید.

[رایگان شروع کنید](https://beancount.io/sign-up/?next=%2Fledger%2F) [راهنمای شروع](https://beancount.io/fa/docs/getting-started)

## Where to look next

- [Sitemap](https://beancount.io/sitemap.xml) - all pages with hreflang alternates
- [LLMs index](https://beancount.io/llms.txt) - curated links for AI agents (also /llms-full.txt for full docs)
- [Documentation](https://beancount.io/docs) - every doc is also available as text/markdown via .md suffix or Accept negotiation
- [REST API reference](https://beancount.io/docs/api-reference) - interactive endpoints, schemas, authentication, and code samples
- [OpenAPI spec](https://beancount.io/openapi.json) - OpenAPI 3.1 spec for this website's public content endpoints; the product contract for ledger operations is at https://beancount.io/api-gateway/v1/openapi.json
- [GraphQL](https://beancount.io/graphql) - public, read-only content API over the blog and research logs (no credentials, no ledger data): 12 query fields over 23 types
- [MCP server](https://beancount.io/mcp) - Model Context Protocol at https://beancount.io/api-gateway/mcp
