# FsSpreadsheet
Spreadsheet creation and manipulation in FSharp
<table>
<thead>
<tr>
<th>Latest Release</th>
<th>Downloads</th>
<th>Target</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="https://pypi.org/project/fsspreadsheet/">
<img src="https://img.shields.io/pypi/v/fsspreadsheet?logo=pypi" alt="latest release" />
</a>
</td>
<td>
<a href="https://pepy.tech/project/siren-dsl">
<img alt="Pepy Total Downlods" src="https://img.shields.io/pepy/dt/siren-dsl?label=fsspreadsheet&color=blue" />
</a>
</td>
<td>Python</td>
</tr>
<!-- js package -->
<tr>
<td>
<a href="https://www.npmjs.com/package/@fslab/fsspreadsheet">
<img src="https://img.shields.io/npm/v/@fslab/fsspreadsheet?logo=npm" alt="latest release" />
</a>
</td>
<td>
<a href="https://www.npmjs.com/package/@fslab/fsspreadsheet">
<img src="https://img.shields.io/npm/dt/@fslab/fsspreadsheet?label=@fslab/fsspreadsheet" alt="downloads" />
</a>
</td>
<td>JavaScript</td>
</tr>
<!-- f# nuget package core -->
<tr>
<td>
<a href="https://www.nuget.org/packages/FsSpreadsheet/">
<img src="https://img.shields.io/nuget/v/FsSpreadsheet?logo=nuget" alt="latest release" />
</a>
</td>
<td>
<a href="https://www.nuget.org/packages/FsSpreadsheet/">
<img src="https://img.shields.io/nuget/dt/FsSpreadsheet?label=FsSpreadsheet" alt="downloads" />
</a>
</td>
<td></td>
</tr>
<!-- f# nuget package net -->
<tr>
<td>
<a href="https://www.nuget.org/packages/FsSpreadsheet.Net/">
<img src="https://img.shields.io/nuget/v/FsSpreadsheet.Net?logo=nuget" alt="latest release" />
</a>
</td>
<td>
<a href="https://www.nuget.org/packages/FsSpreadsheet.Net/">
<img src="https://img.shields.io/nuget/dt/FsSpreadsheet.Net?label=FsSpreadsheet.Net" alt="downloads" />
</a>
</td>
<td>.NET</td>
</tr>
<!-- f# nuget package js -->
<tr>
<td>
<a href="https://www.nuget.org/packages/FsSpreadsheet.Js/">
<img src="https://img.shields.io/nuget/v/FsSpreadsheet.Js?logo=nuget" alt="latest release" />
</a>
</td>
<td>
<a href="https://www.nuget.org/packages/FsSpreadsheet.Js/">
<img src="https://img.shields.io/nuget/dt/FsSpreadsheet.Js?label=FsSpreadsheet.Js" alt="downloads" />
</a>
</td>
<td>Fable JavaScript</td>
</tr>
<!-- f# nuget package py -->
<tr>
<td>
<a href="https://www.nuget.org/packages/FsSpreadsheet.Py/">
<img src="https://img.shields.io/nuget/v/FsSpreadsheet.Py?logo=nuget" alt="latest release" />
</a>
</td>
<td>
<a href="https://www.nuget.org/packages/FsSpreadsheet.Py/">
<img src="https://img.shields.io/nuget/dt/FsSpreadsheet.Py?label=FsSpreadsheet.Py" alt="downloads" />
</a>
</td>
<td>Fable Python</td>
</tr>
</tbody>
</table>
## DSL
```fsharp
#r "nuget: FsSpreadsheet"
open FsSpreadsheet.DSL
let dslTree =
workbook {
sheet "MySheet" {
row {
cell {1}
cell {2}
cell {3}
}
row {
4
5
6
}
}
}
let spreadsheet = dslTree.Value.Parse()
```
## ExcelIO
```fsharp
#r "nuget: FsSpreadsheet.Net"
open FsSpreadsheet.Net
spreadsheet.ToFile(excelFilePath)
```
------->

