<commit_before>require 'artisan/project'
require 'artisan/story'
require 'artisan/query'
require 'json'

module Artisan
  def self.get_project(key, address = 'artisan.8thlight.com')
    response = Query.get_project(key, address)
    json_chunk = JSON::parse(response)
    return Project.new(json_chunk)
  end

  def self.get_stories(key, address = 'artisan.8thlight.com')
    response = Query.get_stories(key, address)
    json_chunk = JSON::parse(response)
<commit_msg>Add get_iterations to Artisan API<commit_after>require 'artisan/project'
require 'artisan/story'
require 'artisan/query'
require 'json'

module Artisan
  def self.get_project(key, address = 'artisan.8thlight.com')
    response = Query.get_project(key, address)
    json_chunk = JSON::parse(response)
    return Project.new(json_chunk)
  end

  def self.get_iterations(key, address = 'artisan.8thlight.com')
    response = Query.get_iterations(key, address)
    json_chunk = JSON::parse(response)

    @iterations = []
    json_chunk.collect { |iteration_chunk| @iterations << Iteration.new(iteration_chunk) }

    return @iterations
  end

  def self.get_stories(key, address = 'artisan.8thlight.com')
    response = Query.get_stories(key, address)
    json_chunk = JSON::parse(response)

{'fraction_non_alphanumeric': 0.11526232114467408, 'fraction_numerical': 0.00397456279809221, 'mean_word_length': 4.8018433179723505, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5124493', 'n_tokens_mistral': 422, 'n_tokens_neox': 416, 'n_words': 83}