{"id":13523250,"url":"https://github.com/LaunchPlatform/beanhub-forms","last_synced_at":"2025-04-01T00:31:08.461Z","repository":{"id":193180138,"uuid":"688288170","full_name":"LaunchPlatform/beanhub-forms","owner":"LaunchPlatform","description":"Library for generating and processing BeanHub's custom forms","archived":false,"fork":false,"pushed_at":"2023-10-11T20:53:29.000Z","size":721,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-02T06:14:51.630Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LaunchPlatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-07T03:29:05.000Z","updated_at":"2024-06-23T06:00:06.000Z","dependencies_parsed_at":"2024-01-13T22:25:28.726Z","dependency_job_id":"ce1c127b-f719-4061-a92b-47de63c2438e","html_url":"https://github.com/LaunchPlatform/beanhub-forms","commit_stats":null,"previous_names":["launchplatform/beanhub-forms"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPlatform%2Fbeanhub-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPlatform%2Fbeanhub-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPlatform%2Fbeanhub-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPlatform%2Fbeanhub-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LaunchPlatform","download_url":"https://codeload.github.com/LaunchPlatform/beanhub-forms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222688173,"owners_count":17023297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:00:57.759Z","updated_at":"2024-11-02T07:31:28.883Z","avatar_url":"https://github.com/LaunchPlatform.png","language":"Python","funding_links":[],"categories":["Tools"],"sub_categories":["Misc"],"readme":"# beanhub-forms [![CircleCI](https://dl.circleci.com/status-badge/img/gh/LaunchPlatform/beanhub-forms/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/LaunchPlatform/beanhub-forms/tree/master)\n\nBeanHub Forms was originally developed by [BeanHub](https://beanhub.io) as a [product feature](https://beanhub.io/blog/2023/07/31/automating-beancount-data-input-with-beanhub-custom-forms/) for users to easily define their custom forms and templates for generating Beancount entries.\nThe BeanHub Forms feature was later extracted as a standalone library beanhub-forms and open-sourced under an MIT license.\nWith beanhub-forms, one can define a custom form like this in YAML file format:\n\n```yaml\nforms:\n- name: add-xyz-hours\n  display_name: \"Hours spent on XYZ contracting project\"\n  fields:\n  - name: date\n    type: date\n    display_name: \"Date\"\n    required: true\n  - name: hours\n    type: number\n    display_name: \"Hours\"\n    required: true\n  - name: rate\n    type: number\n    display_name: \"Rate (USD)\"\n    default: \"300\"\n    required: true\n  - name: narration\n    type: str\n    default: \"Hours spent on the software development project for client XYZ\"\n    display_name: \"Narration\"\n  operations:\n  - type: append\n    file: \"books/{{ date.year }}.bean\"\n    content: |\n      {{ date }} * {{ narration | tojson }}\n        Assets:AccountsReceivable:Contracting:XYZ      {{  hours }} XYZ.HOUR @ {{ rate }} USD\n        Income:Contracting:XYZ\n```\n\nAnd then use tools like [beanhub-cli](https://github.com/LaunchPlatform/beanhub-cli) command to launch a web app server locally:\n\n```bash\nbh form server\n```\n\nThen, the user can use the rendered form to input repeating similar Beancount entries easily.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://beanhub.io\"\u003e\u003cimg src=\"https://github.com/LaunchPlatform/beanhub-forms/raw/master/assets/forms-screenshot.png?raw=true\" alt=\"BeanHub Forms screenshot\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nAs you can see, the append operation with [Jinja2](https://jinja.palletsprojects.com/) template as the content is defined in the form doc schema:\n\n```yaml\n- type: append\n  file: \"books/{{ date.year }}.bean\"\n  content: |\n    {{ date }} * {{ narration | tojson }}\n      Assets:AccountsReceivable:Contracting:XYZ      {{  hours }} XYZ.HOUR @ {{ rate }} USD\n      Income:Contracting:XYZ\n```\n\nWhen you submit the form, the form input data will be used for rendering the template and appending the result to the target file.\n\n```beancount\n2023-10-11 * \"Hours spent on the software development project for client XYZ\"\n  Assets:AccountsReceivable:Contracting:XYZ      12 XYZ.HOUR @ 300 USD\n  Income:Contracting:XYZ\n```\n\nThe file name `file` can also be a Jinja2 template. The file name `books/{{ date.year }}.bean` with `2023` the input value in the form will end up as `books/2023.bean`.\nThis allows you to organize entries by dates or other variables into different files and folders easily.\n\nRead the [documentations here](https://beanhub-forms-docs.beanhub.io).\n\n# Sponsor\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://beanhub.io\"\u003e\u003cimg src=\"https://github.com/LaunchPlatform/beanhub-forms/raw/master/assets/beanhub.svg?raw=true\" alt=\"BeanHub logo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA modern accounting book service based on the most popular open source version control system [Git](https://git-scm.com/) and text-based double entry accounting book software [Beancount](https://beancount.github.io/docs/index.html).\n\n\n## Install\n\nThis library provides schema definition of the forms and the libraries for generating [WTForms](https://wtforms.readthedocs.io/) plus processing the form data.\nFor most users, you don't need to install beanhub-forms.\nYou can install [beanhub-cli](https://github.com/LaunchPlatform/beanhub-cli) instead if you only want to use it.\n\nTo install this library, simply run\n\n```bash\npip install beanhub-forms\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLaunchPlatform%2Fbeanhub-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLaunchPlatform%2Fbeanhub-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLaunchPlatform%2Fbeanhub-forms/lists"}