Skip to main content

No project description provided

Project description

file-json

In many scenarios, you may want to save a huge list, dict object and use it later.
The standard json package will load all the data into memroy.
Hence comes the file-json library. With this package, you can store the list, dict object to local file system.

How it works

all the rules should

  1. Each object was store in a directory, the data was store in *.json.gz
  2. the .file_json.json file contains some basic info of this object.
  3. for time base list, the directory looks like this.
.file_json.json
{
    "type": "time_based_list",
    "key": "create_datetime",
}
2023
  - 12
    - 19
      - 00.json.gz  # this file contains data from 2023-12-19 00:00:00 to 2023-12-19 01:00:00(exclude 2023-12-19 01:00:00)
      - 01.json.gz
      - 02  # if there were too much data between 2023-12-19 02:00:00 and 2023-12-10 03:00:00
        - 00.json.gz
        - 01.json.gz
    - 20
2024
  - 01
    - 01
  1. for huge size of list, the directory looks like this.
.file_json.json
{
    "type": "sorted_list",
    "key": "id",
}
- 00.json.gz
- 01.json.gz
- 02
    - 01.json.gz
    - 02.json.gz
- 03.json.gz
  1. for huge size of dict, the directory looks like this.
.file_json.json
{
    "type": "dict",
}
- key1.json.gz
- key2
    - key2_1.json.gz
    - key2_2.json.gz
- key3.json.gz

Features

  • support time base list
    • support datetime with timezone
  • support huge size of list
  • support huge size of dict
  • use filelock to handle concurrency

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install file-json

License

file-json is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

file_json-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

file_json-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file file_json-0.1.0.tar.gz.

File metadata

  • Download URL: file_json-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.0

File hashes

Hashes for file_json-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3e4c85e541791118921c9ceb1feabc0cf6202cabe9e9f37f688ff454c60f7435
MD5 6d74bc1f7575fc37fb3861a53edaed7f
BLAKE2b-256 b3fe42173bdd9917bb5ddea9ea611dc49b4ac147ebfe64dc62b400fed5f234a6

See more details on using hashes here.

File details

Details for the file file_json-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: file_json-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.0

File hashes

Hashes for file_json-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f47aa379a0cc8088c746c910895580b59d3dc4c2be075ce85a3f5417637be93
MD5 3457b468cd5cbc994372d0f879ba5295
BLAKE2b-256 60e7e534ae7fd4ad8bd82628da3ab42c3df3458689effd13786b4bcb03b69eff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page