Skip to main content

Fable library for Spreadsheet creation and manipulation

Project description

FsSpreadsheet

Spreadsheet creation and manipulation in FSharp

Latest Release Downloads Target
latest release Pepy Total Downlods Python
latest release downloads JavaScript
latest release downloads
latest release downloads .NET
latest release downloads Fable JavaScript
latest release downloads Fable Python

DSL

#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

#r "nuget: FsSpreadsheet.Net"

open FsSpreadsheet.Net

spreadsheet.ToFile(excelFilePath)

------->

image

Code Examples

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
    • verify with node --version (Tested with v18.16.1)
    • verify with npm --version (Tested with v9.2.0)
  • .NET SDK
    • verify with dotnet --version (Tested with 7.0.306)
  • Python
    • 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 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

  1. 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

Project details


Download files

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

Source Distribution

fsspreadsheet-6.3.1.tar.gz (184.1 kB view details)

Uploaded Source

Built Distribution

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

fsspreadsheet-6.3.1-py3-none-any.whl (254.5 kB view details)

Uploaded Python 3

File details

Details for the file fsspreadsheet-6.3.1.tar.gz.

File metadata

  • Download URL: fsspreadsheet-6.3.1.tar.gz
  • Upload date:
  • Size: 184.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11

File hashes

Hashes for fsspreadsheet-6.3.1.tar.gz
Algorithm Hash digest
SHA256 ebd1c5c71488fcdf5738f2b4dda2d339c8bce7834207afc5948dc6845ddff7dc
MD5 cbf02ed745747ac47738aace50ba2cc6
BLAKE2b-256 22df75e43413d9fe2fae86348f5df1176dfeadaf7cc2fc6302e51f1c308a6107

See more details on using hashes here.

File details

Details for the file fsspreadsheet-6.3.1-py3-none-any.whl.

File metadata

  • Download URL: fsspreadsheet-6.3.1-py3-none-any.whl
  • Upload date:
  • Size: 254.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11

File hashes

Hashes for fsspreadsheet-6.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a01a6b9624fc04e995bc3d4e006e66365b7fd35255562ef9a50100af2ca77163
MD5 9d4bd16817c713790116dfdb7afcddd2
BLAKE2b-256 55363ca5fd28edd8d0615acfe8b0bf19a4818611efc98ae53c57171618930608

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