Skip to content

Enhancements for Developer Contribution Experience #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- name: Setup python
Expand Down
137 changes: 135 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,137 @@
### PROJECT SPECIFIC ###

.~lock.*
__pycache__
/.ve
/tests/data/out/*.xlsx
/tests/data/*
!/tests/data/*.xlsx
/tests/data/out/*.xlsx

### PYTHON ###
# https://github.com/github/gitignore/blob/main/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
Expand All @@ -18,7 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

- Broken link in get_data_from_form_with_guide_spec function docs page
- Broken link in get_data_from_form_with_guide_spec function docs page

## [0.4.1] - 2020-08-12

Expand Down Expand Up @@ -56,4 +57,3 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed

- First Version

118 changes: 113 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,115 @@
# spreadsheet-forms
# Spreadsheet Forms

See:
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/OpenDataServices/spreadsheet-forms)

* https://spreadsheet-forms.readthedocs.io/en/latest/
* https://pypi.org/project/spreadsheetforms/
* or the docs/ directory in this repository
Spreadsheet Forms is a Python library that simplifies the process of working with data from forms in spreadsheets by converting them to and from JSON format.

With Spreadsheet Forms, you can:

- Generate blank spreadsheet templates for consistent data collection.
- Easily pre-fill spreadsheets with existing data for verification or updates.
- Convert structured spreadsheet data into JSON for convenient storage or processing.

A customisable guide form spreadsheet dictates the data's structure, ensuring precision and order in your workflow.

For more details on package distribution, visit [Spreadsheet Forms on PyPI](https://pypi.org/project/spreadsheetforms/).

## Getting Started

Ensure you have Python 3.7 or higher installed and then install Spreadsheet Forms using pip:

```bash
pip install spreadsheetforms
```

## Example Usage

The following example demonstrates how to use the [get_data_from_form](https://spreadsheet-forms.readthedocs.io/en/latest/api/get_data_from_form.html) function to extract data from a spreadsheet form:

```python
from spreadsheetforms.api import get_data_from_form, GetDataFromFormMissingWorksheetAction

data = get_data_from_form(
guide_filename,
in_filename,
date_format=None,
missing_worksheet_action=GetDataFromFormMissingWorksheetAction.RAISE_EXCEPTION
)
```

For detailed information on all available functions and their usage, please refer to our [comprehensive documentation](https://spreadsheet-forms.readthedocs.io/en/latest/).

## Developer Setup

To contribute to Spreadsheet Forms, start by cloning the repository and setting up a development environment:

### Quick Start

Clone the latest version of the repository:

```bash
git clone https://github.com/OpenDataServices/spreadsheet-forms.git
cd spreadsheet-forms
```

Create a virtual environment and activate it:

```bash
python3 -m venv .venv
source .venv/bin/activate
```

Install the package in editable mode with the development dependencies:

```bash
pip install '.[dev]'
```

### Testing

We use [pytest](https://docs.pytest.org/en/latest/) for testing.

To run the test suite in verbose mode:

```bash
pytest -v
```

### Docker

We use [Docker](https://www.docker.com/) to run LibreOffice in a container to review document outputs.

To build the LibreOffice container:

```bash
docker-compose up
```

### Documentation Editing

We use [Sphinx](https://www.sphinx-doc.org/en/master/) for documentation.

To build the documentation locally:

```bash
sphinx-build -M html ./docs ./docs/_build/html
open docs/_build/html/index.html
```

To hot reload the documentation locally:

```bash
sphinx-autobuild ./docs ./docs/_build/html
```

## Contributing

We welcome and encourage public contributions to Spreadsheet Forms!

Please read our [Developer Docs](https://opendataservices.gitbook.io/developer-docs/) for more information about how we get our work done at [Open Data Services](https://opendataservices.coop/).

You can also reach out to us on our [GitHub account](https://github.com/opendataservices).

## License

This project is licensed under the [MIT License](LICENSE).
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "2.1"
services:
libreoffice:
image: lscr.io/linuxserver/libreoffice:latest
container_name: libreoffice
security_opt:
- seccomp:unconfined
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
volumes:
- ./tests/data:/config
ports:
- 3000:3000
- 3001:3001
restart: unless-stopped
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"black==22.10.0",
"sphinx",
"sphinx_rtd_theme",
"sphinx-autobuild",
]
},
)