## Code Examples
```fsharp
let tables = workbook.GetTables()
let worksheets = workbook.GetWorksheets()
// get worksheet and its table as tuple
let worksheetsAndTables =
tables
|> List.map (
fun t ->
let associatedWs =
worksheets
|> List.find (
fun ws ->
ws.Tables
|> List.exists (fun t2 -> t2.Name = t.Name)
)
associatedWs, t
)
```
## Development
### Requirements
- [nodejs and npm](https://nodejs.org/en/download)
- verify with `node --version` (Tested with v18.16.1)
- verify with `npm --version` (Tested with v9.2.0)
- [.NET SDK](https://dotnet.microsoft.com/en-us/download)
- verify with `dotnet --version` (Tested with 7.0.306)
- [Python](https://www.python.org/downloads/)
- verify with `py --version` (Tested with 3.12.2)
### Local Setup
1. Setup dotnet tools
`dotnet tool restore`
2. Install NPM dependencies
`npm install`
3. Setup python environment
`py -m venv .venv`
4. Install [Poetry](https://python-poetry.org/) and dependencies
1. `.\.venv\Scripts\python.exe -m pip install -U pip setuptools`
2. `.\.venv\Scripts\python.exe -m pip install poetry`
3. `.\.venv\Scripts\python.exe -m poetry install --no-root`
Verify correct setup with `./build.cmd runtests`
5. `build.cmd <target>` where `<target>` may be
- if `<target>` is empty, it just runs dotnet build after cleaning everything
- `runtests` to run unit tests
- `runtestsjs` to only run JS unit tests
- `runtestsdotnet` to only run .NET unit tests
- `runtestpy` to only run Python unit tests
- `releasenotes semver:<version>` where `<version>` may be `major`, `minor`, or `patch` to update RELEASE_NOTES.md
- `pack` to create a NuGet release
- `packprelease` to create a NuGet prerelease
- `builddocs` to create docs
- `builddocsprerelease` to create prerelease docs
- `watchdocs` to create docs and run them locally
- `watchdocsprelease` to create prerelease docs and run them locally
- `release` to create a NuGet, NPM, PyPI and GitHub release
Raw data
{
"_id": null,
"home_page": "https://fslab.org/FsSpreadsheet/",
"name": "fsspreadsheet",
"maintainer": "Oliver Maus",
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": null,
"author": "Heinrich Lukas Weil",
"author_email": "hlweil@outlook.de",
"download_url": "https://files.pythonhosted.org/packages/22/df/75e43413d9fe2fae86348f5df1176dfeadaf7cc2fc6302e51f1c308a6107/fsspreadsheet-6.3.1.tar.gz",
"platform": null,
"description": "# FsSpreadsheet\nSpreadsheet creation and manipulation in FSharp\n\n<table>\n <thead>\n <tr>\n <th>Latest Release</th>\n <th>Downloads</th>\n <th>Target</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\n <a href=\"https://pypi.org/project/fsspreadsheet/\">\n <img src=\"https://img.shields.io/pypi/v/fsspreadsheet?logo=pypi\" alt=\"latest release\" />\n </a>\n </td>\n <td>\n <a href=\"https://pepy.tech/project/siren-dsl\">\n <img alt=\"Pepy Total Downlods\" src=\"https://img.shields.io/pepy/dt/siren-dsl?label=fsspreadsheet&color=blue\" />\n </a>\n </td>\n <td>Python</td>\n </tr>\n <!-- js package -->\n <tr>\n <td>\n <a href=\"https://www.npmjs.com/package/@fslab/fsspreadsheet\">\n <img src=\"https://img.shields.io/npm/v/@fslab/fsspreadsheet?logo=npm\" alt=\"latest release\" />\n </a>\n </td>\n <td>\n <a href=\"https://www.npmjs.com/package/@fslab/fsspreadsheet\">\n <img src=\"https://img.shields.io/npm/dt/@fslab/fsspreadsheet?label=@fslab/fsspreadsheet\" alt=\"downloads\" />\n </a>\n </td>\n <td>JavaScript</td>\n </tr>\n <!-- f# nuget package core -->\n <tr>\n <td>\n <a href=\"https://www.nuget.org/packages/FsSpreadsheet/\">\n <img src=\"https://img.shields.io/nuget/v/FsSpreadsheet?logo=nuget\" alt=\"latest release\" />\n </a>\n </td>\n <td>\n <a href=\"https://www.nuget.org/packages/FsSpreadsheet/\">\n <img src=\"https://img.shields.io/nuget/dt/FsSpreadsheet?label=FsSpreadsheet\" alt=\"downloads\" />\n </a>\n </td>\n <td></td>\n </tr>\n <!-- f# nuget package net -->\n <tr>\n <td>\n <a href=\"https://www.nuget.org/packages/FsSpreadsheet.Net/\">\n <img src=\"https://img.shields.io/nuget/v/FsSpreadsheet.Net?logo=nuget\" alt=\"latest release\" />\n </a>\n </td>\n <td>\n <a href=\"https://www.nuget.org/packages/FsSpreadsheet.Net/\">\n <img src=\"https://img.shields.io/nuget/dt/FsSpreadsheet.Net?label=FsSpreadsheet.Net\" alt=\"downloads\" />\n </a>\n </td>\n <td>.NET</td>\n </tr>\n <!-- f# nuget package js -->\n <tr>\n <td>\n <a href=\"https://www.nuget.org/packages/FsSpreadsheet.Js/\">\n <img src=\"https://img.shields.io/nuget/v/FsSpreadsheet.Js?logo=nuget\" alt=\"latest release\" />\n </a>\n </td>\n <td>\n <a href=\"https://www.nuget.org/packages/FsSpreadsheet.Js/\">\n <img src=\"https://img.shields.io/nuget/dt/FsSpreadsheet.Js?label=FsSpreadsheet.Js\" alt=\"downloads\" />\n </a>\n </td>\n <td>Fable JavaScript</td>\n </tr>\n <!-- f# nuget package py -->\n <tr>\n <td>\n <a href=\"https://www.nuget.org/packages/FsSpreadsheet.Py/\">\n <img src=\"https://img.shields.io/nuget/v/FsSpreadsheet.Py?logo=nuget\" alt=\"latest release\" />\n </a>\n </td>\n <td>\n <a href=\"https://www.nuget.org/packages/FsSpreadsheet.Py/\">\n <img src=\"https://img.shields.io/nuget/dt/FsSpreadsheet.Py?label=FsSpreadsheet.Py\" alt=\"downloads\" />\n </a>\n </td>\n <td>Fable Python</td>\n </tr>\n </tbody>\n\n</table>\n\n## DSL \n```fsharp\n#r \"nuget: FsSpreadsheet\"\n\nopen FsSpreadsheet.DSL\n\nlet dslTree = \n\n workbook {\n sheet \"MySheet\" {\n row {\n cell {1}\n cell {2}\n cell {3}\n }\n row {\n 4\n 5\n 6\n }\n }\n }\n\n\nlet spreadsheet = dslTree.Value.Parse()\n```\n## ExcelIO\n\n```fsharp\n\n#r \"nuget: FsSpreadsheet.Net\"\n\nopen FsSpreadsheet.Net\n\nspreadsheet.ToFile(excelFilePath)\n\n```\n\n------->\n\n\n\n## Code Examples\n\n```fsharp\nlet tables = workbook.GetTables()\nlet worksheets = workbook.GetWorksheets()\n// get worksheet and its table as tuple\nlet worksheetsAndTables =\ntables\n|> List.map (\n fun t ->\n\tlet associatedWs = \n\t worksheets\n\t |> List.find (\n\t\tfun ws -> \n\t\t ws.Tables\n\t\t |> List.exists (fun t2 -> t2.Name = t.Name)\n\t )\n\tassociatedWs, t\n)\n```\n\n\n## Development\n\n### Requirements\n\n- [nodejs and npm](https://nodejs.org/en/download)\n - verify with `node --version` (Tested with v18.16.1)\n - verify with `npm --version` (Tested with v9.2.0)\n- [.NET SDK](https://dotnet.microsoft.com/en-us/download)\n - verify with `dotnet --version` (Tested with 7.0.306)\n- [Python](https://www.python.org/downloads/)\n - verify with `py --version` (Tested with 3.12.2)\n\n### Local Setup\n\n1. Setup dotnet tools\n\n `dotnet tool restore`\n\n2. Install NPM dependencies\n \n `npm install`\n\n3. Setup python environment\n \n `py -m venv .venv`\n\n4. Install [Poetry](https://python-poetry.org/) and dependencies\n\n 1. `.\\.venv\\Scripts\\python.exe -m pip install -U pip setuptools`\n 2. `.\\.venv\\Scripts\\python.exe -m pip install poetry`\n 3. `.\\.venv\\Scripts\\python.exe -m poetry install --no-root`\n\nVerify correct setup with `./build.cmd runtests` \n\n5. `build.cmd <target>` where `<target>` may be\n - if `<target>` is empty, it just runs dotnet build after cleaning everything\n - `runtests` to run unit tests\n - `runtestsjs` to only run JS unit tests\n\t - `runtestsdotnet` to only run .NET unit tests\n - `runtestpy` to only run Python unit tests\n - `releasenotes semver:<version>` where `<version>` may be `major`, `minor`, or `patch` to update RELEASE_NOTES.md\n - `pack` to create a NuGet release\n - `packprelease` to create a NuGet prerelease\n - `builddocs` to create docs\n - `builddocsprerelease` to create prerelease docs\n \t- `watchdocs` to create docs and run them locally\n \t- `watchdocsprelease` to create prerelease docs and run them locally\n - `release` to create a NuGet, NPM, PyPI and GitHub release \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Fable library for Spreadsheet creation and manipulation",
"version": "6.3.1",
"project_urls": {
"Documentation": "https://fslab.org/FsSpreadsheet/",
"Homepage": "https://fslab.org/FsSpreadsheet/",
"Repository": "https://github.com/fslaborg/FsSpreadsheet"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "55363ca5fd28edd8d0615acfe8b0bf19a4818611efc98ae53c57171618930608",
"md5": "9d4bd16817c713790116dfdb7afcddd2",
"sha256": "a01a6b9624fc04e995bc3d4e006e66365b7fd35255562ef9a50100af2ca77163"
},
"downloads": -1,
"filename": "fsspreadsheet-6.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9d4bd16817c713790116dfdb7afcddd2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 254455,
"upload_time": "2024-11-29T09:32:32",
"upload_time_iso_8601": "2024-11-29T09:32:32.339602Z",
"url": "https://files.pythonhosted.org/packages/55/36/3ca5fd28edd8d0615acfe8b0bf19a4818611efc98ae53c57171618930608/fsspreadsheet-6.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "22df75e43413d9fe2fae86348f5df1176dfeadaf7cc2fc6302e51f1c308a6107",
"md5": "cbf02ed745747ac47738aace50ba2cc6",
"sha256": "ebd1c5c71488fcdf5738f2b4dda2d339c8bce7834207afc5948dc6845ddff7dc"
},
"downloads": -1,
"filename": "fsspreadsheet-6.3.1.tar.gz",
"has_sig": false,
"md5_digest": "cbf02ed745747ac47738aace50ba2cc6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 184079,
"upload_time": "2024-11-29T09:32:34",
"upload_time_iso_8601": "2024-11-29T09:32:34.423844Z",
"url": "https://files.pythonhosted.org/packages/22/df/75e43413d9fe2fae86348f5df1176dfeadaf7cc2fc6302e51f1c308a6107/fsspreadsheet-6.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-29 09:32:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "fslaborg",
"github_project": "FsSpreadsheet",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "fsspreadsheet"
}