Compare commits
No commits in common. "master" and "v0.2.0" have entirely different histories.
|
|
@ -1,22 +0,0 @@
|
|||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
commit-message:
|
||||
prefix: 💚 ci
|
||||
include: "scope"
|
||||
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
commit-message:
|
||||
prefix: ⬆️ dep-bump
|
||||
include: "scope"
|
||||
|
|
@ -2,9 +2,9 @@ name: Lint and test
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
branches: [ "**" ]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
|
@ -12,36 +12,34 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
||||
python_version: ["3.8", "3.9", "3.10"]
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Set up Python ${{ matrix.python_version }}
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
- name: Install poetry
|
||||
uses: abatilo/actions-poetry@v4
|
||||
with:
|
||||
poetry-version: "2.1.2"
|
||||
- name: Configure poetry
|
||||
run: |
|
||||
poetry config virtualenvs.create true --local
|
||||
poetry config virtualenvs.in-project true --local
|
||||
- uses: actions/cache@v4
|
||||
name: Define a cache for the virtual environment based on the dependencies lock file
|
||||
with:
|
||||
path: ./.venv
|
||||
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }}-venv
|
||||
- name: Install build dependencies
|
||||
run: sudo apt install -y libxml2-dev libxslt-dev
|
||||
- name: Install Dependencies
|
||||
run: poetry install
|
||||
- name: Lint with black
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
poetry run black --check --diff pandas_ods_reader/ tests/
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
poetry run pytest tests/
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python_version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
- uses: actions/cache@v2
|
||||
id: cache
|
||||
with:
|
||||
path: ${{ env.pythonLocation }}
|
||||
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-root
|
||||
- name: Install poetry
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install poetry
|
||||
- name: Configure poetry
|
||||
run: python -m poetry config virtualenvs.create false
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: python -m poetry install
|
||||
- name: Lint with black
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
black --check --diff pandas_ods_reader/ tests/
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
python -m pytest tests/
|
||||
|
|
|
|||
|
|
@ -33,9 +33,3 @@ venv/
|
|||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# mise
|
||||
mise.local.toml
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"""Imports an ods or fods file into a DataFrame object"""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Optional, List, Union
|
||||
|
||||
|
|
@ -37,11 +36,11 @@ def read_ods(
|
|||
"""
|
||||
path = file_or_path if isinstance(file_or_path, Path) else Path(file_or_path)
|
||||
if not path.is_file():
|
||||
raise FileNotFoundError(f"file {path} does not exist")
|
||||
backend = EXT_MAP.get(path.suffix, ods)
|
||||
raise FileNotFoundError(f"file {file_or_path} does not exist")
|
||||
backend = EXT_MAP.get(Path(file_or_path).suffix, ods)
|
||||
return algo.read_data(
|
||||
backend,
|
||||
path,
|
||||
Path(file_or_path),
|
||||
sheet,
|
||||
headers=headers,
|
||||
columns=columns or [],
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ def get_value(
|
|||
text = cell.find(TABLE_CELL_TEXT_TAG, namespaces=cell.nsmap)
|
||||
if text is None:
|
||||
return None, 0
|
||||
value: Union[str, float] = "".join(text.itertext())
|
||||
value: Union[str, float] = text.text or ""
|
||||
if parsed and is_float(cell):
|
||||
value = float(value)
|
||||
_n_repeated = cell.attrib.get(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"""Provides utility functions for the parser"""
|
||||
|
||||
import pandas as pd
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,40 +1,39 @@
|
|||
[tool.poetry]
|
||||
name = "pandas-ods-reader"
|
||||
version = "1.0.2"
|
||||
version = "0.2.0"
|
||||
description = "Read in .ods and .fods files and return a pandas.DataFrame."
|
||||
authors = ["iuvbio <iuvbio@users.noreply.github.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/iuvbio/pandas_ods_reader"
|
||||
keywords = ["data", "io", "pandas", "ods"]
|
||||
keywords = [ "data", "io", "pandas", "ods" ]
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Topic :: Utilities",
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Topic :: Utilities"
|
||||
]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.9,<4"
|
||||
ezodf = ">=0.3.2"
|
||||
lxml = ">=4.9.2"
|
||||
pandas = ">=2.2.3"
|
||||
python = ">=3.8.1,<3.12"
|
||||
ezodf = "^0.3.2"
|
||||
lxml = "^4.9.2"
|
||||
pandas = "^1.5.2"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
black = ">=22.10.0"
|
||||
pytest = ">=7.1.3"
|
||||
pytest-cov = ">=4.0.0"
|
||||
mypy = ">=0.991"
|
||||
flake8 = ">=6.0.0"
|
||||
pandas-stubs = ">=1.5.2.221213"
|
||||
types-lxml = ">=2022.11.8"
|
||||
commitizen = ">=2.38.0"
|
||||
pre-commit = ">=3.7.1"
|
||||
black = "^22.10.0"
|
||||
pytest = "^7.1.3"
|
||||
pytest-cov = "^4.0.0"
|
||||
mypy = "^0.991"
|
||||
flake8 = "^6.0.0"
|
||||
pandas-stubs = "^1.5.2.221213"
|
||||
types-lxml = "^2022.11.8"
|
||||
commitizen = "^2.38.0"
|
||||
|
||||
[tool.commitizen]
|
||||
name = "cz_conventional_commits"
|
||||
version = "0.2.0"
|
||||
tag_format = "v$version"
|
||||
version_provider = "poetry"
|
||||
version_files = ["pyproject.toml:version"]
|
||||
|
||||
[build-system]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"""Tests for core read_ods function with different files"""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pandas as pd
|
||||
|
|
|
|||
Loading…
Reference in New Issue