etlplus 0.12.10__tar.gz → 0.12.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {etlplus-0.12.10/etlplus.egg-info → etlplus-0.12.12}/PKG-INFO +1 -1
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/cfg.py +2 -2
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/conf.py +2 -2
- etlplus-0.12.12/etlplus/file/dta.py +77 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/enums.py +9 -3
- etlplus-0.12.12/etlplus/file/hbs.py +78 -0
- etlplus-0.12.12/etlplus/file/hdf5.py +78 -0
- etlplus-0.12.12/etlplus/file/jinja2.py +78 -0
- etlplus-0.12.12/etlplus/file/mat.py +78 -0
- etlplus-0.12.12/etlplus/file/mustache.py +78 -0
- etlplus-0.12.12/etlplus/file/nc.py +78 -0
- etlplus-0.12.12/etlplus/file/numbers.py +75 -0
- etlplus-0.12.12/etlplus/file/ods.py +79 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/properties.py +13 -13
- etlplus-0.12.12/etlplus/file/rda.py +78 -0
- etlplus-0.12.12/etlplus/file/rds.py +78 -0
- etlplus-0.12.12/etlplus/file/sas7bdat.py +78 -0
- etlplus-0.12.12/etlplus/file/sav.py +77 -0
- etlplus-0.12.12/etlplus/file/sylk.py +77 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/toml.py +1 -1
- etlplus-0.12.12/etlplus/file/vm.py +78 -0
- etlplus-0.12.12/etlplus/file/wks.py +77 -0
- etlplus-0.12.12/etlplus/file/xlsm.py +79 -0
- etlplus-0.12.12/etlplus/file/xpt.py +78 -0
- etlplus-0.12.12/etlplus/file/zsav.py +77 -0
- {etlplus-0.12.10 → etlplus-0.12.12/etlplus.egg-info}/PKG-INFO +1 -1
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus.egg-info/SOURCES.txt +19 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/file/test_u_file_core.py +16 -2
- {etlplus-0.12.10 → etlplus-0.12.12}/.coveragerc +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/.editorconfig +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/.gitattributes +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/.github/actions/python-bootstrap/action.yml +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/.github/workflows/ci.yml +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/.gitignore +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/.pre-commit-config.yaml +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/.ruff.toml +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/CODE_OF_CONDUCT.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/CONTRIBUTING.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/DEMO.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/LICENSE +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/MANIFEST.in +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/Makefile +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/REFERENCES.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/SECURITY.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/SUPPORT.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/docs/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/docs/pipeline-guide.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/docs/snippets/installation_version.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/__main__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/__version__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/auth.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/config.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/endpoint_client.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/errors.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/pagination/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/pagination/client.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/pagination/config.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/pagination/paginator.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/rate_limiting/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/rate_limiting/config.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/rate_limiting/rate_limiter.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/request_manager.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/retry_manager.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/transport.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/api/types.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/cli/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/cli/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/cli/commands.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/cli/constants.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/cli/handlers.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/cli/io.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/cli/main.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/cli/options.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/cli/state.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/cli/types.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/config/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/config/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/config/connector.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/config/jobs.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/config/pipeline.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/config/profile.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/config/types.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/config/utils.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/database/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/database/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/database/ddl.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/database/engine.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/database/orm.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/database/schema.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/database/types.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/enums.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/extract.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/_imports.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/_io.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/accdb.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/arrow.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/avro.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/bson.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/cbor.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/core.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/csv.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/dat.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/duckdb.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/feather.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/fwf.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/gz.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/ini.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/ion.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/json.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/log.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/mdb.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/msgpack.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/ndjson.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/orc.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/parquet.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/pb.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/pbf.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/proto.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/psv.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/sqlite.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/stub.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/tab.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/tsv.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/txt.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/xls.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/xlsx.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/xml.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/yaml.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/file/zip.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/load.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/mixins.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/py.typed +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/run.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/run_helpers.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/templates/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/templates/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/templates/ddl.sql.j2 +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/templates/view.sql.j2 +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/transform.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/types.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/utils.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/validate.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/validation/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/validation/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus/validation/utils.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus.egg-info/dependency_links.txt +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus.egg-info/entry_points.txt +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus.egg-info/requires.txt +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/etlplus.egg-info/top_level.txt +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/examples/README.md +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/examples/configs/ddl_spec.yml +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/examples/configs/pipeline.yml +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/examples/data/sample.csv +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/examples/data/sample.json +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/examples/data/sample.xml +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/examples/data/sample.xsd +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/examples/data/sample.yaml +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/examples/quickstart_python.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/pyproject.toml +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/pytest.ini +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/setup.cfg +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/setup.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/__init__.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/conftest.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/integration/conftest.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/integration/test_i_cli.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/integration/test_i_examples_data_parity.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/integration/test_i_pagination_strategy.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/integration/test_i_pipeline_smoke.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/integration/test_i_pipeline_yaml_load.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/integration/test_i_run.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/integration/test_i_run_profile_pagination_defaults.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/integration/test_i_run_profile_rate_limit_defaults.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/conftest.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_auth.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_config.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_endpoint_client.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_mocks.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_pagination_client.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_pagination_config.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_paginator.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_rate_limit_config.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_rate_limiter.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_request_manager.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_retry_manager.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_transport.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/api/test_u_types.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/cli/conftest.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/cli/test_u_cli_handlers.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/cli/test_u_cli_io.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/cli/test_u_cli_main.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/cli/test_u_cli_state.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/config/test_u_config_utils.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/config/test_u_connector.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/config/test_u_jobs.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/config/test_u_pipeline.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/conftest.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/database/test_u_database_ddl.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/database/test_u_database_engine.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/database/test_u_database_orm.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/database/test_u_database_schema.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/file/test_u_file_enums.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/file/test_u_file_yaml.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_enums.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_extract.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_load.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_main.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_mixins.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_run.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_run_helpers.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_transform.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_utils.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_validate.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/test_u_version.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tests/unit/validation/test_u_validation_utils.py +0 -0
- {etlplus-0.12.10 → etlplus-0.12.12}/tools/update_demo_snippets.py +0 -0
|
@@ -5,8 +5,8 @@ Helpers for reading/writing config (CFG) files.
|
|
|
5
5
|
|
|
6
6
|
Notes
|
|
7
7
|
-----
|
|
8
|
-
- A
|
|
9
|
-
|
|
8
|
+
- A CFG file is a configuration file that may use various syntaxes, such as
|
|
9
|
+
INI, YAML, or custom formats.
|
|
10
10
|
- Common cases:
|
|
11
11
|
- INI-style key-value pairs with sections (such as in Python ecosystems,
|
|
12
12
|
using ``configparser``).
|
|
@@ -5,8 +5,8 @@ Helpers for reading/writing config (CONF) files.
|
|
|
5
5
|
|
|
6
6
|
Notes
|
|
7
7
|
-----
|
|
8
|
-
- A
|
|
9
|
-
|
|
8
|
+
- A CONF file is a configuration file that may use various syntaxes, such as
|
|
9
|
+
INI, YAML, or custom formats.
|
|
10
10
|
- Common cases:
|
|
11
11
|
- INI-style key-value pairs with sections.
|
|
12
12
|
- YAML-like structures with indentation.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""
|
|
2
|
+
:mod:`etlplus.file.dta` module.
|
|
3
|
+
|
|
4
|
+
Helpers for reading/writing Stata (DTA) data files.
|
|
5
|
+
|
|
6
|
+
Notes
|
|
7
|
+
-----
|
|
8
|
+
- Stata DTA files are binary files used by Stata statistical software that
|
|
9
|
+
store datasets with variables, labels, and data types.
|
|
10
|
+
- Common cases:
|
|
11
|
+
- Reading data for analysis in Python.
|
|
12
|
+
- Writing processed data back to Stata format.
|
|
13
|
+
- Rule of thumb:
|
|
14
|
+
- If you need to work with Stata data files, use this module for reading
|
|
15
|
+
and writing.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
|
|
22
|
+
from ..types import JSONData
|
|
23
|
+
from ..types import JSONList
|
|
24
|
+
from . import stub
|
|
25
|
+
|
|
26
|
+
# SECTION: EXPORTS ========================================================== #
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
'read',
|
|
31
|
+
'write',
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# SECTION: FUNCTIONS ======================================================== #
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def read(
|
|
39
|
+
path: Path,
|
|
40
|
+
) -> JSONList:
|
|
41
|
+
"""
|
|
42
|
+
Read DTA content from ``path``.
|
|
43
|
+
|
|
44
|
+
Parameters
|
|
45
|
+
----------
|
|
46
|
+
path : Path
|
|
47
|
+
Path to the DTA file on disk.
|
|
48
|
+
|
|
49
|
+
Returns
|
|
50
|
+
-------
|
|
51
|
+
JSONList
|
|
52
|
+
The list of dictionaries read from the DTA file.
|
|
53
|
+
"""
|
|
54
|
+
return stub.read(path, format_name='DTA')
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def write(
|
|
58
|
+
path: Path,
|
|
59
|
+
data: JSONData,
|
|
60
|
+
) -> int:
|
|
61
|
+
"""
|
|
62
|
+
Write ``data`` to DTA file at ``path`` and return record count.
|
|
63
|
+
|
|
64
|
+
Parameters
|
|
65
|
+
----------
|
|
66
|
+
path : Path
|
|
67
|
+
Path to the DTA file on disk.
|
|
68
|
+
data : JSONData
|
|
69
|
+
Data to write as DTA file. Should be a list of dictionaries or a
|
|
70
|
+
single dictionary.
|
|
71
|
+
|
|
72
|
+
Returns
|
|
73
|
+
-------
|
|
74
|
+
int
|
|
75
|
+
The number of rows written to the DTA file.
|
|
76
|
+
"""
|
|
77
|
+
return stub.write(path, data, format_name='DTA')
|
|
@@ -79,7 +79,7 @@ class FileFormat(CoercibleStrEnum):
|
|
|
79
79
|
INI = 'ini' # INI-style key-value pairs
|
|
80
80
|
JSON = 'json' # JavaScript Object Notation
|
|
81
81
|
NDJSON = 'ndjson' # Newline-Delimited JSON
|
|
82
|
-
|
|
82
|
+
PROPERTIES = 'properties' # Java-style key-value pairs
|
|
83
83
|
TOML = 'toml' # Tom's Obvious Minimal Language
|
|
84
84
|
XML = 'xml' # Extensible Markup Language
|
|
85
85
|
YAML = 'yaml' # YAML Ain't Markup Language
|
|
@@ -108,7 +108,7 @@ class FileFormat(CoercibleStrEnum):
|
|
|
108
108
|
|
|
109
109
|
# Spreadsheets
|
|
110
110
|
NUMBERS = 'numbers' # Apple Numbers spreadsheet
|
|
111
|
-
ODS = 'ods' # OpenDocument
|
|
111
|
+
ODS = 'ods' # OpenDocument spreadsheet
|
|
112
112
|
WKS = 'wks' # Lotus 1-2-3 spreadsheet
|
|
113
113
|
XLS = 'xls' # Microsoft Excel (BIFF); read-only
|
|
114
114
|
XLSM = 'xlsm' # Microsoft Excel Macro-Enabled (Open XML)
|
|
@@ -116,7 +116,7 @@ class FileFormat(CoercibleStrEnum):
|
|
|
116
116
|
|
|
117
117
|
# Statistical / scientific / numeric computing
|
|
118
118
|
DTA = 'dta' # Stata data file
|
|
119
|
-
|
|
119
|
+
HDF5 = 'hdf5' # Hierarchical Data Format
|
|
120
120
|
MAT = 'mat' # MATLAB data file
|
|
121
121
|
NC = 'nc' # NetCDF data file
|
|
122
122
|
RDA = 'rda' # RData workspace/object bundle
|
|
@@ -175,6 +175,12 @@ class FileFormat(CoercibleStrEnum):
|
|
|
175
175
|
|
|
176
176
|
# Domain-specific & less common
|
|
177
177
|
|
|
178
|
+
# Templates
|
|
179
|
+
HBS = 'hbs' # Handlebars
|
|
180
|
+
JINJA2 = 'jinja2' # Jinja2
|
|
181
|
+
MUSTACHE = 'mustache' # Mustache
|
|
182
|
+
VM = 'vm' # Apache Velocity
|
|
183
|
+
|
|
178
184
|
# -- Class Methods -- #
|
|
179
185
|
|
|
180
186
|
@classmethod
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""
|
|
2
|
+
:mod:`etlplus.file.hbs` module.
|
|
3
|
+
|
|
4
|
+
Helpers for reading/writing Handlebars (HBS) template files.
|
|
5
|
+
|
|
6
|
+
Notes
|
|
7
|
+
-----
|
|
8
|
+
- A Handlebars (HBS) template file is a text file used for generating HTML or
|
|
9
|
+
other text formats by combining templates with data.
|
|
10
|
+
- Common cases:
|
|
11
|
+
- HTML templates.
|
|
12
|
+
- Email templates.
|
|
13
|
+
- Configuration files.
|
|
14
|
+
- Rule of thumb:
|
|
15
|
+
- If you need to work with Handlebars template files, use this module for
|
|
16
|
+
reading and writing.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
from ..types import JSONData
|
|
24
|
+
from ..types import JSONList
|
|
25
|
+
from . import stub
|
|
26
|
+
|
|
27
|
+
# SECTION: EXPORTS ========================================================== #
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
'read',
|
|
32
|
+
'write',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# SECTION: FUNCTIONS ======================================================== #
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def read(
|
|
40
|
+
path: Path,
|
|
41
|
+
) -> JSONList:
|
|
42
|
+
"""
|
|
43
|
+
Read ZSAV content from ``path``.
|
|
44
|
+
|
|
45
|
+
Parameters
|
|
46
|
+
----------
|
|
47
|
+
path : Path
|
|
48
|
+
Path to the HBS file on disk.
|
|
49
|
+
|
|
50
|
+
Returns
|
|
51
|
+
-------
|
|
52
|
+
JSONList
|
|
53
|
+
The list of dictionaries read from the HBS file.
|
|
54
|
+
"""
|
|
55
|
+
return stub.read(path, format_name='HBS')
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def write(
|
|
59
|
+
path: Path,
|
|
60
|
+
data: JSONData,
|
|
61
|
+
) -> int:
|
|
62
|
+
"""
|
|
63
|
+
Write ``data`` to HBS file at ``path`` and return record count.
|
|
64
|
+
|
|
65
|
+
Parameters
|
|
66
|
+
----------
|
|
67
|
+
path : Path
|
|
68
|
+
Path to the HBS file on disk.
|
|
69
|
+
data : JSONData
|
|
70
|
+
Data to write as HBS file. Should be a list of dictionaries or a
|
|
71
|
+
single dictionary.
|
|
72
|
+
|
|
73
|
+
Returns
|
|
74
|
+
-------
|
|
75
|
+
int
|
|
76
|
+
The number of rows written to the HBS file.
|
|
77
|
+
"""
|
|
78
|
+
return stub.write(path, data, format_name='HBS')
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""
|
|
2
|
+
:mod:`etlplus.file.hdf5` module.
|
|
3
|
+
|
|
4
|
+
Helpers for reading/writing Hierarchical Data Format (HDF5) files.
|
|
5
|
+
|
|
6
|
+
Notes
|
|
7
|
+
-----
|
|
8
|
+
- A HDF5 file is a binary file format designed to store and organize large
|
|
9
|
+
amounts of data.
|
|
10
|
+
- Common cases:
|
|
11
|
+
- Scientific data storage and sharing.
|
|
12
|
+
- Large-scale data analysis.
|
|
13
|
+
- Hierarchical data organization.
|
|
14
|
+
- Rule of thumb:
|
|
15
|
+
- If the file follows the HDF5 specification, use this module for reading
|
|
16
|
+
and writing.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
from ..types import JSONData
|
|
24
|
+
from ..types import JSONList
|
|
25
|
+
from . import stub
|
|
26
|
+
|
|
27
|
+
# SECTION: EXPORTS ========================================================== #
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
'read',
|
|
32
|
+
'write',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# SECTION: FUNCTIONS ======================================================== #
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def read(
|
|
40
|
+
path: Path,
|
|
41
|
+
) -> JSONList:
|
|
42
|
+
"""
|
|
43
|
+
Read HDF5 content from ``path``.
|
|
44
|
+
|
|
45
|
+
Parameters
|
|
46
|
+
----------
|
|
47
|
+
path : Path
|
|
48
|
+
Path to the HDF5 file on disk.
|
|
49
|
+
|
|
50
|
+
Returns
|
|
51
|
+
-------
|
|
52
|
+
JSONList
|
|
53
|
+
The list of dictionaries read from the HDF5 file.
|
|
54
|
+
"""
|
|
55
|
+
return stub.read(path, format_name='HDF5')
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def write(
|
|
59
|
+
path: Path,
|
|
60
|
+
data: JSONData,
|
|
61
|
+
) -> int:
|
|
62
|
+
"""
|
|
63
|
+
Write ``data`` to HDF5 file at ``path`` and return record count.
|
|
64
|
+
|
|
65
|
+
Parameters
|
|
66
|
+
----------
|
|
67
|
+
path : Path
|
|
68
|
+
Path to the HDF5 file on disk.
|
|
69
|
+
data : JSONData
|
|
70
|
+
Data to write as HDF5 file. Should be a list of dictionaries or a
|
|
71
|
+
single dictionary.
|
|
72
|
+
|
|
73
|
+
Returns
|
|
74
|
+
-------
|
|
75
|
+
int
|
|
76
|
+
The number of rows written to the HDF5 file.
|
|
77
|
+
"""
|
|
78
|
+
return stub.write(path, data, format_name='HDF5')
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""
|
|
2
|
+
:mod:`etlplus.file.jinja2` module.
|
|
3
|
+
|
|
4
|
+
Helpers for reading/writing compressed Jinja2 (JINJA2) template files.
|
|
5
|
+
|
|
6
|
+
Notes
|
|
7
|
+
-----
|
|
8
|
+
- A JINJA2 file is a text file used for generating HTML or other text formats
|
|
9
|
+
by combining templates with data.
|
|
10
|
+
- Common cases:
|
|
11
|
+
- HTML templates.
|
|
12
|
+
- Email templates.
|
|
13
|
+
- Configuration files.
|
|
14
|
+
- Rule of thumb:
|
|
15
|
+
- If you need to work with Jinja2 template files, use this module for
|
|
16
|
+
reading and writing.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
from ..types import JSONData
|
|
24
|
+
from ..types import JSONList
|
|
25
|
+
from . import stub
|
|
26
|
+
|
|
27
|
+
# SECTION: EXPORTS ========================================================== #
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
'read',
|
|
32
|
+
'write',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# SECTION: FUNCTIONS ======================================================== #
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def read(
|
|
40
|
+
path: Path,
|
|
41
|
+
) -> JSONList:
|
|
42
|
+
"""
|
|
43
|
+
Read JINJA2 content from ``path``.
|
|
44
|
+
|
|
45
|
+
Parameters
|
|
46
|
+
----------
|
|
47
|
+
path : Path
|
|
48
|
+
Path to the JINJA2 file on disk.
|
|
49
|
+
|
|
50
|
+
Returns
|
|
51
|
+
-------
|
|
52
|
+
JSONList
|
|
53
|
+
The list of dictionaries read from the JINJA2 file.
|
|
54
|
+
"""
|
|
55
|
+
return stub.read(path, format_name='JINJA2')
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def write(
|
|
59
|
+
path: Path,
|
|
60
|
+
data: JSONData,
|
|
61
|
+
) -> int:
|
|
62
|
+
"""
|
|
63
|
+
Write ``data`` to JINJA2 file at ``path`` and return record count.
|
|
64
|
+
|
|
65
|
+
Parameters
|
|
66
|
+
----------
|
|
67
|
+
path : Path
|
|
68
|
+
Path to the JINJA2 file on disk.
|
|
69
|
+
data : JSONData
|
|
70
|
+
Data to write as JINJA2 file. Should be a list of dictionaries or a
|
|
71
|
+
single dictionary.
|
|
72
|
+
|
|
73
|
+
Returns
|
|
74
|
+
-------
|
|
75
|
+
int
|
|
76
|
+
The number of rows written to the JINJA2 file.
|
|
77
|
+
"""
|
|
78
|
+
return stub.write(path, data, format_name='JINJA2')
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""
|
|
2
|
+
:mod:`etlplus.file.mat` module.
|
|
3
|
+
|
|
4
|
+
Helpers for reading/writing MATLAB (MAT) data files.
|
|
5
|
+
|
|
6
|
+
Notes
|
|
7
|
+
-----
|
|
8
|
+
- A MAT file is a binary file format used by MATLAB to store variables,
|
|
9
|
+
arrays, and other data structures.
|
|
10
|
+
- Common cases:
|
|
11
|
+
- Storing numerical arrays and matrices.
|
|
12
|
+
- Saving workspace variables.
|
|
13
|
+
- Sharing data between MATLAB and other programming environments.
|
|
14
|
+
- Rule of thumb:
|
|
15
|
+
- If the file follows the MAT-file specification, use this module for
|
|
16
|
+
reading and writing.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
from ..types import JSONData
|
|
24
|
+
from ..types import JSONList
|
|
25
|
+
from . import stub
|
|
26
|
+
|
|
27
|
+
# SECTION: EXPORTS ========================================================== #
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
'read',
|
|
32
|
+
'write',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# SECTION: FUNCTIONS ======================================================== #
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def read(
|
|
40
|
+
path: Path,
|
|
41
|
+
) -> JSONList:
|
|
42
|
+
"""
|
|
43
|
+
Read MAT content from ``path``.
|
|
44
|
+
|
|
45
|
+
Parameters
|
|
46
|
+
----------
|
|
47
|
+
path : Path
|
|
48
|
+
Path to the MAT file on disk.
|
|
49
|
+
|
|
50
|
+
Returns
|
|
51
|
+
-------
|
|
52
|
+
JSONList
|
|
53
|
+
The list of dictionaries read from the MAT file.
|
|
54
|
+
"""
|
|
55
|
+
return stub.read(path, format_name='MAT')
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def write(
|
|
59
|
+
path: Path,
|
|
60
|
+
data: JSONData,
|
|
61
|
+
) -> int:
|
|
62
|
+
"""
|
|
63
|
+
Write ``data`` to MAT file at ``path`` and return record count.
|
|
64
|
+
|
|
65
|
+
Parameters
|
|
66
|
+
----------
|
|
67
|
+
path : Path
|
|
68
|
+
Path to the MAT file on disk.
|
|
69
|
+
data : JSONData
|
|
70
|
+
Data to write as MAT file. Should be a list of dictionaries or a
|
|
71
|
+
single dictionary.
|
|
72
|
+
|
|
73
|
+
Returns
|
|
74
|
+
-------
|
|
75
|
+
int
|
|
76
|
+
The number of rows written to the MAT file.
|
|
77
|
+
"""
|
|
78
|
+
return stub.write(path, data, format_name='MAT')
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""
|
|
2
|
+
:mod:`etlplus.file.mustache` module.
|
|
3
|
+
|
|
4
|
+
Helpers for reading/writing Mustache (MUSTACHE) template files.
|
|
5
|
+
|
|
6
|
+
Notes
|
|
7
|
+
-----
|
|
8
|
+
- A MUSTACHE file is a text file used for generating HTML or other text formats
|
|
9
|
+
by combining templates with data.
|
|
10
|
+
- Common cases:
|
|
11
|
+
- HTML templates.
|
|
12
|
+
- Email templates.
|
|
13
|
+
- Configuration files.
|
|
14
|
+
- Rule of thumb:
|
|
15
|
+
- If you need to work with Mustache template files, use this module for
|
|
16
|
+
reading and writing.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
from ..types import JSONData
|
|
24
|
+
from ..types import JSONList
|
|
25
|
+
from . import stub
|
|
26
|
+
|
|
27
|
+
# SECTION: EXPORTS ========================================================== #
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
'read',
|
|
32
|
+
'write',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# SECTION: FUNCTIONS ======================================================== #
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def read(
|
|
40
|
+
path: Path,
|
|
41
|
+
) -> JSONList:
|
|
42
|
+
"""
|
|
43
|
+
Read MUSTACHE content from ``path``.
|
|
44
|
+
|
|
45
|
+
Parameters
|
|
46
|
+
----------
|
|
47
|
+
path : Path
|
|
48
|
+
Path to the MUSTACHE file on disk.
|
|
49
|
+
|
|
50
|
+
Returns
|
|
51
|
+
-------
|
|
52
|
+
JSONList
|
|
53
|
+
The list of dictionaries read from the MUSTACHE file.
|
|
54
|
+
"""
|
|
55
|
+
return stub.read(path, format_name='MUSTACHE')
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def write(
|
|
59
|
+
path: Path,
|
|
60
|
+
data: JSONData,
|
|
61
|
+
) -> int:
|
|
62
|
+
"""
|
|
63
|
+
Write ``data`` to MUSTACHE file at ``path`` and return record count.
|
|
64
|
+
|
|
65
|
+
Parameters
|
|
66
|
+
----------
|
|
67
|
+
path : Path
|
|
68
|
+
Path to the MUSTACHE file on disk.
|
|
69
|
+
data : JSONData
|
|
70
|
+
Data to write as MUSTACHE file. Should be a list of dictionaries or a
|
|
71
|
+
single dictionary.
|
|
72
|
+
|
|
73
|
+
Returns
|
|
74
|
+
-------
|
|
75
|
+
int
|
|
76
|
+
The number of rows written to the MUSTACHE file.
|
|
77
|
+
"""
|
|
78
|
+
return stub.write(path, data, format_name='MUSTACHE')
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""
|
|
2
|
+
:mod:`etlplus.file.nc` module.
|
|
3
|
+
|
|
4
|
+
Helpers for reading/writing NetCDF (NC) data files.
|
|
5
|
+
|
|
6
|
+
Notes
|
|
7
|
+
-----
|
|
8
|
+
- A NC file is a binary file format used for array-oriented scientific data,
|
|
9
|
+
particularly in meteorology, oceanography, and climate science.
|
|
10
|
+
- Common cases:
|
|
11
|
+
- Storing multi-dimensional scientific data.
|
|
12
|
+
- Sharing large datasets in research communities.
|
|
13
|
+
- Efficient data access and manipulation.
|
|
14
|
+
- Rule of thumb:
|
|
15
|
+
- If the file follows the NetCDF standard, use this module for
|
|
16
|
+
reading and writing.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
from ..types import JSONData
|
|
24
|
+
from ..types import JSONList
|
|
25
|
+
from . import stub
|
|
26
|
+
|
|
27
|
+
# SECTION: EXPORTS ========================================================== #
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
'read',
|
|
32
|
+
'write',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# SECTION: FUNCTIONS ======================================================== #
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def read(
|
|
40
|
+
path: Path,
|
|
41
|
+
) -> JSONList:
|
|
42
|
+
"""
|
|
43
|
+
Read NC content from ``path``.
|
|
44
|
+
|
|
45
|
+
Parameters
|
|
46
|
+
----------
|
|
47
|
+
path : Path
|
|
48
|
+
Path to the NC file on disk.
|
|
49
|
+
|
|
50
|
+
Returns
|
|
51
|
+
-------
|
|
52
|
+
JSONList
|
|
53
|
+
The list of dictionaries read from the NC file.
|
|
54
|
+
"""
|
|
55
|
+
return stub.read(path, format_name='NC')
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def write(
|
|
59
|
+
path: Path,
|
|
60
|
+
data: JSONData,
|
|
61
|
+
) -> int:
|
|
62
|
+
"""
|
|
63
|
+
Write ``data`` to NC file at ``path`` and return record count.
|
|
64
|
+
|
|
65
|
+
Parameters
|
|
66
|
+
----------
|
|
67
|
+
path : Path
|
|
68
|
+
Path to the NC file on disk.
|
|
69
|
+
data : JSONData
|
|
70
|
+
Data to write as NC file. Should be a list of dictionaries or a
|
|
71
|
+
single dictionary.
|
|
72
|
+
|
|
73
|
+
Returns
|
|
74
|
+
-------
|
|
75
|
+
int
|
|
76
|
+
The number of rows written to the NC file.
|
|
77
|
+
"""
|
|
78
|
+
return stub.write(path, data, format_name='NC')
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""
|
|
2
|
+
:mod:`etlplus.file.numbers` module.
|
|
3
|
+
|
|
4
|
+
Helpers for reading/writing Apple Numbers (NUMBERS) spreadsheet files.
|
|
5
|
+
|
|
6
|
+
Notes
|
|
7
|
+
-----
|
|
8
|
+
- A NUMBERS file is a spreadsheet file created by Apple Numbers.
|
|
9
|
+
- Common cases:
|
|
10
|
+
- Spreadsheet files created by Apple Numbers.
|
|
11
|
+
- Rule of thumb:
|
|
12
|
+
- If you need to read/write NUMBERS files, consider converting them to
|
|
13
|
+
more common formats like CSV or XLSX for better compatibility.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
from ..types import JSONData
|
|
21
|
+
from ..types import JSONList
|
|
22
|
+
from . import stub
|
|
23
|
+
|
|
24
|
+
# SECTION: EXPORTS ========================================================== #
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
'read',
|
|
29
|
+
'write',
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# SECTION: FUNCTIONS ======================================================== #
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def read(
|
|
37
|
+
path: Path,
|
|
38
|
+
) -> JSONList:
|
|
39
|
+
"""
|
|
40
|
+
Read NUMBERS content from ``path``.
|
|
41
|
+
|
|
42
|
+
Parameters
|
|
43
|
+
----------
|
|
44
|
+
path : Path
|
|
45
|
+
Path to the NUMBERS file on disk.
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
-------
|
|
49
|
+
JSONList
|
|
50
|
+
The list of dictionaries read from the NUMBERS file.
|
|
51
|
+
"""
|
|
52
|
+
return stub.read(path, format_name='NUMBERS')
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def write(
|
|
56
|
+
path: Path,
|
|
57
|
+
data: JSONData,
|
|
58
|
+
) -> int:
|
|
59
|
+
"""
|
|
60
|
+
Write ``data`` to NUMBERS file at ``path`` and return record count.
|
|
61
|
+
|
|
62
|
+
Parameters
|
|
63
|
+
----------
|
|
64
|
+
path : Path
|
|
65
|
+
Path to the NUMBERS file on disk.
|
|
66
|
+
data : JSONData
|
|
67
|
+
Data to write as NUMBERS file. Should be a list of dictionaries or a
|
|
68
|
+
single dictionary.
|
|
69
|
+
|
|
70
|
+
Returns
|
|
71
|
+
-------
|
|
72
|
+
int
|
|
73
|
+
The number of rows written to the NUMBERS file.
|
|
74
|
+
"""
|
|
75
|
+
return stub.write(path, data, format_name='NUMBERS')
|