# rsv.py
# Description
A module for reading and writing an [RSV](https://github.com/Stenway/RSV-Challenge) document file.
# Using
```python
import rsv
sample_data = [
["Name", "Description", None],
[],
[None, ":)"]
]
with open("document.rsv", "wb") as file:
rsv.dump(sample_data, file)
# The first load method.
# It is the most efficient and suitable for working even with large arrays.
# Since it loads data from the file sequentially when loading.
with open("document.rsv", "rb") as file:
data = rsv.load(file)
# The second load method.
# It is suitable for working with small arrays.
# Since it loads the entire file into memory at once and only then parses it.
with open("document.rsv", "rb") as file:
data = rsv.load_split(file)
# The third load method.
# This is the most efficient possible method suitable for working with any arrays of any size.
# Loads the file line by line, the use of `for` is required.
with open("document.rsv", "rb") as file:
lines = []
for line in file.load_generator():
# And here you can do whatever you want...
lines.append(line)
```
## Notes
It is also worth noting that no one forbids you to use the `Encoder`/`Decoder` directly:
```python
import rsv
rsv_encoder = rsv.Encoder(open("document.rsv", "wb"))
rsv_decoder = rsv.Decoder(open("document.rsv", "rb"))
```
Raw data
{
"_id": null,
"home_page": "https://github.com/romanin-rf/rsv",
"name": "rsv",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "rsv, csv, io, file, format, dump, load, read, write",
"author": "Romanin",
"author_email": "semina054@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/fc/2a/f38bf17c96486217e04c59ad99e203c624235e6c9a2cf119875e480675f2/rsv-1.5.1.tar.gz",
"platform": null,
"description": "# rsv.py\n# Description\nA module for reading and writing an [RSV](https://github.com/Stenway/RSV-Challenge) document file.\n\n# Using\n```python\nimport rsv\n\nsample_data = [\n [\"Name\", \"Description\", None],\n [],\n [None, \":)\"]\n]\n\nwith open(\"document.rsv\", \"wb\") as file:\n rsv.dump(sample_data, file)\n\n# The first load method.\n# It is the most efficient and suitable for working even with large arrays.\n# Since it loads data from the file sequentially when loading.\nwith open(\"document.rsv\", \"rb\") as file:\n data = rsv.load(file)\n\n# The second load method.\n# It is suitable for working with small arrays.\n# Since it loads the entire file into memory at once and only then parses it.\nwith open(\"document.rsv\", \"rb\") as file:\n data = rsv.load_split(file)\n\n# The third load method.\n# This is the most efficient possible method suitable for working with any arrays of any size.\n# Loads the file line by line, the use of `for` is required.\nwith open(\"document.rsv\", \"rb\") as file:\n lines = []\n for line in file.load_generator():\n # And here you can do whatever you want...\n lines.append(line)\n```\n\n## Notes\nIt is also worth noting that no one forbids you to use the `Encoder`/`Decoder` directly:\n```python\nimport rsv\n\nrsv_encoder = rsv.Encoder(open(\"document.rsv\", \"wb\"))\nrsv_decoder = rsv.Decoder(open(\"document.rsv\", \"rb\"))\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "A module for reading and writing an RSV document file.",
"version": "1.5.1",
"project_urls": {
"Homepage": "https://github.com/romanin-rf/rsv",
"Repository": "https://github.com/romanin-rf/rsv"
},
"split_keywords": [
"rsv",
" csv",
" io",
" file",
" format",
" dump",
" load",
" read",
" write"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8cb27542800679344960ec23a1c1551afac6863877f9077ae97e72724a942b10",
"md5": "07925d7ecf1295f8348645fcc4cc80d3",
"sha256": "6b54f548004ba35772597f816c82f2b83f1b55e38dbb88d32c0fafebef0e4c0f"
},
"downloads": -1,
"filename": "rsv-1.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "07925d7ecf1295f8348645fcc4cc80d3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4271,
"upload_time": "2024-12-18T22:41:35",
"upload_time_iso_8601": "2024-12-18T22:41:35.536382Z",
"url": "https://files.pythonhosted.org/packages/8c/b2/7542800679344960ec23a1c1551afac6863877f9077ae97e72724a942b10/rsv-1.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fc2af38bf17c96486217e04c59ad99e203c624235e6c9a2cf119875e480675f2",
"md5": "ae524797ec74b68a9d4cd2cea8dab374",
"sha256": "c36276dbf0872e9e6d7da86b8d1f859ac969f073f319013aa5fc292217518bb8"
},
"downloads": -1,
"filename": "rsv-1.5.1.tar.gz",
"has_sig": false,
"md5_digest": "ae524797ec74b68a9d4cd2cea8dab374",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3333,
"upload_time": "2024-12-18T22:41:36",
"upload_time_iso_8601": "2024-12-18T22:41:36.611547Z",
"url": "https://files.pythonhosted.org/packages/fc/2a/f38bf17c96486217e04c59ad99e203c624235e6c9a2cf119875e480675f2/rsv-1.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-18 22:41:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "romanin-rf",
"github_project": "rsv",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rsv"
}