# Fixed Width Data File Creator
This is a simple library for creating fixed-width text data files or text files (txt or csv) separated by a certain separator character.
You can use it to exchange data between APIS and other applications.
## Installation
To install the package, just run the command below:
`pip install pyFixedWidthDataFile`
## Usage
1) **Instantiate the class**:
`from pyFixedWidthDataFile import FWDataFile
app = FWDataFile(path_to_specs_folder, optional_separator)`
* path_to_specs_folder: Path to the folder containing the **Specs Files**;
* optional_separator: Separation character between fields (optional)
2) **Specs Files**: Files, JSON standard, with specifications of the fields contained in the lines (records).
see example in tests/specs
Open the record with "{", enter the name clause, it is mandatory. Open the list of objects of type field with "fields {", enter the id of the field and enter the characteristics of the field.
# Characteristics List
* name: (required) name of the field
* start_pos: (required) starting position
* end_pos: (required) end position
* format: (required) field type, which can be:
> 1. alpha: alphanumeric, text
> 2. num: numeric (integer, floating point)
* default: (optional) default value of the field, if there is no default value the field will not be filled with spaces, even if it is numeric.
* decimals: (optional) only for numeric fields, number of decimal places
* ignore: (optional) field to be ignored
* required: (optional) mandatory field
* regex: (optional) regular expression operations field
3) Inject the lines from the file:
app.append_line("header",cod_client="1234",name_client="Alexandre Defendi")
4) use the result:
print(app)
"R000001PED1234 Alexandre Defendi X"
## License
This project is under the MIT license. See the [LICENSE](LICENSE.txt) file for more details.
Raw data
{
"_id": null,
"home_page": "https://www.opussystem.com.br",
"name": "pyFixedWidthDataFile",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "fixed,width,text",
"author": "OpusSystem",
"author_email": "suporte@opussystem.com.br",
"download_url": "https://files.pythonhosted.org/packages/cd/4c/76cfb4d1d3c4023fb227dd907f770e7bcd43c315d0a52a292432e90b2aad/pyFixedWidthDataFile-0.0.6.tar.gz",
"platform": "any",
"description": "# Fixed Width Data File Creator\nThis is a simple library for creating fixed-width text data files or text files (txt or csv) separated by a certain separator character. \n\nYou can use it to exchange data between APIS and other applications.\n\n\n## Installation\n\nTo install the package, just run the command below:\n\n`pip install pyFixedWidthDataFile`\n\n## Usage\n\n1) **Instantiate the class**:\n\n`from pyFixedWidthDataFile import FWDataFile\napp = FWDataFile(path_to_specs_folder, optional_separator)`\n\n\n* path_to_specs_folder: Path to the folder containing the **Specs Files**;\n* optional_separator: Separation character between fields (optional)\n\n2) **Specs Files**: Files, JSON standard, with specifications of the fields contained in the lines (records).\n\nsee example in tests/specs\n\nOpen the record with \"{\", enter the name clause, it is mandatory. Open the list of objects of type field with \"fields {\", enter the id of the field and enter the characteristics of the field.\n\n# Characteristics List\n* name: (required) name of the field\n* start_pos: (required) starting position\n* end_pos: (required) end position\n* format: (required) field type, which can be:\n> 1. alpha: alphanumeric, text\n> 2. num: numeric (integer, floating point)\n* default: (optional) default value of the field, if there is no default value the field will not be filled with spaces, even if it is numeric.\n* decimals: (optional) only for numeric fields, number of decimal places\n* ignore: (optional) field to be ignored\n* required: (optional) mandatory field\n* regex: (optional) regular expression operations field\n\n3) Inject the lines from the file:\n\napp.append_line(\"header\",cod_client=\"1234\",name_client=\"Alexandre Defendi\")\n\n4) use the result: \n\nprint(app)\n\n\"R000001PED1234 Alexandre Defendi X\"\n\n\n## License\n\nThis project is under the MIT license. See the [LICENSE](LICENSE.txt) file for more details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "This is a simple library for creating fixed-width text files for transferring data between APIs.",
"version": "0.0.6",
"project_urls": {
"Download": "https://github.com/Defendi/pyFixedWidthDataFile",
"Homepage": "https://www.opussystem.com.br"
},
"split_keywords": [
"fixed",
"width",
"text"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "05030b1bce05e99697d6348e6025786f28202132d8e25594b675dbb1a20e17d8",
"md5": "1d12cceb41c134631a7aaa5f7498723a",
"sha256": "8d5dc0098aa70c6c8e1597253ae13e973050359d2c42158e1ea8cfa6edcc0af3"
},
"downloads": -1,
"filename": "pyFixedWidthDataFile-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1d12cceb41c134631a7aaa5f7498723a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7184,
"upload_time": "2023-09-14T20:39:51",
"upload_time_iso_8601": "2023-09-14T20:39:51.242974Z",
"url": "https://files.pythonhosted.org/packages/05/03/0b1bce05e99697d6348e6025786f28202132d8e25594b675dbb1a20e17d8/pyFixedWidthDataFile-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cd4c76cfb4d1d3c4023fb227dd907f770e7bcd43c315d0a52a292432e90b2aad",
"md5": "177c0f4d110271d65f5520561078f02b",
"sha256": "ac2a1ffe95b335417ce535bff83ef3fe3022b314739404e20d42e5eefa06d674"
},
"downloads": -1,
"filename": "pyFixedWidthDataFile-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "177c0f4d110271d65f5520561078f02b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6340,
"upload_time": "2023-09-14T20:39:53",
"upload_time_iso_8601": "2023-09-14T20:39:53.009378Z",
"url": "https://files.pythonhosted.org/packages/cd/4c/76cfb4d1d3c4023fb227dd907f770e7bcd43c315d0a52a292432e90b2aad/pyFixedWidthDataFile-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-14 20:39:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Defendi",
"github_project": "pyFixedWidthDataFile",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pyfixedwidthdatafile"
}