FsSpreadsheet
Spreadsheet creation and manipulation in FSharp
| Latest Release | Downloads | Target |
|---|---|---|
|
|
|
Python |
|
|
|
JavaScript |
|
|
|
|
|
|
|
.NET |
|
|
|
Fable JavaScript |
|
|
|
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)
------->
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)
- verify with
- .NET SDK
- verify with
dotnet --version(Tested with 7.0.306)
- verify with
- Python
- verify with
py --version(Tested with 3.12.2)
- verify with
Local Setup
-
Setup dotnet tools
dotnet tool restore -
Install NPM dependencies
npm install -
Setup python environment
py -m venv .venv -
Install Poetry and dependencies
.\.venv\Scripts\python.exe -m pip install -U pip setuptools.\.venv\Scripts\python.exe -m pip install poetry.\.venv\Scripts\python.exe -m poetry install --no-root
Verify correct setup with ./build.cmd runtests
build.cmd <target>where<target>may be- if
<target>is empty, it just runs dotnet build after cleaning everything runteststo run unit testsruntestsjsto only run JS unit testsruntestsdotnetto only run .NET unit testsruntestpyto only run Python unit tests
releasenotes semver:<version>where<version>may bemajor,minor, orpatchto update RELEASE_NOTES.mdpackto create a NuGet releasepackpreleaseto create a NuGet prerelease
builddocsto create docsbuilddocsprereleaseto create prerelease docs
watchdocsto create docs and run them locallywatchdocspreleaseto create prerelease docs and run them locallyreleaseto create a NuGet, NPM, PyPI and GitHub release
- if
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)"
- If applicable, include issue number in test name as such:
- 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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
fsspreadsheet-7.0.1-py3-none-any.whl
(183.2 kB
view details)
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b04ec5859635f7e7b0e58d1fff16db8c9b79f3c0a2e051e1dc8b7c6deab3b088
|
|
| MD5 |
aca5dc000fb0d81952d55f318335d52b
|
|
| BLAKE2b-256 |
a006ff7bff567be89c3462fd2df81c4faa62ae00d51e53812ff0af4991f7c115
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e91fa38c9792b9833a1fade1abc3a491866db4fdbd2b52624dae373be006167a
|
|
| MD5 |
26415f397f2677290b25d504832876c0
|
|
| BLAKE2b-256 |
2655224b3094fe84c1b8a60931562236b184d9fe4f0e3ba8964494f2d1f5b027
|