├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── JsonData.sln ├── JsonData ├── JsonData.csproj ├── JsonDataImages.resources ├── JsonDataImages.resx ├── Manifests │ ├── JsonData.Migrations.xml │ ├── JsonData_DynamoCustomization.xml │ └── pkg.json ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ └── Images │ │ ├── Large │ │ ├── JsonData.Elements.JsonObject.Add.Large.png │ │ ├── JsonData.Elements.JsonObject.ByDictionary.Large.png │ │ ├── JsonData.Elements.JsonObject.ByKeysAndValues.Large.png │ │ ├── JsonData.Elements.JsonObject.FilterByKeyAndValue.Large.png │ │ ├── JsonData.Elements.JsonObject.GetValueByKey.Large.png │ │ ├── JsonData.Elements.JsonObject.Keys.Large.png │ │ ├── JsonData.Elements.JsonObject.Merge.Large.png │ │ ├── JsonData.Elements.JsonObject.Remove.Large.png │ │ ├── JsonData.Elements.JsonObject.Size.Large.png │ │ ├── JsonData.Elements.JsonObject.SortByKeyValue.Large.png │ │ ├── JsonData.Elements.JsonObject.SortKeys.Large.png │ │ ├── JsonData.Elements.JsonObject.ToDictionary.Large.png │ │ ├── JsonData.Elements.JsonObject.Values.Large.png │ │ ├── JsonData.Utilities.Parse.CSVString.Large.png │ │ ├── JsonData.Utilities.Parse.JsonToCSV.Large.png │ │ ├── JsonData.Utilities.Parse.JsonToString.Large.png │ │ ├── JsonData.Utilities.Parse.JsonToXML.Large.png │ │ ├── JsonData.Utilities.Parse.String.Large.png │ │ ├── JsonData.Utilities.Parse.XMLString.Large.png │ │ ├── JsonData.Utilities.Read.FromCSVFile.Large.png │ │ ├── JsonData.Utilities.Read.FromJsonFile.Large.png │ │ ├── JsonData.Utilities.Read.FromXMLFile.Large.png │ │ ├── JsonData.Utilities.Write.ToCSVFile.Large.png │ │ ├── JsonData.Utilities.Write.ToJsonFile.Large.png │ │ ├── JsonData.Utilities.Write.ToXMLFile.Large.png │ │ └── JsonDataUI.JsonOptions.Large.png │ │ └── Small │ │ ├── JsonData.Elements.JsonObject.Add.Small.png │ │ ├── JsonData.Elements.JsonObject.ByDictionary.Small.png │ │ ├── JsonData.Elements.JsonObject.ByKeysAndValues.Small.png │ │ ├── JsonData.Elements.JsonObject.FilterByKeyAndValue.Small.png │ │ ├── JsonData.Elements.JsonObject.GetValueByKey.Small.png │ │ ├── JsonData.Elements.JsonObject.Keys.Small.png │ │ ├── JsonData.Elements.JsonObject.Merge.Small.png │ │ ├── JsonData.Elements.JsonObject.Remove.Small.png │ │ ├── JsonData.Elements.JsonObject.Size.Small.png │ │ ├── JsonData.Elements.JsonObject.SortByKeyValue.Small.png │ │ ├── JsonData.Elements.JsonObject.SortKeys.Small.png │ │ ├── JsonData.Elements.JsonObject.ToDictionary.Small.png │ │ ├── JsonData.Elements.JsonObject.Values.Small.png │ │ ├── JsonData.Utilities.Parse.CSVString.Small.png │ │ ├── JsonData.Utilities.Parse.JsonToCSV.Small.png │ │ ├── JsonData.Utilities.Parse.JsonToString.Small.png │ │ ├── JsonData.Utilities.Parse.JsonToXML.Small.png │ │ ├── JsonData.Utilities.Parse.String.Small.png │ │ ├── JsonData.Utilities.Parse.XMLString.Small.png │ │ ├── JsonData.Utilities.Read.FromCSVFile.Small.png │ │ ├── JsonData.Utilities.Read.FromJsonFile.Small.png │ │ ├── JsonData.Utilities.Read.FromXMLFile.Small.png │ │ ├── JsonData.Utilities.Write.ToCSVFile.Small.png │ │ ├── JsonData.Utilities.Write.ToJsonFile.Small.png │ │ ├── JsonData.Utilities.Write.ToXMLFile.Small.png │ │ └── JsonDataUI.JsonOptions.Small.png ├── app.config ├── packages.config └── src │ ├── Elements │ ├── JsonArray.cs │ ├── JsonObject.cs │ └── JsonOption.cs │ ├── JsonConverter.cs │ ├── JsonNet.cs │ └── Utilities │ ├── ParseTools.cs │ ├── ReadTools.cs │ └── WriteTools.cs ├── JsonDataTests ├── JsonDataTests.csproj ├── Properties │ └── AssemblyInfo.cs ├── app.config ├── packages.config └── src │ ├── Elements │ └── JsonObjectTests.cs │ └── Utilities │ └── ParseTests.cs ├── JsonDataUI ├── JsonDataUI.csproj ├── JsonDataUIImages.resources ├── JsonDataUIImages.resx ├── Properties │ └── AssemblyInfo.cs ├── Resources │ └── Images │ │ ├── Large │ │ ├── JsonDataUI.Nodes.Add.Large.png │ │ ├── JsonDataUI.Nodes.ByKeysAndValues.Large.png │ │ ├── JsonDataUI.Nodes.GetValueByKey.Large.png │ │ ├── JsonDataUI.Nodes.Merge.Large.png │ │ └── JsonDataUI.Nodes.Remove.Large.png │ │ └── Small │ │ ├── JsonDataUI.Nodes.Add.Small.png │ │ ├── JsonDataUI.Nodes.ByKeysAndValues.Small.png │ │ ├── JsonDataUI.Nodes.GetValueByKey.Small.png │ │ ├── JsonDataUI.Nodes.Merge.Small.png │ │ └── JsonDataUI.Nodes.Remove.Small.png ├── app.config ├── packages.config └── src │ ├── Elements │ └── JsonObjectUI.cs │ └── NodeModels │ ├── JsonOptionsBase.cs │ ├── JsonOptionsBaseView.cs │ ├── JsonOptionsControl.xaml │ └── JsonOptionsControl.xaml.cs ├── LICENSE.md ├── README.md ├── dist └── JsonData │ └── pkg.json ├── docs ├── _config.yml ├── assets │ └── images │ │ ├── JsonData.Elements.JsonArray.ByElements.Small.png │ │ ├── JsonData.Elements.JsonArray.Elements.Small.png │ │ ├── JsonData.Elements.JsonArray.Size.Small.png │ │ ├── JsonData.Elements.JsonObject.Add.Small.png │ │ ├── JsonData.Elements.JsonObject.ByKeysAndValues.Small.png │ │ ├── JsonData.Elements.JsonObject.FilterByKeyAndValue.Small.png │ │ ├── JsonData.Elements.JsonObject.GetValueByKey.Small.png │ │ ├── JsonData.Elements.JsonObject.Keys.Small.png │ │ ├── JsonData.Elements.JsonObject.Merge.Small.png │ │ ├── JsonData.Elements.JsonObject.Remove.Small.png │ │ ├── JsonData.Elements.JsonObject.Size.Small.png │ │ ├── JsonData.Elements.JsonObject.SortByKeyValue.Small.png │ │ ├── JsonData.Elements.JsonObject.SortKeys.Small.png │ │ ├── JsonData.Elements.JsonObject.Values.Small.png │ │ ├── JsonData.Utilities.Parse.CSVString.Small.png │ │ ├── JsonData.Utilities.Parse.JsonString.Small.png │ │ ├── JsonData.Utilities.Parse.JsonToCSV.Small.png │ │ ├── JsonData.Utilities.Parse.JsonToXML.Small.png │ │ ├── JsonData.Utilities.Parse.XMLString.Small.png │ │ ├── JsonData.Utilities.Read.FromCSVFile.Small.png │ │ ├── JsonData.Utilities.Read.FromJsonFile.Small.png │ │ ├── JsonData.Utilities.Read.FromXMLFile.Small.png │ │ ├── JsonData.Utilities.Write.ToCSVFile.Small.png │ │ ├── JsonData.Utilities.Write.ToJsonFile.Small.png │ │ ├── JsonData.Utilities.Write.ToXMLFile.Small.png │ │ ├── JsonDataUI.JsonObject.JsonOptions.Small.png │ │ └── JsonDataUI.JsonOptions.Small.png └── index.md └── samples ├── images ├── JsonDataHeader.png ├── JsonDataSample.png └── JsonDataToolSet.png └── wiki ├── datasets ├── dataStorageInGlobalParameter.zip ├── elementParametersByCategory.zip ├── helloWorld.zip ├── jsonDataSample.zip ├── runningPythonScriptFromOtherFile.zip └── webRequest.zip └── images ├── elementParametersByCategory ├── overallGraph.png ├── step_01.png ├── step_02.png └── step_03.png ├── helloWorld.png ├── jsonDataSample.png ├── runningPython ├── overallGraph.png ├── step1.png ├── step2.png ├── step3.png └── step4.png ├── webRequest.png └── webRequestCSV ├── dataFromGlobalParameter.png └── webRequestCSV.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | [Tt]ests/ 25 | 26 | # Visual Studio 2015 cache/options directory 27 | .vs/ 28 | # Uncomment if you have tasks that create the project's static files in wwwroot 29 | #wwwroot/ 30 | 31 | # MSTest test Results 32 | [Tt]est[Rr]esult*/ 33 | [Bb]uild[Ll]og.* 34 | 35 | # NUNIT 36 | *.VisualState.xml 37 | TestResult.xml 38 | 39 | # Build Results of an ATL Project 40 | [Dd]ebugPS/ 41 | [Rr]eleasePS/ 42 | dlldata.c 43 | 44 | # DNX 45 | project.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | *.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.pfx 193 | *.publishsettings 194 | node_modules/ 195 | orleans.codegen.cs 196 | 197 | # Since there are multiple workflows, uncomment next line to ignore bower_components 198 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 199 | #bower_components/ 200 | 201 | # RIA/Silverlight projects 202 | Generated_Code/ 203 | 204 | # Backup & report files from converting an old project file 205 | # to a newer Visual Studio version. Backup files are not needed, 206 | # because we have git ;-) 207 | _UpgradeReport_Files/ 208 | Backup*/ 209 | UpgradeLog*.XML 210 | UpgradeLog*.htm 211 | 212 | # SQL Server files 213 | *.mdf 214 | *.ldf 215 | 216 | # Business Intelligence projects 217 | *.rdl.data 218 | *.bim.layout 219 | *.bim_*.settings 220 | 221 | # Microsoft Fakes 222 | FakesAssemblies/ 223 | 224 | # GhostDoc plugin setting file 225 | *.GhostDoc.xml 226 | 227 | # Node.js Tools for Visual Studio 228 | .ntvs_analysis.dat 229 | 230 | # Visual Studio 6 build log 231 | *.plg 232 | 233 | # Visual Studio 6 workspace options file 234 | *.opt 235 | 236 | # Visual Studio LightSwitch build output 237 | **/*.HTMLClient/GeneratedArtifacts 238 | **/*.DesktopClient/GeneratedArtifacts 239 | **/*.DesktopClient/ModelManifest.xml 240 | **/*.Server/GeneratedArtifacts 241 | **/*.Server/ModelManifest.xml 242 | _Pvt_Extensions 243 | 244 | # Paket dependency manager 245 | .paket/paket.exe 246 | paket-files/ 247 | 248 | # FAKE - F# Make 249 | .fake/ 250 | 251 | # JetBrains Rider 252 | .idea/ 253 | *.sln.iml 254 | 255 | # ========================= 256 | # Operating System Files 257 | # ========================= 258 | 259 | # OSX 260 | # ========================= 261 | 262 | .DS_Store 263 | .AppleDouble 264 | .LSOverride 265 | 266 | # Thumbnails 267 | ._* 268 | 269 | # Files that might appear in the root of a volume 270 | .DocumentRevisions-V100 271 | .fseventsd 272 | .Spotlight-V100 273 | .TemporaryItems 274 | .Trashes 275 | .VolumeIcon.icns 276 | 277 | # Directories potentially created on remote AFP share 278 | .AppleDB 279 | .AppleDesktop 280 | Network Trash Folder 281 | Temporary Items 282 | .apdisk 283 | 284 | # Windows 285 | # ========================= 286 | 287 | # Windows image file caches 288 | Thumbs.db 289 | ehthumbs.db 290 | 291 | # Folder config file 292 | Desktop.ini 293 | 294 | # Recycle Bin used on file shares 295 | $RECYCLE.BIN/ 296 | 297 | # Windows Installer files 298 | *.cab 299 | *.msi 300 | *.msm 301 | *.msp 302 | 303 | # Windows shortcuts 304 | *.lnk 305 | 306 | #Windows bat files 307 | *.bat 308 | 309 | 310 | #Custom 311 | samples/wiki/datasets/* 312 | !samples/wiki/datasets/*.zip 313 | /JsonDataUI/Properties/Resources.Designer.cs 314 | /JsonDataUI/Properties/Resources.resx 315 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # JsonData Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). 6 | 7 | ## [2.0.0] - 2018/05/21 8 | 9 | ### Added 10 | - Abstract `JsonOptionsBase` class inheriting from `NodeModel`, providing a reusable UI for nodes requiring `JsonOption` and `Nesting` options. 11 | - Change log. 12 | - Support for Dynamo Dictionaries (`DesignScript.Builtin.Dictionary`). 13 | 14 | ### Changed 15 | 16 | - Transition to Dynamo 2.0. 17 | - Previous Zero Touch nodes that have been replaced by `NodeModels` are set as `static` and hidden on Dynamo library. 18 | 19 | ### Removed 20 | - `JsonArray` class. 21 | - Dropdown node for `JsonOption` selector. 22 | - `jsonOption` and `nested` inputs on nodes requiring these options. 23 | 24 | ### Known issues 25 | - Public `JsonOption` enum loaded and visible to Dynamo Library. This is a [known issue](https://github.com/DynamoDS/Dynamo/issues/8789) on Dynamo 2.0. Once fixed, `JsonOption` nodes will be hidden. -------------------------------------------------------------------------------- /JsonData.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2010 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonData", "JsonData\JsonData.csproj", "{B8641242-9127-4483-980E-9739E5F8EC23}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonDataUI", "JsonDataUI\JsonDataUI.csproj", "{3FBDA8EF-CB25-40FC-ABAA-A6DCCDCD9A64}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B8009D9C-D24D-4F39-8F1F-8EDBC214DFF3}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonDataTests", "JsonDataTests\JsonDataTests.csproj", "{D5D3C259-F524-4322-B027-FD30919D3B36}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Debug2.0|Any CPU = Debug2.0|Any CPU 18 | Release|Any CPU = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {B8641242-9127-4483-980E-9739E5F8EC23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {B8641242-9127-4483-980E-9739E5F8EC23}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {B8641242-9127-4483-980E-9739E5F8EC23}.Debug2.0|Any CPU.ActiveCfg = Debug 2.0|Any CPU 24 | {B8641242-9127-4483-980E-9739E5F8EC23}.Debug2.0|Any CPU.Build.0 = Debug 2.0|Any CPU 25 | {B8641242-9127-4483-980E-9739E5F8EC23}.Release|Any CPU.ActiveCfg = Release|Any CPU 26 | {B8641242-9127-4483-980E-9739E5F8EC23}.Release|Any CPU.Build.0 = Release|Any CPU 27 | {3FBDA8EF-CB25-40FC-ABAA-A6DCCDCD9A64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 28 | {3FBDA8EF-CB25-40FC-ABAA-A6DCCDCD9A64}.Debug|Any CPU.Build.0 = Debug|Any CPU 29 | {3FBDA8EF-CB25-40FC-ABAA-A6DCCDCD9A64}.Debug2.0|Any CPU.ActiveCfg = Debug 2.0|Any CPU 30 | {3FBDA8EF-CB25-40FC-ABAA-A6DCCDCD9A64}.Debug2.0|Any CPU.Build.0 = Debug 2.0|Any CPU 31 | {3FBDA8EF-CB25-40FC-ABAA-A6DCCDCD9A64}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {3FBDA8EF-CB25-40FC-ABAA-A6DCCDCD9A64}.Release|Any CPU.Build.0 = Release|Any CPU 33 | {D5D3C259-F524-4322-B027-FD30919D3B36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 34 | {D5D3C259-F524-4322-B027-FD30919D3B36}.Debug|Any CPU.Build.0 = Debug|Any CPU 35 | {D5D3C259-F524-4322-B027-FD30919D3B36}.Debug2.0|Any CPU.ActiveCfg = Debug|Any CPU 36 | {D5D3C259-F524-4322-B027-FD30919D3B36}.Debug2.0|Any CPU.Build.0 = Debug|Any CPU 37 | {D5D3C259-F524-4322-B027-FD30919D3B36}.Release|Any CPU.ActiveCfg = Release|Any CPU 38 | {D5D3C259-F524-4322-B027-FD30919D3B36}.Release|Any CPU.Build.0 = Release|Any CPU 39 | EndGlobalSection 40 | GlobalSection(SolutionProperties) = preSolution 41 | HideSolutionNode = FALSE 42 | EndGlobalSection 43 | GlobalSection(NestedProjects) = preSolution 44 | {D5D3C259-F524-4322-B027-FD30919D3B36} = {B8009D9C-D24D-4F39-8F1F-8EDBC214DFF3} 45 | EndGlobalSection 46 | GlobalSection(ExtensibilityGlobals) = postSolution 47 | SolutionGuid = {A475FBCD-F7A2-468D-9A3E-A4A092AEDEEC} 48 | EndGlobalSection 49 | EndGlobal 50 | -------------------------------------------------------------------------------- /JsonData/JsonData.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {B8641242-9127-4483-980E-9739E5F8EC23} 9 | Library 10 | Properties 11 | JsonData 12 | JsonData 13 | v4.6.1 14 | 512 15 | 16 | 17 | 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | bin\Debug\JsonData.XML 28 | 29 | 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | true 39 | bin\Debug 2.0\ 40 | DEBUG;TRACE 41 | bin\Debug\JsonData.XML 42 | full 43 | AnyCPU 44 | prompt 45 | MinimumRecommendedRules.ruleset 46 | 47 | 48 | 49 | ..\packages\DynamoVisualProgramming.DynamoCoreNodes.2.0.2.6986\lib\net45\Analysis.dll 50 | False 51 | 52 | 53 | ..\packages\CommonServiceLocator.2.0.3\lib\net45\CommonServiceLocator.dll 54 | False 55 | 56 | 57 | ..\packages\DynamoVisualProgramming.WpfUILibrary.2.0.2.6986\lib\net45\CoreNodeModels.dll 58 | False 59 | 60 | 61 | ..\packages\DynamoVisualProgramming.WpfUILibrary.2.0.2.6986\lib\net45\CoreNodeModelsWpf.dll 62 | False 63 | 64 | 65 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DesignScriptBuiltin.dll 66 | False 67 | 68 | 69 | ..\packages\DynamoVisualProgramming.DynamoCoreNodes.2.0.2.6986\lib\net45\DSCoreNodes.dll 70 | False 71 | 72 | 73 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DSIronPython.dll 74 | False 75 | 76 | 77 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DynamoApplications.dll 78 | False 79 | 80 | 81 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DynamoCore.dll 82 | False 83 | 84 | 85 | ..\packages\DynamoVisualProgramming.Tests.2.0.2.6986\lib\net45\DynamoCoreTests.dll 86 | False 87 | 88 | 89 | ..\packages\DynamoVisualProgramming.WpfUILibrary.2.0.2.6986\lib\net45\DynamoCoreWpf.dll 90 | False 91 | 92 | 93 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DynamoInstallDetective.dll 94 | False 95 | 96 | 97 | ..\packages\DynamoVisualProgramming.DynamoServices.2.0.2.6986\lib\net45\DynamoServices.dll 98 | False 99 | 100 | 101 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DynamoShapeManager.dll 102 | False 103 | 104 | 105 | ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.0.2.6986\lib\net45\DynamoUnits.dll 106 | False 107 | 108 | 109 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DynamoUtilities.dll 110 | False 111 | 112 | 113 | ..\packages\DynamoVisualProgramming.DynamoCoreNodes.2.0.2.6986\lib\net45\GeometryColor.dll 114 | False 115 | 116 | 117 | ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll 118 | False 119 | 120 | 121 | ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll 122 | False 123 | 124 | 125 | ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll 126 | False 127 | 128 | 129 | 130 | ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll 131 | False 132 | 133 | 134 | ..\packages\NUnit.3.10.1\lib\net45\nunit.framework.dll 135 | False 136 | 137 | 138 | 139 | 140 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\ProtoCore.dll 141 | False 142 | 143 | 144 | ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.0.2.6986\lib\net45\ProtoGeometry.dll 145 | False 146 | 147 | 148 | 149 | 150 | 151 | 152 | ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll 153 | False 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | ..\packages\DynamoVisualProgramming.Tests.2.0.2.6986\lib\net45\SystemTestServices.dll 164 | False 165 | 166 | 167 | ..\packages\DynamoVisualProgramming.Tests.2.0.2.6986\lib\net45\TestServices.dll 168 | False 169 | 170 | 171 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\VMDataBridge.dll 172 | False 173 | 174 | 175 | 176 | 177 | 178 | 179 | True 180 | True 181 | Resources.resx 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | ResXFileCodeGenerator 279 | Resources.Designer.cs 280 | 281 | 282 | 283 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | $(AppData)\Dynamo\Dynamo Core\1.3\packages 329 | $(AppData)\Dynamo\Dynamo Revit\1.3\packages 330 | $(AppData)\Dynamo\Dynamo Core\2.0\packages 331 | $(AppData)\Dynamo\Dynamo Revit\2.0\packages 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 346 | 347 | 348 | 349 | -------------------------------------------------------------------------------- /JsonData/JsonDataImages.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/JsonDataImages.resources -------------------------------------------------------------------------------- /JsonData/Manifests/JsonData.Migrations.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | JsonElements.JsonObject.SortByKey 5 | JsonElements.JsonObject.SortKeys 6 | 7 | 8 | JsonElements.JsonObject.ByKeysAndValues 9 | JsonData.Elements.JsonObject.ByKeysAndValues 10 | 11 | 12 | JsonElements.JsonObject.ValueByKey 13 | JsonData.Elements.JsonObject.ValueByKey 14 | 15 | 16 | JsonElements.JsonObject.Add 17 | JsonData.Elements.JsonObject.Add 18 | 19 | 20 | JsonElements.JsonObject.Remove 21 | JsonData.Elements.JsonObject.Remove 22 | 23 | 24 | JsonElements.JsonObject.Merge 25 | JsonData.Elements.JsonObject.Merge 26 | 27 | 28 | JsonElements.JsonObject.ValueByKey 29 | JsonData.Elements.JsonObject.ValueByKey 30 | 31 | 32 | JsonData.Elements.JsonObject.ValueByKey 33 | JsonData.Elements.JsonObject.GetValueByKey 34 | 35 | 36 | JsonElements.JsonObject.SortKeys 37 | JsonData.Elements.JsonObject.SortKeys 38 | 39 | 40 | JsonElements.JsonObject.SortByKeyValues 41 | JsonData.Elements.JsonObject.SortByKeyValues 42 | 43 | 44 | JsonElements.JsonObject.FilterByKeyAndValue 45 | JsonData.Elements.JsonObject.FilterByKeyAndValue 46 | 47 | 48 | JsonElements.JsonObject.Keys 49 | JsonData.Elements.JsonObject.Keys 50 | 51 | 52 | JsonElements.JsonObject.Values 53 | JsonData.Elements.JsonObject.Values 54 | 55 | 56 | JsonElements.JsonObject.Size 57 | JsonData.Elements.JsonObject.Size 58 | 59 | 60 | JsonElements.JsonArray.Create 61 | JsonData.Elements.JsonArray.ByElements 62 | 63 | 64 | JsonElements.JsonArray.Elements 65 | JsonData.Elements.JsonArray.Elements 66 | 67 | 68 | JsonElements.JsonArray.Size 69 | JsonData.Elements.JsonArray.Size 70 | 71 | 72 | JsonTools.JsonTools.ParseJsonString 73 | JsonData.Utilities.Parse.String 74 | 75 | 76 | JsonData.Utilities.Parse.JsonString 77 | JsonData.Utilities.Parse.String 78 | 79 | 80 | JsonTools.JsonTools.FromJsonFile 81 | JsonData.Utilities.Read.FromJsonFile 82 | 83 | 84 | JsonTools.JsonTools.ToJsonFile 85 | JsonData.Utilities.Write.ToJsonFile 86 | 87 | -------------------------------------------------------------------------------- /JsonData/Manifests/JsonData_DynamoCustomization.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JsonData 5 | 6 | 7 | 8 | JsonData 9 | 10 | 11 | JsonData.Utilities 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /JsonData/Manifests/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "contains_binaries": true, 3 | "contents": "", 4 | "dependencies": [], 5 | "description": "__Built for Dynamo 2.0__\r\n JsonData is a simple but powerful data managment package based on the JSON format. It makes use of .net dictionaries to create KeyValuePair data structures, with the extra functionality of representing them as JSON structures, so they can easily be imported or exported to files, queried, merged, etc.\r\nIt comes with methods to parse to and from JSON, XML and CSV, which are the most common formats for data sharing. Also, it has the ability of easily create nested structures by simply concatenating keys with a dot as separator.\r\nMore information on https://github.com/alvpickmans/JsonData\r\n", 6 | "engine": "dynamo", 7 | "engine_metadata": "", 8 | "engine_version": "2.0.1.4955", 9 | "file_hash": null, 10 | "group": "", 11 | "keywords": [ "json", "data", "jsonobject", "sort", "merge", "xml", "parse", "csv" ], 12 | "license": "MIT", 13 | "name": "JsonData", 14 | "node_libraries": [ "JsonData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "JsonDataUI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" ], 15 | "repository_url": "https://github.com/alvpickmans/JsonData", 16 | "site_url": "", 17 | "version": "2.0.1" 18 | } -------------------------------------------------------------------------------- /JsonData/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("JsonData")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("JsonData")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b8641242-9127-4483-980e-9739e5f8ec23")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /JsonData/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace JsonData.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("JsonData.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap JsonData_Elements_JsonObject_ByKeysAndValues_Large { 67 | get { 68 | object obj = ResourceManager.GetObject("JsonData_Elements_JsonObject_ByKeysAndValues_Large", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap JsonData_Elements_JsonObject_ByKeysAndValues_Small { 77 | get { 78 | object obj = ResourceManager.GetObject("JsonData_Elements_JsonObject_ByKeysAndValues_Small", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /JsonData/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 124 | YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAV7SURBVHhe7Z3RkdQ6EEU3BEJ4GUAIhPBC4ItvQiADQiAB 125 | qgiBEAiBEAgBdIs2NKZnpPFY223POVX3g9qeWqvvtSx75eEJAAAAAAAAAAAAAAAAAAAAAAAAAAAA4G5e 126 | NL120r/PyiON9SL/N31o+tL0I5Aac1Y0tmjM6oV6ot6ckv+aPjZ9b4oa4PWIAfBSj9Qr9ezwaIpTsqOB 127 | XtKjB8BLvTvsZeJV07emaGDXRAD+lnqoXh4KXctGpvtIBOBfqZeHCYEOdKv5EgGIdYgQ6Hp167T/tUmL 128 | nvemM98aaWzLODVmjT3qySWpvjSjCz6lWU04xUr3TtQD9WJ01lRtSZTu6IDX+tx05rN8K+rJpWcjXgpK 129 | yf69a4oO2EvTHlxnJARvmsrRO3CtDTjz+6hHvcuBZtFyRAfqpRkCxuitpXQylUILmehAvVjwjaPbvaiH 130 | XqXo3d+WS+wBiProVeqZQC8AWh+U4eWntz+uycqy6T0jKPXAjADsT29RTQC2EpnuZWXZEIBZRKZ7WVk2 131 | BGAWkeleVpYNAZhFZLqXlWVDAGYRme5lZdkQgFlEpntZWTYEYBaR6V5Wlg0BmEVkupeVZUMAZhGZ7mVl 132 | 2RCAWUSme1lZNgRgFpHpXlaWDQGYRWS6l5VlQwBmEZnuZWXZEIBZRKZ7WVk2hwqANilGB7mIANzOoQLQ 133 | 28NWai97ZLqXlWWjjZ/rPnqV6mnvbaBS25gj072sLBsZvO6jV5m3hPQiaHSAXqU2hEame1lZNiMbQ9Mv 134 | AyN72Etd/0VkupeVVaA3s2oWSHvXQgkdebmx1GJFRKZ7WVkFRmZXefCsO4T1y/SKV3Qwa2lxWI7IdC8r 135 | q8Jor1W3axB03dbbPFqMSJrKR99gle56D7AZ8arp9SSFxjtFn9lFNrxb0BQ/MtMukkfyavFNHm5ag/VW 136 | odekz95Fa9aXpsicQ8uGt4XRV+8jbfJjSwB01u+y4m/NIgD/ohmk93wg0rQAaJUq03Wfv+tqtDWLAFxG 137 | J5l6rjD07hQkAlBFNrx7WdZn6QFYi0tARza8rZS7BFzSpl/oac0iAH/Q7LrF+EWb/FDa9EFJK9DeX6fW 138 | uvc2kAD8YuttoDxb/Nv1YZyeTo2mcfODoNasD00KwQyF5jhFn9lFNrxbGDVfJ9yzftm0UjXyYGjX9O1B 139 | MyIy/besrAI6e9f9XOvZHwV7tODjj0Hz6K3w9fNd77620NsNJO1yZ7AXkeleVpaNZs51H9cqM7v2ksqG 140 | kNvpTf+a+svQe06twZQhMt3LyrLpLbRL9bR3GSi1DohM97KybHq33aUW173rFQG4HQIwi8h0LyvLhgDM 141 | IjLdy8qyIQCziEz3srJsCMAsItO9rCwbAjCLyHQvK8uGAMwiMt3LyrIhALOITPeysmwIwCwi072sLBsC 142 | MIvIdC8ry4YAzCIy3cvKsiEAs4hM97KybAjALCLTvawsGwIwi8h0LyvLhgDMIjLdy8qyIQCziEz3srJs 143 | ThWAUtuXItO9rCybdQ/XStsJHKGDiQ7SK3336kIz+f01WVkm2kQb9dCrHNFBepXaGFqc3n/Era345ehd 144 | s0pdBgqjmbK3y1obRsvRS61UaidrUfSKV9Q7r5Kz6ch1S9IW8jLrgUKoJyPma/ov27+RAUia4jRjEIRf 145 | J4560Zv2F5WeRWXoyAujXlobKDgamFTqNbKd0diWcWrMGnvUk0sq8S5gj5EvN7ymUg84dqb3vKSnUvf+ 146 | 1xh5YfSSCECsw91Ga7C3Xg4kAvC31MPDnPlrRle2XgTgj9S7UyyUtfjRYEZmhEcPgHqkXp12MaxF4rUv 147 | nXrEAKgX6smzfsdPJdSYRWd+NqCx+bECAAAAAAAAAAAAAAAAAAAAAAAAAAAA3MXT00+nnH+M4lfoBwAA 148 | AABJRU5ErkJggg== 149 | 150 | 151 | 152 | 153 | iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 154 | YQUAAAAJcEhZcwAAAsQAAALEAVuRnQsAAAD5SURBVFhH7ZbBEYIwFEQpwRLoQEqgFE+eKYEOaMQeKIES 155 | LMESdB+Tz8QBDEFGdMyb2QMhf/8SIJAlEt9OKdVS3h/FQQ21eERzkm7S3WmNCTVWjxeei/ALr9K7K4CH 156 | +S3yaSRrvhUWgkBBWmnR5OPl3EitVLihOfDCE+8gMQFofpdCz0gK8DsBKomJKGQaE4Dz5kuPEZYQjTYN 157 | Nahdoyi5coPG/ub2tMKfCECP2QDG5C2QWS6VE+okmlXe2CBXDsFb4PPfbwGkALsHsM9x1x+9QI0LmksH 158 | NzRH1OeYq2Ey2vqHJLRSA7v+kvlgwsaxdgWoXRM+kfgUWfYAmmIIbtFpxBUAAAAASUVORK5CYII= 159 | 160 | 161 | -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Add.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Add.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.ByDictionary.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.ByDictionary.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.ByKeysAndValues.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.ByKeysAndValues.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.FilterByKeyAndValue.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.FilterByKeyAndValue.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.GetValueByKey.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.GetValueByKey.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Keys.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Keys.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Merge.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Merge.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Remove.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Remove.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Size.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Size.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.SortByKeyValue.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.SortByKeyValue.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.SortKeys.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.SortKeys.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.ToDictionary.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.ToDictionary.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Values.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Elements.JsonObject.Values.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Parse.CSVString.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Parse.CSVString.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Parse.JsonToCSV.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Parse.JsonToCSV.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Parse.JsonToString.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Parse.JsonToString.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Parse.JsonToXML.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Parse.JsonToXML.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Parse.String.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Parse.String.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Parse.XMLString.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Parse.XMLString.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Read.FromCSVFile.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Read.FromCSVFile.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Read.FromJsonFile.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Read.FromJsonFile.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Read.FromXMLFile.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Read.FromXMLFile.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Write.ToCSVFile.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Write.ToCSVFile.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Write.ToJsonFile.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Write.ToJsonFile.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonData.Utilities.Write.ToXMLFile.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonData.Utilities.Write.ToXMLFile.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Large/JsonDataUI.JsonOptions.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Large/JsonDataUI.JsonOptions.Large.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Add.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Add.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.ByDictionary.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.ByDictionary.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.ByKeysAndValues.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.ByKeysAndValues.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.FilterByKeyAndValue.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.FilterByKeyAndValue.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.GetValueByKey.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.GetValueByKey.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Keys.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Keys.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Merge.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Merge.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Remove.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Remove.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Size.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Size.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.SortByKeyValue.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.SortByKeyValue.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.SortKeys.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.SortKeys.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.ToDictionary.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.ToDictionary.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Values.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Elements.JsonObject.Values.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Parse.CSVString.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Parse.CSVString.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Parse.JsonToCSV.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Parse.JsonToCSV.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Parse.JsonToString.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Parse.JsonToString.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Parse.JsonToXML.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Parse.JsonToXML.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Parse.String.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Parse.String.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Parse.XMLString.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Parse.XMLString.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Read.FromCSVFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Read.FromCSVFile.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Read.FromJsonFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Read.FromJsonFile.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Read.FromXMLFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Read.FromXMLFile.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Write.ToCSVFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Write.ToCSVFile.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Write.ToJsonFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Write.ToJsonFile.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonData.Utilities.Write.ToXMLFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonData.Utilities.Write.ToXMLFile.Small.png -------------------------------------------------------------------------------- /JsonData/Resources/Images/Small/JsonDataUI.JsonOptions.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonData/Resources/Images/Small/JsonDataUI.JsonOptions.Small.png -------------------------------------------------------------------------------- /JsonData/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /JsonData/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /JsonData/src/Elements/JsonArray.cs: -------------------------------------------------------------------------------- 1 | #region namesapces 2 | using Autodesk.DesignScript.Runtime; 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Linq; 5 | using System.Collections.Generic; 6 | #endregion 7 | 8 | namespace JsonData.Elements 9 | { 10 | /// 11 | /// Class for handle JArray objects. 12 | /// 13 | [JsonConverter(typeof(JsonArrayConverter))] 14 | public class JsonArray : JsonNet 15 | { 16 | #region Variables 17 | internal List jsonArray = new List(); 18 | 19 | /// 20 | /// Returns elements in the JsonArray object. 21 | /// 22 | /// Elements in JsonArray 23 | /// 24 | /// json, jsonarray, elements, items 25 | /// 26 | public List Elements => jsonArray; 27 | 28 | /// 29 | /// Returns the number of elements in the JsonArray object. 30 | /// 31 | /// i Number of elements in JsonArray 32 | /// 33 | /// json, jsonarray, size 34 | /// 35 | public int Size => jsonArray.Count; 36 | 37 | #endregion 38 | 39 | #region Constructors 40 | /// 41 | /// JsonArray constructor by a given list of elements. 42 | /// 43 | /// Valid list of items 44 | internal JsonArray(List items) 45 | { 46 | foreach (var item in items) 47 | { 48 | jsonArray.Add(item); 49 | } 50 | } 51 | 52 | /// 53 | /// JsonArray constructor by a given JArray type of object. 54 | /// 55 | /// JArray object 56 | internal JsonArray(JArray jArray) 57 | { 58 | foreach(JToken tk in jArray.Children()) 59 | { 60 | object o = JsonNet.ReturnValidObject(tk); 61 | jsonArray.Add(o); 62 | } 63 | } 64 | 65 | #endregion 66 | 67 | #region Methods 68 | /// 69 | /// JsonArray constructor by a given set of elements. 70 | /// 71 | /// Elements to create the New JsonArray 72 | /// New JsonArray 73 | /// 74 | /// json, jsonarray, create 75 | /// 76 | public static JsonArray ByElements([ArbitraryDimensionArrayImport] List elements) 77 | { 78 | return new JsonArray(elements); 79 | } 80 | 81 | 82 | /// 83 | /// Serialize JsonArray to String 84 | /// 85 | /// 86 | public override string ToString() 87 | { 88 | return JsonConvert.SerializeObject(this, Formatting.Indented); 89 | } 90 | #endregion 91 | 92 | } 93 | 94 | 95 | } 96 | -------------------------------------------------------------------------------- /JsonData/src/Elements/JsonOption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Autodesk.DesignScript.Runtime; 7 | using Newtonsoft.Json; 8 | using Dynamo.Graph.Nodes; 9 | 10 | namespace JsonData.Elements 11 | { 12 | 13 | /// 14 | /// Options for JsonObjects 15 | /// 16 | [IsVisibleInDynamoLibrary(false)] 17 | public enum JsonOption 18 | { 19 | /// 20 | /// You are reading this because of a known issue on Dynamo 2.0. These options are implemented 21 | /// and embeded on nodes with dropdown selector. They will automatically hide once bug is resolve on next version. 22 | /// No action. 23 | /// 24 | None, 25 | /// 26 | /// You are reading this because of a known issue on Dynamo 2.0. These options are implemented 27 | /// and embeded on nodes with dropdown selector. They will automatically hide once bug is resolve on next version. 28 | /// If object contains the key, update its value. 29 | /// 30 | Update, 31 | /// 32 | /// You are reading this because of a known issue on Dynamo 2.0. These options are implemented 33 | /// and embeded on nodes with dropdown selector. They will automatically hide once bug is resolve on next version. 34 | /// If object contains the key, combine the values. 35 | /// 36 | Combine 37 | } 38 | 39 | /// 40 | /// Static Class wrapping method to return JsonOption by its name 41 | /// 42 | [IsVisibleInDynamoLibrary(false)] 43 | public static class JsonOptions 44 | { 45 | /// 46 | /// Static Method to return a JsonOption by its name. 47 | /// 48 | [IsVisibleInDynamoLibrary(false)] 49 | public static JsonOption ReturnOptionByName(string name) 50 | { 51 | return (JsonOption)Enum.Parse(typeof(JsonOption), name); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /JsonData/src/JsonConverter.cs: -------------------------------------------------------------------------------- 1 | #region namespace 2 | using JsonData.Elements; 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Linq; 5 | using Newtonsoft.Json.Serialization; 6 | using System.Linq; 7 | using System; 8 | using System.Collections.Generic; 9 | #endregion 10 | 11 | namespace JsonData 12 | { 13 | internal class JsonObjectConverter : JsonConverter 14 | { 15 | public override bool CanConvert(Type objectType) 16 | { 17 | return typeof(JsonObject).IsAssignableFrom(objectType); 18 | } 19 | 20 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 21 | { 22 | JObject jsonObject = JObject.Load(reader); 23 | return new JsonObject(jsonObject); 24 | } 25 | 26 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 27 | { 28 | var json = value as JsonObject; 29 | writer.WriteStartObject(); 30 | foreach (KeyValuePair item in json.dict) 31 | { 32 | writer.WritePropertyName(item.Key); 33 | Type type = item.Value.GetType(); 34 | var temp = item.Value as IEnumerable; 35 | if (temp != null) 36 | { 37 | var serializedList = new List(); 38 | foreach (var element in temp) 39 | { 40 | try 41 | { 42 | JsonConvert.SerializeObject(element); 43 | serializedList.Add(element); 44 | } 45 | catch (Exception) 46 | { 47 | serializedList.Add(element.ToString()); 48 | } 49 | } 50 | serializer.Serialize(writer, serializedList); 51 | } 52 | else 53 | { 54 | try 55 | { 56 | serializer.Serialize(writer, item.Value); 57 | } 58 | catch (Exception) 59 | { 60 | serializer.Serialize(writer, item.Value.ToString(), typeof(string)); 61 | } 62 | } 63 | 64 | } 65 | writer.WriteEndObject(); 66 | } 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /JsonData/src/JsonNet.cs: -------------------------------------------------------------------------------- 1 | #region namesapces 2 | using JsonData.Elements; 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Linq; 5 | using System; 6 | using System.Linq; 7 | using System.Diagnostics; 8 | using System.Collections.Generic; 9 | #endregion 10 | 11 | namespace JsonData 12 | { 13 | /// 14 | /// Parent class for json elements. 15 | /// 16 | public abstract class JsonNet 17 | { 18 | #region Methods 19 | 20 | /// 21 | /// Returns a valid package json object the input object. 22 | /// Same implementation as in: 23 | /// https://github.com/pboyer/Dynamo/blob/ac9178c5790e6704ce5f5a768ab3eaceb436782d/src/Libraries/CoreNodes/JSON.cs#L24 24 | /// 25 | /// Input object 26 | /// return object 27 | internal static object ReturnValidObject(JToken token) 28 | { 29 | switch (token.Type) 30 | { 31 | case JTokenType.Object: 32 | return new JsonObject(token as JObject); 33 | case JTokenType.Array: 34 | var arr = token as JArray; 35 | return arr.Select(ReturnValidObject).ToList(); 36 | case JTokenType.Null: 37 | return null; 38 | case JTokenType.Integer: 39 | case JTokenType.Float: 40 | case JTokenType.String: 41 | case JTokenType.Boolean: 42 | case JTokenType.Date: 43 | case JTokenType.TimeSpan: 44 | return (token as JValue).Value; 45 | case JTokenType.Guid: 46 | case JTokenType.Uri: 47 | return (token as JValue).Value.ToString(); 48 | default: 49 | return null; 50 | } 51 | } 52 | 53 | #endregion 54 | 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /JsonData/src/Utilities/ParseTools.cs: -------------------------------------------------------------------------------- 1 | #region namesapces 2 | using Autodesk.DesignScript.Runtime; 3 | using Newtonsoft.Json.Linq; 4 | using Newtonsoft.Json; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.IO; 8 | using System.Xml; 9 | using Microsoft.VisualBasic.FileIO; 10 | using System.Linq; 11 | using System.Xml.Schema; 12 | using System.Xml.XPath; 13 | using JsonData.Elements; 14 | #endregion 15 | 16 | namespace JsonData.Utilities 17 | { 18 | /// 19 | /// Class to handle parsing strings to Json format. 20 | /// 21 | public static class Parse 22 | { 23 | 24 | /// 25 | /// Parses a json formated string. It will return JsonObjects 26 | /// or other match that the parser can do from the input. 27 | /// Error will be thrown if parser fails. 28 | /// 29 | /// String with a json format 30 | /// Object returned by the parser 31 | /// 32 | /// json, parse, jsonstring 33 | /// 34 | public static object String(string jsonString) 35 | { 36 | if (jsonString == null) { throw new ArgumentNullException("jsonString"); } 37 | 38 | JToken parsed = JToken.Parse(jsonString); 39 | return JsonNet.ReturnValidObject(parsed); 40 | } 41 | 42 | 43 | /// 44 | /// Parses a xml formated string. It will return JsonObject, 45 | /// JsonArray or other match that the parser can do from the input. 46 | /// Error will be thrown if parser fails. 47 | /// 48 | /// XML formatted string 49 | /// Object returned by the parser 50 | /// Type of the returned object 51 | /// 52 | /// json, parse, xml 53 | /// 54 | public static object XMLString(string xmlString) 55 | { 56 | if (xmlString == null) { throw new ArgumentNullException("xmlString"); } 57 | 58 | XmlDocument xmlDoc = new XmlDocument(); 59 | xmlDoc.LoadXml(xmlString); 60 | string jsonString = JsonConvert.SerializeXmlNode(xmlDoc); 61 | return String(jsonString); 62 | 63 | } 64 | 65 | /// 66 | /// Parses a CSV formated string. It will return a list of JsonObjects 67 | /// Error will be thrown if parser fails. 68 | /// 69 | /// CSV formatted string 70 | /// List of JsonObjets returned by the parser 71 | /// 72 | /// json, parse, csv 73 | /// 74 | public static List CSVString(string csvString) 75 | { 76 | try 77 | { using (StringReader sr = new StringReader(csvString)) 78 | using (TextFieldParser parser = new TextFieldParser(sr)) 79 | { 80 | parser.TextFieldType = FieldType.Delimited; 81 | parser.SetDelimiters(","); 82 | List jsonObjects = new List(); 83 | string[] headers = null; 84 | while (!parser.EndOfData) 85 | { 86 | dynamic[] fields = parser.ReadFields(); 87 | if(headers == null) 88 | { 89 | headers = fields as string[]; 90 | } 91 | else 92 | { 93 | Elements.JsonObject jObject = Elements.JsonObject.ByKeysAndValues(headers.ToList(), fields.ToList(), false, JsonOption.None); 94 | jsonObjects.Add(jObject); 95 | } 96 | } 97 | 98 | return jsonObjects; 99 | } 100 | } 101 | catch (Exception ex) 102 | { 103 | throw new Exception(ex.Message); 104 | } 105 | } 106 | 107 | 108 | /// 109 | /// Converts a JsonObject to XML string format. 110 | /// 111 | /// JsonObject 112 | /// Value to wrap XML in case is necesary. 113 | /// More info https://www.newtonsoft.com/json/help/html/ConvertingJSONandXML.htm#! 114 | /// XML formatted string converted from JsonObject 115 | /// 116 | /// json, convert, xml, parse 117 | /// 118 | public static string JsonToXML(Elements.JsonObject jsonObject , string root = "") 119 | { 120 | try 121 | { 122 | XmlDocument doc = (XmlDocument)JsonConvert.DeserializeXmlNode(jsonObject.ToString(), root); 123 | StringWriter sw = new StringWriter(); 124 | XmlTextWriter xw = new XmlTextWriter(sw); 125 | xw.Formatting = System.Xml.Formatting.Indented; 126 | doc.WriteTo(xw); 127 | return sw.ToString(); 128 | } 129 | catch (Exception e) 130 | { 131 | string exceptionMsg = e.Message; 132 | string msg1 = "JSON root object has multiple properties"; 133 | string msg2 = "Root containig more than one property"; 134 | string msg3 = "DocumentElement"; 135 | if (exceptionMsg.Contains(msg1) || exceptionMsg.Contains(msg2) || exceptionMsg.Contains(msg3)) 136 | { 137 | throw new Exception("Root containig more than one property. Try wrapping the input on a JsonObject element or adding a value on the root input parameter"); 138 | } 139 | else 140 | { 141 | throw new Exception(e.Message); 142 | } 143 | } 144 | } 145 | 146 | /// 147 | /// Converts a list of JsonObject to CSV string format. JsonObjects must have one level only 148 | /// (no other JsonObject or JsonArray as values), being the keys the header of the CSV string. 149 | /// 150 | /// List of JsonObjects with same keys 151 | /// CSV formatted string converted from a list of JsonObjects 152 | /// 153 | /// json, convert, csv, parse 154 | /// 155 | public static string JsonToCSV(List jsonObjects) 156 | { 157 | try 158 | { 159 | List headers = null; 160 | string csvString = ""; 161 | foreach(Elements.JsonObject jObject in jsonObjects) 162 | { 163 | if(headers == null) 164 | { 165 | headers = jObject.Keys; 166 | csvString += string.Join(", ", headers); 167 | } 168 | else if(!headers.SequenceEqual(jObject.Keys)) 169 | { 170 | throw new Exception("Not every JsonObject has the same keys. Please ammend to generate a valid CSV string."); 171 | } 172 | 173 | csvString += Environment.NewLine + string.Join(", ", jObject.Values.Select(value => value.ToString())); 174 | 175 | } 176 | return csvString; 177 | } 178 | catch (Exception e) 179 | { 180 | throw new Exception(e.Message); 181 | } 182 | } 183 | 184 | /// 185 | /// Converts a list of JsonObject to CSV string format. 186 | /// 187 | /// Single or list of JsonObjects 188 | /// Returns the parsed string 189 | /// 190 | /// json, parse, to string 191 | /// 192 | public static string JsonToString([ArbitraryDimensionArrayImport] List jsonObjects) 193 | { 194 | if (jsonObjects == null) { throw new ArgumentNullException("jsonObjects"); } 195 | 196 | if (jsonObjects.Count == 1) 197 | { 198 | return jsonObjects[0].ToString(); 199 | } 200 | else 201 | { 202 | return JsonConvert.SerializeObject(jsonObjects, Newtonsoft.Json.Formatting.Indented); 203 | } 204 | } 205 | 206 | } 207 | } 208 | -------------------------------------------------------------------------------- /JsonData/src/Utilities/ReadTools.cs: -------------------------------------------------------------------------------- 1 | #region namesapces 2 | using Autodesk.DesignScript.Runtime; 3 | using Newtonsoft.Json.Linq; 4 | using Newtonsoft.Json; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.IO; 8 | using System.Xml; 9 | using System.Xml.Schema; 10 | using System.Xml.XPath; 11 | using Microsoft.VisualBasic.FileIO; 12 | using JsonData; 13 | //using JsonElements; 14 | #endregion 15 | 16 | namespace JsonData.Utilities 17 | { 18 | /// 19 | /// Class to handle parsing and read/write from and to json format strings or files. 20 | /// 21 | public static class Read 22 | { 23 | /// 24 | /// Reads and parses a json file. It will return JsonObject, 25 | /// JsonArray or other match that the parser can do from the input. 26 | /// Error will be thrown if parser fails. 27 | /// 28 | /// Filepath of the json file 29 | /// Object returned by the parser. 30 | /// Type of the returned object. 31 | /// 32 | /// json, parser, from file, jsonfile 33 | /// 34 | public static object FromJsonFile(string filepath) 35 | { 36 | try 37 | { 38 | return Parse.String(File.ReadAllText(filepath)); 39 | } 40 | catch(Exception ex) 41 | { 42 | throw ex; 43 | } 44 | 45 | } 46 | 47 | /// 48 | /// Reads and parses a XML file. It will return JsonObject, JsonArray or other match that the parser can do from the input. 49 | /// Error will be thrown if parser fails. 50 | /// 51 | /// Filepath of the XML file 52 | /// Object returned by the parser. 53 | /// Type of the returned object. 54 | /// 55 | /// json, parser, from file, xml, xmlfile 56 | /// 57 | public static object FromXMLFile(string filepath) 58 | { 59 | try 60 | { 61 | return Parse.XMLString(File.ReadAllText(filepath)); 62 | } 63 | catch (Exception ex) 64 | { 65 | throw ex; 66 | } 67 | } 68 | 69 | /// 70 | /// Reads and parses a CSV formated file. It will return a list of JsonObjects 71 | /// Error will be thrown if parser fails. 72 | /// 73 | /// Filepath of the XML file 74 | /// List of JsonObjects returned by the parser. 75 | /// 76 | /// json, parser, from file, csv, csvfile 77 | /// 78 | public static List FromCSVFile(string filepath) 79 | { 80 | try 81 | { 82 | return Parse.CSVString(File.ReadAllText(filepath)); 83 | } 84 | catch (Exception ex) 85 | { 86 | throw ex; 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /JsonData/src/Utilities/WriteTools.cs: -------------------------------------------------------------------------------- 1 | #region namesapces 2 | using Autodesk.DesignScript.Runtime; 3 | using Newtonsoft.Json.Linq; 4 | using Newtonsoft.Json; 5 | using System; 6 | using System.Linq; 7 | using System.Collections.Generic; 8 | using System.IO; 9 | using System.Text; 10 | //using JsonElements; 11 | #endregion 12 | 13 | namespace JsonData.Utilities 14 | { 15 | /// 16 | /// Class to handle parsing and read/write from and to json format strings or files. 17 | /// 18 | public static class Write 19 | { 20 | /// 21 | /// Writes the JsonObject or JsonArray to a json file. 22 | /// 23 | /// Single or list of JsonObjects 24 | /// File path for json file 25 | /// Returns the filepath if write operation is succesful 26 | /// 27 | /// json, parser, to file, jsonfile 28 | /// 29 | public static string ToJsonFile([ArbitraryDimensionArrayImport] List jsonObjects, string filepath) 30 | { 31 | if(jsonObjects == null) { throw new ArgumentNullException("json"); } 32 | if (filepath == null) { throw new ArgumentNullException("filepath"); } 33 | 34 | string ext = Path.GetExtension(filepath); 35 | List validExt = new List() { ".json", ".dyn" }; 36 | 37 | if (validExt.Contains(ext.ToLower())) 38 | { 39 | File.WriteAllText(filepath, Parse.JsonToString(jsonObjects)); 40 | return filepath; 41 | } 42 | else 43 | { 44 | throw new Exception(String.Format("File extension is not of {0} type. Please select a valid {0} file.", validExt)); 45 | } 46 | } 47 | 48 | /// 49 | /// Writes the JsonObject or JsonArray to a XML file. 50 | /// 51 | /// JsonObject or JsonArray element 52 | /// File path for XML file 53 | /// Value to wrap XML in case is necesary. 54 | /// More info https://www.newtonsoft.com/json/help/html/ConvertingJSONandXML.htm#! 55 | /// Returns the filepath if write operation is succesful 56 | /// 57 | /// json, parser, to file, xmlfile, xml 58 | /// 59 | public static string ToXMLFile(Elements.JsonObject jsonObject, string filepath, string root= "") 60 | { 61 | 62 | try 63 | { 64 | string xml = Parse.JsonToXML(jsonObject, root); 65 | File.WriteAllText(filepath, xml.ToString()); 66 | return filepath; 67 | } 68 | catch(Exception e ) 69 | { 70 | throw new Exception(e.Message); 71 | } 72 | } 73 | 74 | /// 75 | /// Writes a list of JsonObject to a CSV file. JsonObjects must have one level only 76 | /// (no other JsonObject or JsonArray as values), being the keys the header of the CSV string. 77 | /// 78 | /// List of JsonObjects 79 | /// File path for CSV file 80 | /// Returns the filepath if write operation is succesful 81 | /// 82 | /// json, parser, to file, csvfile, csv 83 | /// 84 | public static string ToCSVFile(List jsonObjects, string filepath) 85 | { 86 | try 87 | { 88 | if (jsonObjects == null) { throw new ArgumentNullException("dict"); } 89 | if (filepath == null) { throw new ArgumentNullException("filepath"); } 90 | 91 | string ext = Path.GetExtension(filepath); 92 | if (ext.ToLower().Contains("csv")) 93 | { 94 | string csv = Parse.JsonToCSV(jsonObjects); 95 | File.WriteAllText(filepath, csv); 96 | return filepath; 97 | } 98 | else 99 | { 100 | throw new Exception("Not proper CSV file selected. Make sure you are writing to a file with '.csv' extension."); 101 | } 102 | } 103 | catch (Exception e) 104 | { 105 | throw new Exception(e.Message); 106 | } 107 | } 108 | 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /JsonDataTests/JsonDataTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {D5D3C259-F524-4322-B027-FD30919D3B36} 9 | Library 10 | Properties 11 | JsonDataTests 12 | JsonDataTests 13 | v4.6.1 14 | 512 15 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 16 | 10.0 17 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 18 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 19 | False 20 | UnitTest 21 | 22 | 23 | 24 | 25 | 26 | true 27 | full 28 | false 29 | bin\Debug\ 30 | DEBUG;TRACE 31 | prompt 32 | 4 33 | 34 | 35 | pdbonly 36 | true 37 | bin\Release\ 38 | TRACE 39 | prompt 40 | 4 41 | 42 | 43 | 44 | ..\packages\CommonServiceLocator.2.0.3\lib\net45\CommonServiceLocator.dll 45 | False 46 | 47 | 48 | ..\packages\DynamoVisualProgramming.Core.2.0.1-beta4364\lib\net45\DesignScriptBuiltin.dll 49 | False 50 | 51 | 52 | ..\packages\DynamoVisualProgramming.Core.2.0.1-beta4364\lib\net45\DSIronPython.dll 53 | False 54 | 55 | 56 | ..\packages\DynamoVisualProgramming.Core.2.0.1-beta4364\lib\net45\DynamoApplications.dll 57 | False 58 | 59 | 60 | ..\packages\DynamoVisualProgramming.Core.2.0.1-beta4364\lib\net45\DynamoCore.dll 61 | False 62 | 63 | 64 | ..\packages\DynamoVisualProgramming.Tests.2.0.1-beta4364\lib\net45\DynamoCoreTests.dll 65 | False 66 | 67 | 68 | ..\packages\DynamoVisualProgramming.Core.2.0.1-beta4364\lib\net45\DynamoInstallDetective.dll 69 | False 70 | 71 | 72 | ..\packages\DynamoVisualProgramming.DynamoServices.2.0.1-beta4364\lib\net45\DynamoServices.dll 73 | False 74 | 75 | 76 | ..\packages\DynamoVisualProgramming.Core.2.0.1-beta4364\lib\net45\DynamoShapeManager.dll 77 | False 78 | 79 | 80 | ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.0.1-beta4364\lib\net45\DynamoUnits.dll 81 | False 82 | 83 | 84 | ..\packages\DynamoVisualProgramming.Core.2.0.1-beta4364\lib\net45\DynamoUtilities.dll 85 | False 86 | 87 | 88 | ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll 89 | False 90 | 91 | 92 | ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll 93 | False 94 | 95 | 96 | ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll 97 | False 98 | 99 | 100 | ..\packages\MSTest.TestFramework.1.3.0-beta2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll 101 | False 102 | 103 | 104 | ..\packages\MSTest.TestFramework.1.3.0-beta2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll 105 | False 106 | 107 | 108 | ..\packages\NUnit.3.10.1\lib\net45\nunit.framework.dll 109 | False 110 | 111 | 112 | ..\packages\DynamoVisualProgramming.Core.2.0.1-beta4364\lib\net45\ProtoCore.dll 113 | False 114 | 115 | 116 | ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.0.1-beta4364\lib\net45\ProtoGeometry.dll 117 | False 118 | 119 | 120 | 121 | ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll 122 | False 123 | 124 | 125 | ..\packages\DynamoVisualProgramming.Tests.2.0.1-beta4364\lib\net45\SystemTestServices.dll 126 | False 127 | 128 | 129 | ..\packages\DynamoVisualProgramming.Tests.2.0.1-beta4364\lib\net45\TestServices.dll 130 | False 131 | 132 | 133 | ..\packages\DynamoVisualProgramming.Core.2.0.1-beta4364\lib\net45\VMDataBridge.dll 134 | False 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | {B8641242-9127-4483-980E-9739E5F8EC23} 157 | JsonData 158 | False 159 | 160 | 161 | 162 | 163 | 164 | 165 | False 166 | 167 | 168 | False 169 | 170 | 171 | False 172 | 173 | 174 | False 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 184 | 185 | 186 | 187 | 188 | 189 | 190 | 197 | -------------------------------------------------------------------------------- /JsonDataTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("JsonDataTests1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("JsonDataTests1")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d5d3c259-f524-4322-b027-fd30919d3b36")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /JsonDataTests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /JsonDataTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /JsonDataTests/src/Elements/JsonObjectTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Diagnostics; 7 | using JsonData; 8 | using NUnit.Framework; 9 | 10 | namespace JsonData.Elements.Tests 11 | { 12 | [TestFixture] 13 | public class JsonObjectTests 14 | { 15 | #region Base JsonObject 16 | internal static List keys = new List() { "oneKey", "nested.key", "two.nested.keys" } ; 17 | internal static List values = new List() { "value", 1, new List() { 1,2,3} }; 18 | internal static JsonObject json= JsonObject.ByKeysAndValues(keys, values, false, JsonOption.None); 19 | internal static JsonObject jsonNested = JsonObject.ByKeysAndValues(keys, values, true, JsonOption.None); 20 | #endregion 21 | 22 | [Test] 23 | [Category("UnitTests")] 24 | public static void ByKeysAndValuesTest() 25 | { 26 | Assert.AreEqual(new List() { "oneKey", "nested", "two"}, jsonNested.Keys); 27 | Assert.AreEqual(keys, json.Keys); 28 | Assert.AreEqual(values, json.Values); 29 | Assert.AreEqual(3, jsonNested.Size); 30 | } 31 | 32 | [Test] 33 | [Category("UnitTests")] 34 | public static void GetValueByKeyTest() 35 | { 36 | Assert.AreEqual("value", JsonObject.GetValueByKey(jsonNested,"oneKey")); 37 | Assert.AreEqual(1, JsonObject.GetValueByKey(json,"nested.key", false)); 38 | Assert.AreEqual(1, JsonObject.GetValueByKey(jsonNested,"nested.key")); 39 | Assert.AreEqual(new List() { 1, 2, 3 }, JsonObject.GetValueByKey(jsonNested,"two.nested.keys")); 40 | 41 | } 42 | 43 | 44 | [Test] 45 | [Category("UnitTests")] 46 | public static void NestedTest() 47 | { 48 | List k = new List() { "nested.one", "nested.two" }; 49 | List v = new List() { 1, 2 }; 50 | JsonObject jsonNested = JsonObject.ByKeysAndValues(k, v, true, JsonOption.None); 51 | Assert.IsInstanceOf(typeof(JsonObject), JsonObject.GetValueByKey(jsonNested,"nested")); 52 | } 53 | 54 | [Test] 55 | [Category("UnitTests")] 56 | public static void FilterByKeyAndValueTest() 57 | { 58 | List keys = new List() { "one", "two", "three" }; 59 | List jsonObjects = new List() 60 | { 61 | JsonObject.ByKeysAndValues(keys, new List(){ 1, "dos", "tres" }, false, JsonOption.None), 62 | JsonObject.ByKeysAndValues(keys, new List(){ 2, "uno", 3}, false, JsonOption.None), 63 | JsonObject.ByKeysAndValues(new List(){"uno", "dos"}, new List(){ 1, 2}, false, JsonOption.None) 64 | }; 65 | 66 | var noKeyFound = JsonObject.FilterByKeyAndValue(jsonObjects, "eins", 1); 67 | Assert.AreEqual(0, noKeyFound["in"].Count); 68 | Assert.AreEqual(3, noKeyFound["out"].Count); 69 | 70 | var oneMatch = JsonObject.FilterByKeyAndValue(jsonObjects, "one", 1); 71 | Assert.AreEqual(1, oneMatch["in"].Count); 72 | Assert.AreEqual(2, oneMatch["out"].Count); 73 | 74 | var stringPartialMatch = JsonObject.FilterByKeyAndValue(jsonObjects, "two", "o"); 75 | Assert.AreEqual(2, stringPartialMatch["in"].Count); 76 | Assert.AreEqual(1, stringPartialMatch["out"].Count); 77 | 78 | var stringCaseMatch = JsonObject.FilterByKeyAndValue(jsonObjects, "three", "TRES"); 79 | Assert.AreEqual(1, stringCaseMatch["in"].Count); 80 | Assert.AreEqual(2, stringCaseMatch["out"].Count); 81 | } 82 | 83 | [Test] 84 | [Category("UnitTests")] 85 | public static void AddCombineTest() 86 | { 87 | var keys = new List() { "string", "string", "int", "int", "list", "list" }; 88 | var values = new List() { "first", "second", 1, 2, new List() { "start" }, 99 }; 89 | JsonObject json = JsonObject.ByKeysAndValues(keys, values, false, JsonOption.Combine); 90 | Assert.AreEqual(3, json.Size); 91 | //json.Values.ForEach(v => Assert.IsTrue(v is IList)); 92 | Assert.Pass("All values are lists"); 93 | } 94 | 95 | [Test] 96 | [Category("UnitTests")] 97 | public static void RemoveTest() 98 | { 99 | var keys = new List() { "first", "second", "nested.first", "nested.second" }; 100 | var values = new List() { 1, 2, 3.1, 3.2 }; 101 | JsonObject json = JsonObject.ByKeysAndValues(keys, values, true, JsonOption.None); 102 | 103 | JsonObject removeAll = JsonObject.Remove(json,keys, true); 104 | Assert.AreEqual(0, removeAll.Size); 105 | Assert.AreEqual(3, json.Size); 106 | 107 | JsonObject removeSingle = JsonObject.Remove(json, new List() { "first", "second" }, true); 108 | Assert.AreEqual(1, removeSingle.Size); 109 | Assert.AreEqual(3, json.Size); 110 | 111 | JsonObject removeNested = JsonObject.Remove(json, new List() { "nested.first" }, true); 112 | Assert.AreEqual(3, removeNested.Size); 113 | Assert.IsInstanceOf(typeof(int), removeNested.Values[0]); 114 | Assert.IsInstanceOf(typeof(JsonObject), removeNested.Values[2]); 115 | 116 | } 117 | 118 | } 119 | } -------------------------------------------------------------------------------- /JsonDataTests/src/Utilities/ParseTests.cs: -------------------------------------------------------------------------------- 1 | using JsonData.Utilities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using NUnit.Framework; 8 | 9 | namespace JsonData.Utilities.Tests 10 | { 11 | [TestFixture] 12 | public class ParseTests 13 | { 14 | [Test] 15 | [Category("UnitTests")] 16 | public void StringTest() 17 | { 18 | Assert.IsInstanceOf(typeof(Int64), Parse.String("2")); 19 | Assert.IsInstanceOf(typeof(Elements.JsonObject), Parse.String("{'one': 1}")); 20 | Assert.IsInstanceOf(typeof(List), Parse.String("[{'one': 1}, {'two': 2}]")); 21 | } 22 | 23 | [Test] 24 | [Category("UnitTests")] 25 | public void CVSStringTest() 26 | { 27 | string csv = @" 28 | id, name, surname 29 | 01, john, doe 30 | 02, jane, doe"; 31 | var parsed = Parse.CSVString(csv); 32 | Assert.IsInstanceOf(typeof(IList), parsed); 33 | Assert.AreEqual(2, parsed.Count); 34 | Assert.Contains("john", parsed.First().Values.ToList()); 35 | 36 | } 37 | 38 | } 39 | } -------------------------------------------------------------------------------- /JsonDataUI/JsonDataUI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {3FBDA8EF-CB25-40FC-ABAA-A6DCCDCD9A64} 9 | Library 10 | Properties 11 | JsonDataUI 12 | JsonDataUI 13 | v4.6.1 14 | 512 15 | 16 | 17 | 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | 30 | 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | 38 | 39 | true 40 | bin\Debug 2.0\ 41 | DEBUG;TRACE 42 | full 43 | AnyCPU 44 | prompt 45 | MinimumRecommendedRules.ruleset 46 | 47 | 48 | 49 | ..\packages\DynamoVisualProgramming.DynamoCoreNodes.2.0.2.6986\lib\net45\Analysis.dll 50 | False 51 | 52 | 53 | ..\packages\CommonServiceLocator.2.0.3\lib\net45\CommonServiceLocator.dll 54 | False 55 | 56 | 57 | ..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll 58 | False 59 | 60 | 61 | ..\packages\DynamoVisualProgramming.WpfUILibrary.2.0.2.6986\lib\net45\CoreNodeModels.dll 62 | False 63 | 64 | 65 | ..\packages\DynamoVisualProgramming.WpfUILibrary.2.0.2.6986\lib\net45\CoreNodeModelsWpf.dll 66 | False 67 | 68 | 69 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DesignScriptBuiltin.dll 70 | False 71 | 72 | 73 | ..\packages\DynamoVisualProgramming.DynamoCoreNodes.2.0.2.6986\lib\net45\DSCoreNodes.dll 74 | False 75 | 76 | 77 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DSIronPython.dll 78 | False 79 | 80 | 81 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DynamoApplications.dll 82 | False 83 | 84 | 85 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DynamoCore.dll 86 | False 87 | 88 | 89 | ..\packages\DynamoVisualProgramming.WpfUILibrary.2.0.2.6986\lib\net45\DynamoCoreWpf.dll 90 | False 91 | 92 | 93 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DynamoInstallDetective.dll 94 | False 95 | 96 | 97 | ..\packages\DynamoVisualProgramming.DynamoServices.2.0.2.6986\lib\net45\DynamoServices.dll 98 | False 99 | 100 | 101 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DynamoShapeManager.dll 102 | False 103 | 104 | 105 | ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.0.2.6986\lib\net45\DynamoUnits.dll 106 | False 107 | 108 | 109 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\DynamoUtilities.dll 110 | False 111 | 112 | 113 | ..\packages\DynamoVisualProgramming.DynamoCoreNodes.2.0.2.6986\lib\net45\GeometryColor.dll 114 | False 115 | 116 | 117 | ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll 118 | False 119 | 120 | 121 | ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll 122 | False 123 | 124 | 125 | ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll 126 | False 127 | 128 | 129 | ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll 130 | False 131 | 132 | 133 | ..\packages\NUnit.3.10.1\lib\net45\nunit.framework.dll 134 | False 135 | 136 | 137 | 138 | 139 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\ProtoCore.dll 140 | False 141 | 142 | 143 | ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.0.2.6986\lib\net45\ProtoGeometry.dll 144 | False 145 | 146 | 147 | 148 | 149 | 150 | 151 | ..\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll 152 | False 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | ..\packages\DynamoVisualProgramming.Core.2.0.2.6986\lib\net45\VMDataBridge.dll 163 | False 164 | 165 | 166 | 167 | 168 | 169 | 170 | Resources.resx 171 | True 172 | True 173 | 174 | 175 | JsonOptionsControl.xaml 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | ResXFileCodeGenerator 185 | Resources.Designer.cs 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | {b8641242-9127-4483-980e-9739e5f8ec23} 201 | JsonData 202 | True 203 | 204 | 205 | 206 | 207 | Designer 208 | MSBuild:Compile 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 309 | 310 | 311 | 312 | -------------------------------------------------------------------------------- /JsonDataUI/JsonDataUIImages.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/JsonDataUIImages.resources -------------------------------------------------------------------------------- /JsonDataUI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("JsonDataUI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("JsonDataUI")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3fbda8ef-cb25-40fc-abaa-a6dccdcd9a64")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /JsonDataUI/Resources/Images/Large/JsonDataUI.Nodes.Add.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/Resources/Images/Large/JsonDataUI.Nodes.Add.Large.png -------------------------------------------------------------------------------- /JsonDataUI/Resources/Images/Large/JsonDataUI.Nodes.ByKeysAndValues.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/Resources/Images/Large/JsonDataUI.Nodes.ByKeysAndValues.Large.png -------------------------------------------------------------------------------- /JsonDataUI/Resources/Images/Large/JsonDataUI.Nodes.GetValueByKey.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/Resources/Images/Large/JsonDataUI.Nodes.GetValueByKey.Large.png -------------------------------------------------------------------------------- /JsonDataUI/Resources/Images/Large/JsonDataUI.Nodes.Merge.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/Resources/Images/Large/JsonDataUI.Nodes.Merge.Large.png -------------------------------------------------------------------------------- /JsonDataUI/Resources/Images/Large/JsonDataUI.Nodes.Remove.Large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/Resources/Images/Large/JsonDataUI.Nodes.Remove.Large.png -------------------------------------------------------------------------------- /JsonDataUI/Resources/Images/Small/JsonDataUI.Nodes.Add.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/Resources/Images/Small/JsonDataUI.Nodes.Add.Small.png -------------------------------------------------------------------------------- /JsonDataUI/Resources/Images/Small/JsonDataUI.Nodes.ByKeysAndValues.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/Resources/Images/Small/JsonDataUI.Nodes.ByKeysAndValues.Small.png -------------------------------------------------------------------------------- /JsonDataUI/Resources/Images/Small/JsonDataUI.Nodes.GetValueByKey.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/Resources/Images/Small/JsonDataUI.Nodes.GetValueByKey.Small.png -------------------------------------------------------------------------------- /JsonDataUI/Resources/Images/Small/JsonDataUI.Nodes.Merge.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/Resources/Images/Small/JsonDataUI.Nodes.Merge.Small.png -------------------------------------------------------------------------------- /JsonDataUI/Resources/Images/Small/JsonDataUI.Nodes.Remove.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/JsonDataUI/Resources/Images/Small/JsonDataUI.Nodes.Remove.Small.png -------------------------------------------------------------------------------- /JsonDataUI/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /JsonDataUI/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /JsonDataUI/src/Elements/JsonObjectUI.cs: -------------------------------------------------------------------------------- 1 | #region namesapces 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Collections; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Linq; 8 | using CoreNodeModels; 9 | using Dynamo.Graph.Nodes; 10 | using Dynamo.UI.Commands; 11 | using Autodesk.DesignScript.Runtime; 12 | using JsonData; 13 | using ProtoCore.AST.AssociativeAST; 14 | using VMDataBridge; 15 | using Newtonsoft.Json; 16 | using JsonData.Elements; 17 | #endregion 18 | 19 | namespace JsonDataUI.Nodes 20 | { 21 | [NodeName("JsonObject.ByKeysAndValues")] 22 | [NodeCategory("JsonData.Create")] 23 | [NodeDescription("JsonObject constructor by a given key-value pair. It accepts nested structures by providing keys divided by points as a single string.")] 24 | [InPortTypes("string[]", "var[]")] 25 | [OutPortTypes("JsonData.Elements.JsonObject")] 26 | [NodeSearchTags("json", "bykeysandvalues", "create")] 27 | [IsDesignScriptCompatible] 28 | public class ByKeysAndValues : JsonOptionsBase 29 | { 30 | #region Constructor 31 | public ByKeysAndValues() : base() 32 | { 33 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("keys", Properties.Resources.JsonObject_Keys_Set))); 34 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("values", Properties.Resources.JsonObject_Values_Set))); 35 | OutPorts.Add(new PortModel(PortType.Output, this, new PortData("jsonObject", Properties.Resources.JsonObject_Json_Get))); 36 | } 37 | 38 | [JsonConstructor] 39 | public ByKeysAndValues( 40 | IEnumerable inPorts, 41 | IEnumerable outPorts) : base(inPorts,outPorts) 42 | { 43 | 44 | } 45 | 46 | #endregion 47 | 48 | [IsVisibleInDynamoLibrary(false)] 49 | public override IEnumerable BuildOutputAst(List inputAstNodes) 50 | { 51 | if (IsPartiallyApplied) 52 | { 53 | return new[] 54 | { 55 | AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) 56 | }; 57 | } 58 | 59 | // Level and Replication Guide 60 | // https://github.com/DynamoDS/Dynamo/blob/c4a3305559c04f04e6757a5db8a55bc98eae6c15/src/DynamoCore/Graph/Nodes/NodeModel.cs#L1328 61 | UseLevelAndReplicationGuide(inputAstNodes); 62 | 63 | return new[] 64 | { 65 | AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), 66 | AstFactory.BuildFunctionCall( 67 | new Func, List, bool, JsonOption, JsonObject>(JsonObject.ByKeysAndValues), 68 | ReturnInputNodes(inputAstNodes) 69 | ) 70 | ) 71 | }; 72 | } 73 | } 74 | 75 | [NodeName("JsonObject.Add")] 76 | [NodeCategory("JsonData")] 77 | [NodeDescription(@"Adds new attribute to the JsonObject. If given key already on the object and update set to 78 | True, value associated with the key will be updated. An error will be thrown otherwise.")] 79 | [NodeSearchTags("json", "bykeysandvalues", "create", "new")] 80 | [IsDesignScriptCompatible] 81 | public class Add : JsonOptionsBase 82 | { 83 | #region Constructor 84 | public Add() : base() 85 | { 86 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("jsonObject", "JsonObject to which add properties."))); 87 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("keys", Properties.Resources.JsonObject_Keys_Set))); 88 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("values", Properties.Resources.JsonObject_Values_Set))); 89 | OutPorts.Add(new PortModel(PortType.Output, this, new PortData("jsonObject", Properties.Resources.JsonObject_Json_Get))); 90 | } 91 | 92 | [JsonConstructor] 93 | public Add( 94 | IEnumerable inPorts, 95 | IEnumerable outPorts) : base(inPorts, outPorts) 96 | { 97 | 98 | } 99 | 100 | #endregion 101 | 102 | [IsVisibleInDynamoLibrary(false)] 103 | public override IEnumerable BuildOutputAst(List inputAstNodes) 104 | { 105 | if (IsPartiallyApplied) 106 | { 107 | return new[] 108 | { 109 | AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) 110 | }; 111 | } 112 | UseLevelAndReplicationGuide(inputAstNodes); 113 | 114 | return new[] 115 | { 116 | AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), 117 | AstFactory.BuildFunctionCall( 118 | new Func, List, bool, JsonOption, JsonObject>(JsonObject.Add), 119 | ReturnInputNodes(inputAstNodes) 120 | ) 121 | ) 122 | }; 123 | } 124 | } 125 | 126 | [NodeName("JsonObject.Remove")] 127 | [NodeCategory("JsonData")] 128 | [NodeDescription(@"Remove keys from the given JsonObject if they exist.")] 129 | [NodeSearchTags("json", "remove", "keys")] 130 | [IsDesignScriptCompatible] 131 | public class Remove : JsonOptionsBase 132 | { 133 | #region Constructor 134 | public Remove() : base() 135 | { 136 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("jsonObject", "JsonObject"))); 137 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("keys", "Key(s) to remove from JsonObject"))); 138 | OutPorts.Add(new PortModel(PortType.Output, this, new PortData("jsonObject", Properties.Resources.JsonObject_Json_Get))); 139 | this.NeedsOptions = false; 140 | } 141 | 142 | [JsonConstructor] 143 | public Remove( 144 | IEnumerable inPorts, 145 | IEnumerable outPorts) : base(inPorts, outPorts) 146 | { 147 | this.NeedsOptions = false; 148 | } 149 | 150 | #endregion 151 | 152 | [IsVisibleInDynamoLibrary(false)] 153 | public override IEnumerable BuildOutputAst(List inputAstNodes) 154 | { 155 | if (IsPartiallyApplied) 156 | { 157 | return new[] 158 | { 159 | AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) 160 | }; 161 | } 162 | UseLevelAndReplicationGuide(inputAstNodes); 163 | 164 | return new[] 165 | { 166 | AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), 167 | AstFactory.BuildFunctionCall( 168 | new Func, bool, JsonObject>(JsonObject.Remove), 169 | ReturnInputNodes(inputAstNodes) 170 | ) 171 | ) 172 | }; 173 | } 174 | } 175 | 176 | [NodeName("JsonObject.GetValueByKey")] 177 | [NodeCategory("JsonData")] 178 | [NodeDescription(@"Returns the value associated with the given key from the dict. Returns null if key is not found.")] 179 | [NodeSearchTags("json", "getbykey", "getvaluebykey")] 180 | [IsDesignScriptCompatible] 181 | public class GetValueByKey : JsonOptionsBase 182 | { 183 | #region Constructor 184 | public GetValueByKey() : base() 185 | { 186 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("jsonObject", "JsonObject"))); 187 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("keys", "Key(s) to query."))); 188 | OutPorts.Add(new PortModel(PortType.Output, this, new PortData("value", "Value associated to input key."))); 189 | this.NeedsOptions = false; 190 | } 191 | 192 | [JsonConstructor] 193 | public GetValueByKey( 194 | IEnumerable inPorts, 195 | IEnumerable outPorts) : base(inPorts, outPorts) 196 | { 197 | this.NeedsOptions = false; 198 | } 199 | 200 | #endregion 201 | 202 | [IsVisibleInDynamoLibrary(false)] 203 | public override IEnumerable BuildOutputAst(List inputAstNodes) 204 | { 205 | if (IsPartiallyApplied) 206 | { 207 | return new[] 208 | { 209 | AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) 210 | }; 211 | } 212 | UseLevelAndReplicationGuide(inputAstNodes); 213 | 214 | return new[] 215 | { 216 | AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), 217 | AstFactory.BuildFunctionCall( 218 | new Func(JsonObject.GetValueByKey), 219 | ReturnInputNodes(inputAstNodes) 220 | ) 221 | ) 222 | }; 223 | } 224 | } 225 | 226 | [NodeName("JsonObject.Merge")] 227 | [NodeCategory("JsonData")] 228 | [NodeDescription(@"Merge one JsonObject with one or multiple other JsonObjects.")] 229 | [NodeSearchTags("json", "merge", "jsonobject")] 230 | [IsDesignScriptCompatible] 231 | public class Merge : JsonOptionsBase 232 | { 233 | #region Constructor 234 | public Merge() : base() 235 | { 236 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("jsonObject", "Main JsonObject"))); 237 | InPorts.Add(new PortModel(PortType.Input, this, new PortData("others", "JsonObject(s) to merge to main."))); 238 | OutPorts.Add(new PortModel(PortType.Output, this, new PortData("jsonObject", Properties.Resources.JsonObject_Json_Get))); 239 | this.NeedsNesting = false; 240 | } 241 | 242 | [JsonConstructor] 243 | public Merge( 244 | IEnumerable inPorts, 245 | IEnumerable outPorts) : base(inPorts, outPorts) 246 | { 247 | this.NeedsNesting = false; 248 | } 249 | 250 | #endregion 251 | 252 | [IsVisibleInDynamoLibrary(false)] 253 | public override IEnumerable BuildOutputAst(List inputAstNodes) 254 | { 255 | if (IsPartiallyApplied) 256 | { 257 | return new[] 258 | { 259 | AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) 260 | }; 261 | } 262 | UseLevelAndReplicationGuide(inputAstNodes); 263 | 264 | return new[] 265 | { 266 | AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), 267 | AstFactory.BuildFunctionCall( 268 | new Func, JsonOption, JsonObject>(JsonObject.Merge), 269 | ReturnInputNodes(inputAstNodes) 270 | ) 271 | ) 272 | }; 273 | } 274 | } 275 | 276 | } -------------------------------------------------------------------------------- /JsonDataUI/src/NodeModels/JsonOptionsBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Threading.Tasks; 7 | using Autodesk.DesignScript.Runtime; 8 | using Dynamo.Controls; 9 | using Dynamo.Graph.Nodes; 10 | using Dynamo.UI.Commands; 11 | using Dynamo.Wpf; 12 | using ProtoCore.AST.AssociativeAST; 13 | using Newtonsoft.Json; 14 | using Dynamo.Graph; 15 | using System.Xml; 16 | using JsonData.Elements; 17 | 18 | namespace JsonDataUI.Nodes 19 | { 20 | public abstract class JsonOptionsBase : NodeModel 21 | { 22 | #region Internal Properties 23 | internal bool needsOptions = true; 24 | internal bool needsNesting = true; 25 | internal bool nesting; 26 | internal string option; 27 | internal string[] options = new string[3] { "None", "Update", "Combine" }; 28 | 29 | internal bool NeedsOptions 30 | { 31 | get { return needsOptions; } 32 | set { needsOptions = value; } 33 | } 34 | 35 | internal bool NeedsNesting 36 | { 37 | get { return needsNesting; } 38 | set { needsNesting = value; } 39 | } 40 | #endregion 41 | 42 | #region Properties 43 | 44 | /// 45 | /// Property controlling Nesting behaviour 46 | /// 47 | public bool Nesting 48 | { 49 | get { return nesting; } 50 | set 51 | { 52 | nesting = value; 53 | RaisePropertyChanged("Nested"); 54 | OnNodeModified(); 55 | } 56 | } 57 | 58 | public string Option 59 | { 60 | get { return option; } 61 | set 62 | { 63 | option = value; 64 | RaisePropertyChanged("Option"); 65 | OnNodeModified(); 66 | } 67 | } 68 | 69 | #endregion 70 | 71 | #region Constructors 72 | 73 | protected JsonOptionsBase() 74 | { 75 | RegisterAllPorts(); 76 | ArgumentLacing = LacingStrategy.Auto; 77 | PopulateView(); 78 | } 79 | 80 | [JsonConstructor] 81 | protected JsonOptionsBase( 82 | IEnumerable inPorts, 83 | IEnumerable outPorts) : base(inPorts, outPorts) 84 | { 85 | 86 | } 87 | 88 | #endregion 89 | 90 | #region Serialize/Deserialize 91 | protected override void SerializeCore(XmlElement nodeElement, SaveContext context) 92 | { 93 | base.SerializeCore(nodeElement, context); 94 | 95 | if (nodeElement.OwnerDocument == null) { return; } 96 | 97 | var optionNode = nodeElement.OwnerDocument.CreateElement("jsonOptionNode"); 98 | var nestingNode = nodeElement.OwnerDocument.CreateElement("jsonNestingNode"); 99 | 100 | optionNode.InnerText = this.Option; 101 | nestingNode.InnerText = (this.Nesting) ? "true" : "false"; 102 | 103 | nodeElement.AppendChild(optionNode); 104 | nodeElement.AppendChild(nestingNode); 105 | } 106 | 107 | protected override void DeserializeCore(XmlElement nodeElement, SaveContext context) 108 | { 109 | base.DeserializeCore(nodeElement, context); 110 | 111 | var optionNode = nodeElement.ChildNodes.Cast().FirstOrDefault(n => n.Name == "jsonOptionNode"); 112 | var nestingNode = nodeElement.ChildNodes.Cast().FirstOrDefault(n => n.Name == "jsonNestingNode"); 113 | 114 | if (optionNode != null && this.options.Contains(optionNode.InnerText)) 115 | { 116 | this.Option = optionNode.InnerText; 117 | } 118 | 119 | if (nestingNode != null) 120 | { 121 | this.Nesting = nestingNode.InnerText == "true"; 122 | } 123 | } 124 | #endregion 125 | 126 | #region Methods 127 | 128 | public void PopulateView() 129 | { 130 | this.option = "None"; 131 | this.nesting = true; 132 | } 133 | 134 | /// 135 | /// AssociativeNode for JsonOption property 136 | /// 137 | /// Function call returning selected JsonOption 138 | public static AssociativeNode JsonOptionASTNode(string option) 139 | { 140 | return AstFactory.BuildFunctionCall( 141 | new Func(JsonOptions.ReturnOptionByName), 142 | new List { AstFactory.BuildStringNode(option) } 143 | ); 144 | 145 | } 146 | 147 | /// 148 | /// AssociativeNode for Nested property 149 | /// 150 | public static AssociativeNode NestedASTNode(bool nesting) 151 | { 152 | return AstFactory.BuildBooleanNode(nesting); 153 | } 154 | 155 | public List ReturnInputNodes(List inputAstNodes) 156 | { 157 | var inputs = new List(inputAstNodes); 158 | if (NeedsNesting) { inputs.Add(NestedASTNode(this.nesting)); } 159 | if (NeedsOptions) { inputs.Add(JsonOptionASTNode(this.option)); } 160 | return inputs; 161 | } 162 | 163 | 164 | #endregion 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /JsonDataUI/src/NodeModels/JsonOptionsBaseView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Controls; 6 | using System.Threading.Tasks; 7 | using Autodesk.DesignScript.Runtime; 8 | using Dynamo.Controls; 9 | using Dynamo.Graph.Nodes; 10 | using Dynamo.UI.Commands; 11 | using Dynamo.Wpf; 12 | using JsonDataUI.Nodes; 13 | using ProtoCore.AST.AssociativeAST; 14 | using Newtonsoft.Json; 15 | using JsonDataUI; 16 | using Dynamo.Graph; 17 | using System.Xml; 18 | 19 | namespace JsonDataUI.Views 20 | { 21 | /// 22 | /// 23 | /// 24 | public class JsonOptionsNodeViewCustomizations : INodeViewCustomization 25 | { 26 | private JsonOptionsBase model; 27 | 28 | public void CustomizeView(JsonOptionsBase model, NodeView nodeView) 29 | { 30 | this.model = model; 31 | var JsonOptionsControl = new JsonOptionsControl(); 32 | nodeView.inputGrid.Children.Add(JsonOptionsControl); 33 | 34 | JsonOptionsControl.DataContext = model; 35 | 36 | JsonOptionsControl.cBox_JsonOptions.ToolTip = @"Handling options where duplicate keys are found. Use JsonOptions 37 | dropdown node to select appropiate behaviour"; 38 | JsonOptionsControl.check_Nesting.ToolTip = @"Apply nesting behaviour if key input is a single string concatenated by 39 | dots, representing the desired nested structure"; 40 | 41 | // Hiding and disabling Dropdown for options if JsonOption not needed for method. 42 | if (!model.NeedsOptions) 43 | { 44 | JsonOptionsControl.cBox_JsonOptions.Visibility = System.Windows.Visibility.Collapsed; 45 | JsonOptionsControl.cBox_JsonOptions.IsEnabled = false; 46 | } 47 | 48 | if (!model.NeedsNesting) 49 | { 50 | JsonOptionsControl.check_Nesting.IsEnabled = false; 51 | JsonOptionsControl.check_Nesting.Visibility = System.Windows.Visibility.Collapsed; 52 | } 53 | } 54 | 55 | public void Dispose() { } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /JsonDataUI/src/NodeModels/JsonOptionsControl.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 18 | 19 | 20 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /JsonDataUI/src/NodeModels/JsonOptionsControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace JsonDataUI.Views 17 | { 18 | /// 19 | /// Interaction logic for JsonOptionsControl.xaml 20 | /// 21 | public partial class JsonOptionsControl : UserControl 22 | { 23 | public JsonOptionsControl() 24 | { 25 | InitializeComponent(); 26 | foreach(string option in Enum.GetNames(typeof(JsonData.Elements.JsonOption))) 27 | { 28 | cBox_JsonOptions.Items.Add(option); 29 | } 30 | } 31 | 32 | private void cBox_JsonOptions_SelectionChanged(object sender, SelectionChangedEventArgs e) 33 | { 34 | 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2018 Alvaro Ortega Pickmans 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JsonData 2 | JsonData is a [Dynamo](http://www.dynamobim.org) package to provide extra functionalities when handling data, based on Newtonsoft JsonNet C# library. 3 | 4 | It can handle primitive object types (`string`, `int`, `double`, etc.) as well as `Autodesk.DesignScript` and `Revit` object types. Non-primitive objects are kept intact along the graph, only converted to its string representation when writing to file. 5 | 6 | For extensive example of the package functionalities, open the `JsonDataSample.dyn` file that can be found on the package folder. 7 | 8 | ![JsonData Toolset](samples/images/JsonDataToolSet.png) 9 | -------------------------------------------------------------------------------- /dist/JsonData/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "contains_binaries": true, 3 | "contents": "", 4 | "dependencies": [], 5 | "description": "__Built for Dynamo 2.0__\r\n JsonData is a simple but powerful data managment package based on the JSON format. It makes use of .net dictionaries to create KeyValuePair data structures, with the extra functionality of representing them as JSON structures, so they can easily be imported or exported to files, queried, merged, etc.\r\nIt comes with methods to parse to and from JSON, XML and CSV, which are the most common formats for data sharing. Also, it has the ability of easily create nested structures by simply concatenating keys with a dot as separator.\r\nMore information on https://github.com/alvpickmans/JsonData\r\n", 6 | "engine": "dynamo", 7 | "engine_metadata": "", 8 | "engine_version": "2.0.1.4955", 9 | "file_hash": null, 10 | "group": "", 11 | "keywords": [ "json", "data", "jsonobject", "sort", "merge", "xml", "parse", "csv" ], 12 | "license": "MIT", 13 | "name": "JsonData", 14 | "node_libraries": [ "JsonData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "JsonDataUI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" ], 15 | "repository_url": "https://github.com/alvpickmans/JsonData", 16 | "site_url": "", 17 | "version": "2.0.1" 18 | } -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonArray.ByElements.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonArray.ByElements.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonArray.Elements.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonArray.Elements.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonArray.Size.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonArray.Size.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.Add.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.Add.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.ByKeysAndValues.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.ByKeysAndValues.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.FilterByKeyAndValue.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.FilterByKeyAndValue.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.GetValueByKey.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.GetValueByKey.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.Keys.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.Keys.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.Merge.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.Merge.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.Remove.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.Remove.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.Size.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.Size.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.SortByKeyValue.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.SortByKeyValue.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.SortKeys.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.SortKeys.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Elements.JsonObject.Values.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Elements.JsonObject.Values.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Parse.CSVString.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Parse.CSVString.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Parse.JsonString.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Parse.JsonString.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Parse.JsonToCSV.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Parse.JsonToCSV.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Parse.JsonToXML.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Parse.JsonToXML.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Parse.XMLString.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Parse.XMLString.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Read.FromCSVFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Read.FromCSVFile.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Read.FromJsonFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Read.FromJsonFile.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Read.FromXMLFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Read.FromXMLFile.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Write.ToCSVFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Write.ToCSVFile.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Write.ToJsonFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Write.ToJsonFile.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonData.Utilities.Write.ToXMLFile.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonData.Utilities.Write.ToXMLFile.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonDataUI.JsonObject.JsonOptions.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonDataUI.JsonObject.JsonOptions.Small.png -------------------------------------------------------------------------------- /docs/assets/images/JsonDataUI.JsonOptions.Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/docs/assets/images/JsonDataUI.JsonOptions.Small.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # JsonData 2 | JsonData is a [Dynamo](http://www.dynamobim.org) package to provide extra functionalities when handling data, based on Newtonsoft JsonNet C# library. 3 | 4 | The original purpose was to provide a simpler way of handling data in Dynamo. Lists work just fine, but sometimes they are just not enough. With several functionalities to filter, update, combine and group your data, this package can help to boost your Dynamo workflows. 5 | 6 | - [Elements](#elements) 7 | - [JsonObject](#jsonobject) 8 | - [Constructors](#constructors) 9 | - [Methods](#methods) 10 | - [Properties](#properties) 11 | - [JsonArray](#jsonarray) 12 | - [Constructors](#constructors) 13 | - [Properties](#properties) 14 | - [Utilities](#utilities) 15 | - [Parse](#parse) 16 | - [Read](#read) 17 | - [Write](#write) 18 | 19 | 20 | ___ 21 | 22 | ## Elements 23 | The package is based on the use of two types objects **JsonObject** and **JsonArray**. 24 | 25 | ### JsonObject 26 | This is the core element of the package. Being a `Dictionary` its underlying c# object type, JsonObjects provide several of a dictionary's methods with the extra value of displaying them using a json structure format. 27 | 28 | #### Constructors 29 | 30 | |          | | 31 | | ------------- |:-------------| 32 | | ![ByKeysAndValues] | **ByKeysAndValues**: JsonObject constructor by a given key-value pair. It accepts nested structures by providing keys divided by points as a single string. | 33 | 34 | #### Methods 35 | 36 | |          | | 37 | | ----- |:-----| 38 | | ![Add] | **Add**: Adds new attribute to the JsonObject. If given key already on the object and update set to True, value associated with the key will be updated. An error will be thrown otherwise. | 39 | | ![FilterByKeyAndValue] | **FilterByKeyAndValue**: Filters JsonObjects which contains the given key-value pair. If value is of type string, it will test if it contains the value given. | 40 | | ![GetValueByKey] | **GetValueByKey**: Returns the value associated with the given key from the jsonObject. | 41 | | ![JsonOptions] | **JsonOptions**: Options for updating JsonObjects: None, Update and Combine. | 42 | | ![Merge] | **Merge**: Merge one JsonObject with one or multiple other JsonObjects.| 43 | | ![Remove] | **Remove**: Remove keys from the given JsonObject. If any key doesn't exit on the object or duplicated keys found on the input, error will be thrown.| 44 | | ![SortByKeyValue] | **SortByKeyValue**: Sorts a list of JsonObjects by the ascending order of the values associated with the given key. | 45 | | ![SortKeys] | **SortKeys**: Sorts the JsonObject alphabetically by its keys. | 46 | 47 | #### Properties 48 | 49 | |          | | 50 | | ----- |:-----| 51 | | ![Keys] | **Keys**: Returns keys of attributes in the JsonObject. | 52 | | ![JsonObjectSize] | **Size**: Returns the number of attributes on the JsonObject. | 53 | | ![Values] | **Size**: Returns values of attributes in the JsonObject. | 54 | 55 | 56 | ### JsonArray 57 | JsonArray acts more as a helper object than a key one. Due to Dynamo's lacing properties, I soon found that the value of a JsonObject couldn´t be a list of items, so here is were JsonArray comes into play: it is a c# `List` behaving as a single element, so JsonObjects can host them as a value. 58 | 59 | #### Constructors 60 | 61 | |          | | 62 | | ------------- |:-------------| 63 | | ![ByElements] | **ByElements**: JsonArray constructor by a given list of elements. | 64 | 65 | #### Properties 66 | 67 | |          | | 68 | | ----- |:-----| 69 | | ![Elements] | **Elements**: Returns elements in the JsonArray object. | 70 | | ![JsonObjectSize] | **Size**: Returns the number of elements in the JsonArray object. | 71 | 72 | 73 | ## Utilities 74 | The tools provided along with the package are currently focused on handling and parsing files from and to json format. 75 | 76 | ### Parse 77 | 78 | |          | | 79 | | ----- |:-----| 80 | | ![CSVString] | **CSVString**: Parses a CSV formated string. It will return a list of JsonObjects. Error will be thrown if parser fails.| 81 | | ![JsonString] | **JsonString**: Parses a json formated string. It will return JsonObject, JsonArray or other match that the parser can do from the input. Error will be thrown if parser fails.| 82 | | ![JsonToCSV] | **JsonToCSV**: Converts a list of JsonObject to CSV string format. JsonObjects must have one level only (no other JsonObject or JsonArray as values), being the keys the header of the CSV string.Parses a CSV formated string. It will return a list of JsonObjects. Error will be thrown if parser fails.| 83 | | ![JsonToXML] | **JsonToXML**: Converts a JsonObject to XML string format. Parses a CSV formated string. It will return a list of JsonObjects. Error will be thrown if parser fails.| 84 | | ![XMLString] | **XMLString**: Parses a xml formated string. It will return JsonObject, JsonArray or other match that the parser can do from the input. Error will be thrown if parser fails.| 85 | 86 | ### Read 87 | 88 | |          | | 89 | | ----- |:-----| 90 | | ![FromCSVFile] | **FromCSVFile**: Reads and parses a CSV formated file. It will return a list of JsonObjects. Error will be thrown if parser fails.| 91 | | ![FromJsonFile] | **FromJsonFile**: Reads and parses a json file. It will return JsonObject, JsonArray or other match that the parser can do from the input. Error will be thrown if parser fails.| 92 | | ![FromXMLFile] | **FromXMLFile**: Reads and parses a XML file. It will return JsonObject, JsonArray or other match that the parser can do from the input. Error will be thrown if parser fails.| 93 | 94 | ### Write 95 | 96 | |          | | 97 | | ----- |:-----| 98 | | ![ToCSVFile] | **ToCSVFile**: Writes a list of JsonObject to a CSV file. JsonObjects must have one level only (no other JsonObject or JsonArray as values), being the keys the header of the CSV string.| 99 | | ![ToJsonFile] | **ToJsonFile**: Writes the JsonObject or JsonArray to a json file.| 100 | | ![ToXMLFile] | **ToXMLFile**: Writes the JsonObject or JsonArray to a XML file.| 101 | 102 | [ByKeysAndValues]: assets/images/JsonData.Elements.JsonObject.ByKeysAndValues.Small.png 103 | [Add]: assets/images/JsonData.Elements.JsonObject.Add.Small.png 104 | [FilterByKeyAndValue]: assets/images/JsonData.Elements.JsonObject.FilterByKeyAndValue.Small.png 105 | [GetValueByKey]: assets/images/JsonData.Elements.JsonObject.GetValueByKey.Small.png 106 | [JsonOptions]: assets/images/JsonDataUI.JsonOptions.Small.png 107 | [Merge]: assets/images/JsonData.Elements.JsonObject.Merge.Small.png 108 | [Remove]: assets/images/JsonData.Elements.JsonObject.Remove.Small.png 109 | [SortByKeyValue]: assets/images/JsonData.Elements.JsonObject.SortByKeyValue.Small.png 110 | [SortKeys]: assets/images/JsonData.Elements.JsonObject.SortKeys.Small.png 111 | [Keys]: assets/images/JsonData.Elements.JsonObject.Keys.Small.png 112 | [JsonObjectSize]: assets/images/JsonData.Elements.JsonObject.Size.Small.png 113 | [Values]: assets/images/JsonData.Elements.JsonObject.Values.Small.png 114 | 115 | [ByElements]: assets/images/JsonData.Elements.JsonArray.ByElements.Small.png 116 | [Elements]: assets/images/JsonData.Elements.JsonArray.Elements.Small.png 117 | [JsonArraySize]: assets/images/JsonData.Elements.JsonArray.Size.Small.png 118 | 119 | [CSVString]: assets/images/JsonData.Utilities.Parse.CSVString.Small.png 120 | [JsonString]: assets/images/JsonData.Utilities.Parse.JsonString.Small.png 121 | [JsonToCSV]: assets/images/JsonData.Utilities.Parse.JsonToCSV.Small.png 122 | [JsonToXML]: assets/images/JsonData.Utilities.Parse.JsonToXML.Small.png 123 | [XMLString]: assets/images/JsonData.Utilities.Parse.XMLString.Small.png 124 | 125 | [FromCSVFile]: assets/images/JsonData.Utilities.Read.FromCSVFile.Small.png 126 | [FromJsonFile]: assets/images/JsonData.Utilities.Read.FromJsonFile.Small.png 127 | [FromXMLFile]: assets/images/JsonData.Utilities.Read.FromXMLFile.Small.png 128 | 129 | [ToCSVFile]: assets/images/JsonData.Utilities.Write.ToCSVFile.Small.png 130 | [ToJsonFile]: assets/images/JsonData.Utilities.Write.ToJsonFile.Small.png 131 | [ToXMLFile]: assets/images/JsonData.Utilities.Write.ToXMLFile.Small.png 132 | -------------------------------------------------------------------------------- /samples/images/JsonDataHeader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/images/JsonDataHeader.png -------------------------------------------------------------------------------- /samples/images/JsonDataSample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/images/JsonDataSample.png -------------------------------------------------------------------------------- /samples/images/JsonDataToolSet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/images/JsonDataToolSet.png -------------------------------------------------------------------------------- /samples/wiki/datasets/dataStorageInGlobalParameter.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/datasets/dataStorageInGlobalParameter.zip -------------------------------------------------------------------------------- /samples/wiki/datasets/elementParametersByCategory.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/datasets/elementParametersByCategory.zip -------------------------------------------------------------------------------- /samples/wiki/datasets/helloWorld.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/datasets/helloWorld.zip -------------------------------------------------------------------------------- /samples/wiki/datasets/jsonDataSample.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/datasets/jsonDataSample.zip -------------------------------------------------------------------------------- /samples/wiki/datasets/runningPythonScriptFromOtherFile.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/datasets/runningPythonScriptFromOtherFile.zip -------------------------------------------------------------------------------- /samples/wiki/datasets/webRequest.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/datasets/webRequest.zip -------------------------------------------------------------------------------- /samples/wiki/images/elementParametersByCategory/overallGraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/elementParametersByCategory/overallGraph.png -------------------------------------------------------------------------------- /samples/wiki/images/elementParametersByCategory/step_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/elementParametersByCategory/step_01.png -------------------------------------------------------------------------------- /samples/wiki/images/elementParametersByCategory/step_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/elementParametersByCategory/step_02.png -------------------------------------------------------------------------------- /samples/wiki/images/elementParametersByCategory/step_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/elementParametersByCategory/step_03.png -------------------------------------------------------------------------------- /samples/wiki/images/helloWorld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/helloWorld.png -------------------------------------------------------------------------------- /samples/wiki/images/jsonDataSample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/jsonDataSample.png -------------------------------------------------------------------------------- /samples/wiki/images/runningPython/overallGraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/runningPython/overallGraph.png -------------------------------------------------------------------------------- /samples/wiki/images/runningPython/step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/runningPython/step1.png -------------------------------------------------------------------------------- /samples/wiki/images/runningPython/step2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/runningPython/step2.png -------------------------------------------------------------------------------- /samples/wiki/images/runningPython/step3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/runningPython/step3.png -------------------------------------------------------------------------------- /samples/wiki/images/runningPython/step4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/runningPython/step4.png -------------------------------------------------------------------------------- /samples/wiki/images/webRequest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/webRequest.png -------------------------------------------------------------------------------- /samples/wiki/images/webRequestCSV/dataFromGlobalParameter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/webRequestCSV/dataFromGlobalParameter.png -------------------------------------------------------------------------------- /samples/wiki/images/webRequestCSV/webRequestCSV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvpickmans/JsonData/3772dba36117399a4e10063f5af0e3ff796b9da9/samples/wiki/images/webRequestCSV/webRequestCSV.png --------------------------------------------------------------------------------