Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Julia wrapper for yyjson for reading and parsing JSON

License

NotificationsYou must be signed in to change notification settings

bhftbootcamp/YYJSON.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StableDevBuild StatusCoverageRegistry

YYJSON is a convenient wrapper aroundyyjson library for reading and parsing JSON documents and provides its own parser implementation.

Feature        
Description
Performance
Able toread gigabytes of JSON document per second.
Flexibility
The library wraps a lot of methods of the original library, which allows you to make your own implementation of JSONreader/parser/(de)serializer.
Parser
Provides its ownparser implementation usingyyjson tools.

Installation

To install YYJSON, simply use the Julia package manager:

] add YYJSON

Usage

A small example of parsing the returned result from a ticker request:

using YYJSONjson="""{  "retCode":0,  "retMsg":"OK",  "result":{    "ap":0.6636,    "bp":0.6634,    "h":0.6687,    "l":0.6315,    "lp":0.6633,    "o":0.6337,    "qv":1.1594252877069e7,    "s":"ADAUSDT",    "t":"2024-03-25T19:05:35.491000064",    "v":1.780835204e7  },  "retExtInfo":{},  "time":"2024-03-25T19:05:38.912999936"}"""julia>parse_json(json)Dict{String, Any} with5 entries:"retExtInfo"=>Dict{String, Any}()"time"=>"2024-03-25T19:05:38.912999936""retCode"=>0"retMsg"=>"OK""result"=>Dict{String, Any}("v"=>1.78084e7,"ap"=>0.6636,"o"=>0.6337,...)

Lazy parsing enables more efficient value retrieval compared to regular parsing:

using YYJSONjson=read("assets/exchange_info.json", String)functiontest_full_parse(json)    parsed=parse_json(json)return parsed["symbols"][1]["filters"][1]["filterType"]endfunctiontest_lazy_parse(json)parse_lazy_json(json)do lazy_parsedreturn lazy_parsed["symbols"][1]["filters"][1]["filterType"]endendjulia>@timetest_full_parse(json)0.000245 seconds (2.89 k allocations:203.727 KiB)"PRICE_FILTER"julia>@timetest_lazy_parse(json)0.000041 seconds (10 allocations:448 bytes)"PRICE_FILTER"

Useful Links

Contributing

Contributions to YYJSON are welcome! If you encounter a bug, have a feature request, or would like to contribute code, please open an issue or a pull request on GitHub.

About

Julia wrapper for yyjson for reading and parsing JSON

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp