No project description provided
Project description
Jsonline
Jsonline is intend to use to explore and work with json lines files and avoid keep the entire data in memory or constantly read the whole file.This library handle json lines files as it was a read only list, but with append
too. This library build and index with the position of the being and end of each json in the file. When an element is accessed we use the mentioned index to read only the line with the requested json. This index is efficient handled and store in gzip format with extension .json.idx
.
Example
from jsonline impor jsonLine
# the extension .json is't necessary
data = jsonLine('my_file')
data.append({'test': 1})
# extend is an efficient way to append several elements
data.extend([{'test': 1}, {'another_test': 2}])
print(data[1]) # random access
for i in data:
print(i)
data.close() # close whe finish using data
# also support context manager
with jsonLine('my_file') as data:
print(data[0])
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
File details
Details for the file jsonline-0.2.1.tar.gz
.
File metadata
- Download URL: jsonline-0.2.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.8.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 920eeb36f4a3b1e9d12df3f7883a22951890c99dd7faf3d38b469ccb2f4a3179 |
|
MD5 | 782d7ed95b49143bd46a7671808afb6e |
|
BLAKE2b-256 | 3a44bb4ae5783ce9b533bb22d312fc08bfe6ee25c142b74af350309d1460ec33 |
File details
Details for the file jsonline-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: jsonline-0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.8.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce382f885d5cc2a87deca326fadab218bc0ee2a2a1d4aca7a59f99af86d38ee7 |
|
MD5 | bfe201b1b9fdafed641d000527639cdc |
|
BLAKE2b-256 | fb98fbe97f09d21d0755a1f56fcedcca44d84feeabce328b2c99b1465c3027ef |