Name | natal-report JSON |
Version |
0.1.5
JSON |
| download |
home_page | None |
Summary | None |
upload_time | 2024-12-25 02:46:34 |
maintainer | None |
docs_url | None |
author | Kelvin Ng |
requires_python | <4.0,>=3.12 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# PDF Report for the Natal Package
[![ci-badge]][ci-url] [![pypi-badge]][pypi-url] [![MIT-badge]][MIT-url] [![black-badge]][black-url]
> generate PDF report for the [Natal] package
## Installation
- dependencies:
- [Natal]: for natal chart data and SVG paths
- [weasyprint]: PDF generation
- refer weasyprint docs for installing OS dependencies
- you may need to install [Pango] for text rendering
`pip install natal-report`
or install as optional dependency of [Natal]:
`pip install "natal[report]"`
## Usage
```python
from natal import Data, Config
from natal.config import Orb
from natal_report import Report
config = Config(
theme_type="mono",
orb=Orb(conjunction=2, opposition=2, trine=2, square=2, sextile=1),
)
mimi = Data(
name="Mimi",
utc_dt="1980-02-23 00:00",
lat=25.0375,
lon=121.5633,
config=config,
)
transit = Data(
name="transit",
utc_dt="2024-12-21 00:00",
lat=25.0375,
lon=121.5633,
)
report = Report(data1=mimi, data2=transit)
html = report.full_report
bytes_io = report.create_pdf(html)
with open("demo_report_mono.pdf", "wb") as f:
f.write(bytes_io.getbuffer())
```
- see [demo_report_light.pdf] for light theme with Birth Chart
- see [demo_report_mono.pdf] for mono theme with Transit Chart
[black-badge]: https://img.shields.io/badge/formatter-Black-black
[black-url]: https://github.com/psf/black
[ci-badge]: https://github.com/hoishing/natal-report/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/hoishing/natal-report/actions/workflows/ci.yml
[demo_report_light.pdf]: https://github.com/hoishing/natal-report/blob/main/demo_report_light.pdf
[demo_report_mono.pdf]: https://github.com/hoishing/natal-report/blob/main/demo_report_mono.pdf
[MIT-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[MIT-url]: https://github.com/hoishing/natal-report/blob/main/LICENSE
[Natal]: https://github.com/hoishing/natal
[Pango]: https://gitlab.gnome.org/GNOME/pango
[pypi-badge]: https://img.shields.io/pypi/v/natal-report
[pypi-url]: https://pypi.org/project/natal-report
[weasyprint]: https://doc.courtbouillon.org/weasyprint/stable/
Raw data
{
"_id": null,
"home_page": null,
"name": "natal-report",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": null,
"author": "Kelvin Ng",
"author_email": "hoishing@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/dc/3b/e5dedcf28a579d0bd81e73a9804a7897ceb9247cf9a4eee364f9d3f9d28d/natal_report-0.1.5.tar.gz",
"platform": null,
"description": "# PDF Report for the Natal Package\n\n[![ci-badge]][ci-url] [![pypi-badge]][pypi-url] [![MIT-badge]][MIT-url] [![black-badge]][black-url]\n\n> generate PDF report for the [Natal] package\n\n## Installation\n\n- dependencies:\n - [Natal]: for natal chart data and SVG paths\n - [weasyprint]: PDF generation\n - refer weasyprint docs for installing OS dependencies\n - you may need to install [Pango] for text rendering\n\n`pip install natal-report`\n\nor install as optional dependency of [Natal]:\n\n`pip install \"natal[report]\"`\n\n## Usage\n\n```python\nfrom natal import Data, Config\nfrom natal.config import Orb\nfrom natal_report import Report\n\nconfig = Config(\n theme_type=\"mono\",\n orb=Orb(conjunction=2, opposition=2, trine=2, square=2, sextile=1),\n)\n\nmimi = Data(\n name=\"Mimi\",\n utc_dt=\"1980-02-23 00:00\",\n lat=25.0375,\n lon=121.5633,\n config=config,\n)\n\ntransit = Data(\n name=\"transit\",\n utc_dt=\"2024-12-21 00:00\",\n lat=25.0375,\n lon=121.5633,\n)\n\nreport = Report(data1=mimi, data2=transit)\nhtml = report.full_report\nbytes_io = report.create_pdf(html)\n\nwith open(\"demo_report_mono.pdf\", \"wb\") as f:\n f.write(bytes_io.getbuffer())\n```\n\n- see [demo_report_light.pdf] for light theme with Birth Chart\n- see [demo_report_mono.pdf] for mono theme with Transit Chart\n\n[black-badge]: https://img.shields.io/badge/formatter-Black-black\n[black-url]: https://github.com/psf/black\n[ci-badge]: https://github.com/hoishing/natal-report/actions/workflows/ci.yml/badge.svg\n[ci-url]: https://github.com/hoishing/natal-report/actions/workflows/ci.yml\n[demo_report_light.pdf]: https://github.com/hoishing/natal-report/blob/main/demo_report_light.pdf\n[demo_report_mono.pdf]: https://github.com/hoishing/natal-report/blob/main/demo_report_mono.pdf\n[MIT-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[MIT-url]: https://github.com/hoishing/natal-report/blob/main/LICENSE\n[Natal]: https://github.com/hoishing/natal\n[Pango]: https://gitlab.gnome.org/GNOME/pango\n[pypi-badge]: https://img.shields.io/pypi/v/natal-report\n[pypi-url]: https://pypi.org/project/natal-report\n[weasyprint]: https://doc.courtbouillon.org/weasyprint/stable/\n",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "0.1.5",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a19b4069ba49d457bf30f3f55394a3f4ac38e7d1fdf67afad6e4bfa22d4e75c0",
"md5": "c8a10ba08601009b0434b92c51bd6f1c",
"sha256": "a6fa38ad652712f3203c6f42d67ba8939b2146203763c471476b2ff33a045247"
},
"downloads": -1,
"filename": "natal_report-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c8a10ba08601009b0434b92c51bd6f1c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 7041,
"upload_time": "2024-12-25T02:46:32",
"upload_time_iso_8601": "2024-12-25T02:46:32.260994Z",
"url": "https://files.pythonhosted.org/packages/a1/9b/4069ba49d457bf30f3f55394a3f4ac38e7d1fdf67afad6e4bfa22d4e75c0/natal_report-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dc3be5dedcf28a579d0bd81e73a9804a7897ceb9247cf9a4eee364f9d3f9d28d",
"md5": "7b0e6d19ef9b2a687909b83ada6be881",
"sha256": "597725b3fa8ab0bf30aeb8f2f1a885cfde4cc4d815a06d1e18ac6498c9e16e92"
},
"downloads": -1,
"filename": "natal_report-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "7b0e6d19ef9b2a687909b83ada6be881",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 6221,
"upload_time": "2024-12-25T02:46:34",
"upload_time_iso_8601": "2024-12-25T02:46:34.473646Z",
"url": "https://files.pythonhosted.org/packages/dc/3b/e5dedcf28a579d0bd81e73a9804a7897ceb9247cf9a4eee364f9d3f9d28d/natal_report-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-25 02:46:34",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "natal-report"
}