Skip to main content

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

Contribution guidelines

  • Make sure that all contributions run on all three languages: F#, Javascript and Python
  • Please add failing tests prior to fixing a bug against which to code
    • If applicable, include issue number in test name as such: "worksOnFilledTable (issue #100)"
  • Make use of XML tags to comment your code as such:
    /// <summary>
    /// Checks if there is an FsCell at given column index of a given FsRow.
    /// </summary>
    /// <param name="colIndex">The number of the column where the presence of an FsCell shall be checked.</param>
    /// <param name="row"></param>
    static member hasCellAt colIndex (row : FsRow) =
       row.HasCellAt colIndex
    

Download files

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

Source Distribution

fsspreadsheet-7.0.1.tar.gz (121.0 kB view details)

Uploaded Source

Built Distribution

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

fsspreadsheet-7.0.1-py3-none-any.whl (183.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fsspreadsheet-7.0.1.tar.gz
  • Upload date:
  • Size: 121.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11

File hashes

Hashes for fsspreadsheet-7.0.1.tar.gz
Algorithm Hash digest
SHA256 b04ec5859635f7e7b0e58d1fff16db8c9b79f3c0a2e051e1dc8b7c6deab3b088
MD5 aca5dc000fb0d81952d55f318335d52b
BLAKE2b-256 a006ff7bff567be89c3462fd2df81c4faa62ae00d51e53812ff0af4991f7c115

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fsspreadsheet-7.0.1-py3-none-any.whl
  • Upload date:
  • Size: 183.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11

File hashes

Hashes for fsspreadsheet-7.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e91fa38c9792b9833a1fade1abc3a491866db4fdbd2b52624dae373be006167a
MD5 26415f397f2677290b25d504832876c0
BLAKE2b-256 2655224b3094fe84c1b8a60931562236b184d9fe4f0e3ba8964494f2d1f5b027

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

7.0.1 This release

2 files

6.3.1

2 files

6.3.0

2 files

6.2.0

2 files

6.1.3

2 files

6.1.2

2 files

6.1.1

2 files

6.1.0

2 files

6.0.1

2 files

6.0.0

2 files

5.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page