eseas is a Python package that serves as a wrapper for the jwsacruncher Java package. This tool allows users to process Demetra workspace XML files, create batch files, execute them, and collect the desired outputs into individual Excel files.
Project description
eseas
eseas is a Python package that acts as a wrapper for the jwsacruncher Java package. This tool allows users to process Demetra workspace XML files, create batch files, execute them, and collect the desired outputs into individual Excel files.
Installation
eseas
You can install the eseas package via pip:
pip install eseas -U
Prerequisites
jwsacruncher
eseas requires the jwsacruncher Java package. You can download it
from the jwsacruncher GitHub releases page.
Setup Instructions
- Download the latest release of
jwsacruncherfrom the releases page. - Unzip the downloaded file.
- Note the path to the
bindirectory inside the unzipped folder.
After downloading jwsacruncher, you need to specify its location when using the Options function from the eseas package.
Usage
Here's an example of how to use the eseas package:
from eseas import Seasonal, Options
import time
def main():
# Specify the path to the jwsacruncher bin directory
java_folder = r'../../Downloads/jwsacruncher-2.2.4/bin'
# [Optional] Java binary folder (where the Java executable exists)
# This will be added to the environment PATH variable if provided.
java_bin = r'/usr/bin'
# Folder containing Demetra XML files
demetra_source_folder = r"./demetra_source_folder"
# Workspace where output files will be stored
local_folder = r"./test_out"
options = Options(
demetra_source_folder,
java_folder,
local_folder,
result_file_names=("sa", "s_f", "cal"), # See "Demetra Components" below
workspace_mode=True,
file_name_explanation=True,
java_bin=java_bin
)
# Initialize the Seasonal process
seas = Seasonal(options)
# Execute the two-step process
seas.part1()
time.sleep(10) # Wait before executing part2
seas.part2()
if __name__ == "__main__":
main()
Defining some parameters from .env file (NEW in version 1.0.0 )
You can define key parameters in an .env file located in the current directory where you run the script.
The function first checks whether the parameters are explicitly provided.
If a parameter is not given in the function, it will automatically use the value from the .env file.
# `.env` file content (Example)
# Required if not given from function
java_folder = /Users/guest/app/jwsacruncher-2.2.6/bin
demetra_source_folder = ./eseas/data_for_testing/unix
local_folder = ./test_out
#Optional
java_bin = /usr/bin
Usage: Running the Script When a .env File Exists
from eseas import Seasonal, Options
import time
# Load options from the `.env` file
options = Options()
# Initialize and execute the seasonal adjustment process
m = Seasonal(options)
m.part1()
time.sleep(10) # Pause before running part2
m.part2()
Usage: Overwriting demetra_folder from Function Call When .env File Exists
If a .env file is present, you can override the demetra_folder value by passing it directly in the function call.
from eseas import Seasonal, Options
import time
# Override `demetra_folder` from function call, ignoring the value in `.env`
options = Options(demetra_folder="SomeDemetraFolder")
# Initialize and execute the seasonal adjustment process
m = Seasonal(options)
m.part1()
time.sleep(10) # Pause before running part2
m.part2()
Documentation
For more detailed information, refer to the following guides:
How it Works
- Input Directory: The user specifies the directory of the Demetra workspace where XML files are located.
- Batch File Creation: The package creates batch files for all XML files in the specified directory.
- Execution: It runs the batch files using the
jwsacrunchertool. - Output Collection: The specified outputs are collected and compiled into individual Excel files for each XML file processed.
Acknowledgments
This package (eseas) is an independent Python wrapper that interacts with the jwsacruncher application.
Users must download jwsacruncher separately. This package is not affiliated with or derived from jwsacruncher.
jwsacruncher is a Java-based implementation of the .NET application WSACruncher. It is a command-line tool that allows users to re-estimate all multi-processing tasks defined in a Demetra workspace.
The workspace can be generated by:
- Demetra+ (.NET)
- JDemetra+ (Java)
- Any compatible user tool
For more information, visit the jwsacruncher GitHub repository.
License
This project is licensed under the EUPL-1.2 License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file eseas-1.0.5.tar.gz.
File metadata
- Download URL: eseas-1.0.5.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b29e45c36e29de6c55ae6c48f493a060e72fc9d63ebee1ddca165bde83083793
|
|
| MD5 |
5452916e85b5d642e64523fd72510b22
|
|
| BLAKE2b-256 |
e333c45994e71262174a97ad1022a3269c153e133e3f035df6106d609715cab6
|
File details
Details for the file eseas-1.0.5-py3-none-any.whl.
File metadata
- Download URL: eseas-1.0.5-py3-none-any.whl
- Upload date:
- Size: 53.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0997aa97d01430dfe70fbb08bd84bd084609be17202a2f41d2d727092aea16f
|
|
| MD5 |
3df45c10f2b0e408784ce731d54d9010
|
|
| BLAKE2b-256 |
218288e90cde6795791977e7d73539904f71cf07786bff589d6fdcbcd86649e1
|