schoolfinder 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,22 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
22
+ spec/schoolfinder_api_key.yml
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 tcocca
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,127 @@
1
+ = schoolfinder
2
+
3
+ A gem to interact with the education.com free schoolfinder api.
4
+
5
+ Register for a Schoolfinder API Key Here:
6
+ http://www.education.com/schoolfinder/tools/webservice/
7
+
8
+ Schoolfinder API Documentation:
9
+ http://www.education.com/schoolfinder/tools/webservice/documentation/
10
+
11
+
12
+ == Installation
13
+
14
+ gem install schoolfinder
15
+
16
+ In a rails app:
17
+
18
+ config.gem 'schoolfinder'
19
+
20
+
21
+ == Usage
22
+
23
+ Create a new instance of the Schoolfinder Client
24
+
25
+ @schoolfinder = Schoolfinder::Client.new('your_api_key')
26
+
27
+ The following methods are available to the Schoolfinder::Client class, each method corresponds to an api call
28
+ Each method returns a Schoolfinder::Response which responds to a call to :body
29
+
30
+ :body is an instance of Hashie::Rash. Hashie::Rash inherits from Hashie::Mash (see the following: http://github.com/intridea/hashie ) with the only difference being that in a Hashie::Rash all keys (method names) of the original hash are "rubyified", converted from camelCase to underscore. So, "methodName" would be "method_name". This in turn looks something like the following example:
31
+
32
+ @response = @schoolfinder.school_search(:zip => 02215)
33
+ @response.body.first.schoolname # => 'Fenway Park Academy'
34
+
35
+
36
+ === Schoolfinder::Client methods
37
+
38
+ Notes on passing params to each method: All parameter keys should be passed in exactly as stated in the schoolfinder api documentation linked above.
39
+
40
+ The following default parameters are automatically passed through so you don't need to worry about them:
41
+
42
+ sn = sf, key = (your API key), f = (method_name), v = 3
43
+
44
+ ==== Search for Schools:
45
+
46
+ @response = @schoolfinder.school_search
47
+
48
+ school_search takes an optional params hash.
49
+ @response.body is an Array of Hashie:Rash objects
50
+
51
+ ==== Get Test Ratings:
52
+
53
+ @response = @schoolfinder.test_rating(:nces_id => "061029001146")
54
+
55
+ test_rating requires either an nces_id or schoolid parameter passed through in hash format.
56
+ @response.body is an Array of Hashie:Rash objects
57
+
58
+ ==== Get Student Diversity
59
+
60
+ @response = @response = @schoolfinder.student_diversity(:nces_id => "450231000564")
61
+
62
+ student_diversity requires one of nces_id, schoolid, city or state
63
+ @response.body is a Hashie:Rash object
64
+
65
+ ==== Get Test Scores
66
+
67
+ @response = @response = @schoolfinder.test_scores(:nces_id => "450231000564")
68
+
69
+ test_scores requires one of schoolid, nces_id, districtid, districtleaid
70
+ @response.body is a Hashie:Rash object
71
+
72
+ ==== Get Teacher Stats
73
+
74
+ @response = @schoolfinder.teacher_stats(:nces_id => "450231000564", :districtleaid => "4502310")
75
+
76
+ teacher_stats requires one of schoolid, nces_id, districtid, districtleaid
77
+ @response.body is a Hashie:Rash object
78
+
79
+ ==== Get Student Stats
80
+
81
+ @response = @schoolfinder.student_stats(:nces_id => "450231000564", :districtleaid => "4502310", :city => "Greenville", :state => "SC")
82
+
83
+ student_stats requires one of schoolid, nces_id, districtid, districtleaid, city, state
84
+ @response.body is a Hashie:Rash object
85
+
86
+ ==== Get Reviews
87
+
88
+ @response = @schoolfinder.get_reviews(:schoolid => "25381")
89
+
90
+ get_reviews requires one of schoolid, nces_id
91
+ @response.body is a Hashie:Rash object
92
+
93
+ ==== Number Of (for a city and state)
94
+
95
+ @response = @schoolfinder.number_of("Greenville", "SC")
96
+
97
+ number_of requires 2 parameters (city, state)
98
+ @response.body is an Array of Hashie:Rash objects
99
+
100
+ ==== District Search
101
+
102
+ @response = @schoolfinder.district_search(:city => "Greenville", :state => "SC")
103
+
104
+ district_search requires one of districtid, districtleaid, districtname, state, city, zip
105
+ @response.body is an Array of Hashie:Rash objects
106
+
107
+ ==== Get Branding Data
108
+
109
+ @response = @schoolfinder.branding_data
110
+
111
+ branding_data takes optional parameters (as noted in the documentation)
112
+ @response.body is a Hashie:Rash object
113
+
114
+ == Note on Patches/Pull Requests
115
+
116
+ * Fork the project.
117
+ * Make your feature addition or bug fix.
118
+ * Add tests for it. This is important so I don't break it in a
119
+ future version unintentionally.
120
+ * Commit, do not mess with rakefile, version, or history.
121
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
122
+ * Send me a pull request. Bonus points for topic branches.
123
+
124
+
125
+ == Copyright
126
+
127
+ Copyright (c) 2010 Tom Cocca. See LICENSE for details.
@@ -0,0 +1,48 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "schoolfinder"
8
+ gem.summary = %Q{api wrapper for the education.com schoolfinder}
9
+ gem.description = %Q{api wrapper for the education.com schoolfinder}
10
+ gem.email = "tom.cocca@gmail.com"
11
+ gem.homepage = "http://github.com/tcocca/schoolfinder"
12
+ gem.authors = ["tcocca"]
13
+ gem.add_dependency "httparty", ">= 0.6.1"
14
+ gem.add_dependency "hashie", ">= 0.3.1"
15
+ gem.add_development_dependency "rspec", ">= 1.2.9"
16
+ gem.add_development_dependency "webmock", ">= 1.3.4"
17
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
18
+ end
19
+ Jeweler::GemcutterTasks.new
20
+ rescue LoadError
21
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
22
+ end
23
+
24
+ require 'spec/rake/spectask'
25
+ Spec::Rake::SpecTask.new(:spec) do |spec|
26
+ spec.libs << 'lib' << 'spec'
27
+ spec.spec_files = FileList['spec/**/*_spec.rb']
28
+ end
29
+
30
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
31
+ spec.libs << 'lib' << 'spec'
32
+ spec.pattern = 'spec/**/*_spec.rb'
33
+ spec.rcov = true
34
+ end
35
+
36
+ task :spec => :check_dependencies
37
+
38
+ task :default => :spec
39
+
40
+ require 'rake/rdoctask'
41
+ Rake::RDocTask.new do |rdoc|
42
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
43
+
44
+ rdoc.rdoc_dir = 'rdoc'
45
+ rdoc.title = "schoolfinder #{version}"
46
+ rdoc.rdoc_files.include('README*')
47
+ rdoc.rdoc_files.include('lib/**/*.rb')
48
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,67 @@
1
+ class Hash
2
+
3
+ # Converts all of the keys to strings, optionally formatting key name
4
+ def rubyify_keys!
5
+ keys.each{ |k|
6
+ v = delete(k)
7
+ new_key = k.to_s.to_underscore!
8
+ self[new_key] = v
9
+ v.rubyify_keys! if v.is_a?(Hash)
10
+ v.each{|p| p.rubyify_keys! if p.is_a?(Hash)} if v.is_a?(Array)
11
+ }
12
+ self
13
+ end
14
+
15
+ end
16
+
17
+ class String
18
+
19
+ # converts a camel_cased string to a underscore string
20
+ # Same way ActiveSupport does string.underscore
21
+ def to_underscore!
22
+ self.to_s.gsub(/::/, '/').
23
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
24
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
25
+ tr("-", "_").
26
+ downcase
27
+ end
28
+
29
+ end
30
+
31
+ module Hashie
32
+
33
+ class Rash < Mash
34
+
35
+ def initialize(source_hash = nil, default = nil, &blk)
36
+ if source_hash
37
+ source_hash.rubyify_keys!
38
+ deep_update(source_hash)
39
+ end
40
+ default ? super(default) : super(&blk)
41
+ end
42
+
43
+ def initializing_reader(key)
44
+ ck = convert_key(key)
45
+ regular_writer(ck, Hashie::Rash.new) unless key?(ck)
46
+ regular_reader(ck)
47
+ end
48
+
49
+ protected
50
+
51
+ def convert_value(val, duping=false) #:nodoc:
52
+ case val
53
+ when ::Hashie::Rash
54
+ val.dup
55
+ when ::Hash
56
+ val = val.dup if duping
57
+ self.class.new(val)
58
+ when Array
59
+ val.collect{ |e| convert_value(e) }
60
+ else
61
+ val
62
+ end
63
+ end
64
+
65
+ end
66
+
67
+ end
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'httparty'
3
+ require 'hashie'
4
+ require 'rash'
5
+
6
+ require 'schoolfinder/client'
7
+ require 'schoolfinder/response'
8
+ require 'schoolfinder/error'
@@ -0,0 +1,73 @@
1
+ module Schoolfinder
2
+ class Client
3
+
4
+ include HTTParty
5
+ base_uri 'api.education.com'
6
+ format :json
7
+
8
+ def initialize(api_key)
9
+ self.class.default_params :key => api_key
10
+ self.class.default_params :sn => 'sf'
11
+ self.class.default_params :resf => 'json'
12
+ self.class.default_params :v => '3'
13
+ end
14
+
15
+ def school_search(optional_params = {})
16
+ params = {:f => 'schoolSearch'}
17
+ make_request(params, optional_params)
18
+ end
19
+
20
+ def test_rating(options)
21
+ params = {:f => 'getTestRating'}
22
+ make_request(params, options)
23
+ end
24
+
25
+ def student_diversity(options)
26
+ params = {:f => 'getStudentDiversity'}
27
+ make_request(params, options)
28
+ end
29
+
30
+ def test_scores(options)
31
+ params = {:f => 'getTestScores'}
32
+ make_request(params, options)
33
+ end
34
+
35
+ def teacher_stats(options)
36
+ params = {:f => 'getTeacherStats'}
37
+ make_request(params, options)
38
+ end
39
+
40
+ def student_stats(options)
41
+ params = {:f => 'getStudentStats'}
42
+ make_request(params, options)
43
+ end
44
+
45
+ def reviews(options)
46
+ params = {:f => 'getReviews'}
47
+ make_request(params, options)
48
+ end
49
+
50
+ def number_of(city, state)
51
+ params = {:f => 'numberOf', :city => city, :state => state}
52
+ make_request(params)
53
+ end
54
+
55
+ def district_search(options)
56
+ params = {:f => 'districtSearch'}
57
+ make_request(params, options)
58
+ end
59
+
60
+ def branding_data(optional_params = {})
61
+ params = {:f => 'gbd'}
62
+ make_request(params, optional_params)
63
+ end
64
+
65
+ private
66
+
67
+ def make_request(params, options = {})
68
+ params.merge!(options) unless options.blank?
69
+ Schoolfinder::Response.new(self.class.get('/service/service.php', :query => params))
70
+ end
71
+
72
+ end
73
+ end
@@ -0,0 +1,17 @@
1
+ module Schoolfinder
2
+ class Error < Exception
3
+
4
+ attr_reader :code, :error
5
+
6
+ def initialize(code, error)
7
+ @code = code
8
+ @error = error
9
+ super(message)
10
+ end
11
+
12
+ def message
13
+ "Schoolfinder Error: #{@error} (code: #{@code})"
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,33 @@
1
+ module Schoolfinder
2
+ class Response
3
+
4
+ attr_accessor :body
5
+
6
+ def initialize(response)
7
+ self.body = rash_response(response)
8
+ if self.body.respond_to?('fault_string')
9
+ raise Schoolfinder::Error.new(self.body.fault_code, self.body.fault_string)
10
+ end
11
+ end
12
+
13
+ private
14
+
15
+ def rash_response(response)
16
+ if response.is_a?(Array)
17
+ self.body = []
18
+ response.each do |b|
19
+ if b.is_a?(Hash)
20
+ self.body << Hashie::Rash.new(b)
21
+ else
22
+ self.body << b
23
+ end
24
+ end
25
+ elsif response.is_a?(Hash)
26
+ self.body = Hashie::Rash.new(response)
27
+ else
28
+ self.body = response
29
+ end
30
+ end
31
+
32
+ end
33
+ end
@@ -0,0 +1,63 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Rash" do
4
+
5
+ context "string extensions" do
6
+ before do
7
+ @camel_case_strings = ["camelCase", "CamelCase", "stringTwoHumps", "StringHasThreeHumps"]
8
+ @underscore_strings = ["camel_case", "camel_case", "string_two_humps", "string_has_three_humps"]
9
+ end
10
+
11
+ it "should convert camelcase strings to underscored strings" do
12
+ @camel_case_strings.collect{|s| s.to_underscore!}.should == @underscore_strings
13
+ end
14
+ end
15
+
16
+ context "hash extensions" do
17
+ before do
18
+ @hash1 = {"testOne" => "1", "TestTwo" => "2", :testThree => 3, :TestFour => 4, :testFiveSix => 56}
19
+ @hash1.rubyify_keys!
20
+ @hash2 = {"test_one" => "1", "test_two" => "2", "test_three" => 3, "test_four" => 4, "test_five_six" => 56}
21
+ end
22
+
23
+ it "should convert camel case-ed keys to underscore-ed keys" do
24
+ @hash1.should == @hash2
25
+ end
26
+ end
27
+
28
+ context "rash" do
29
+ before do
30
+ @original_hash = {
31
+ "varOne" => 1,
32
+ "two" => 2,
33
+ :three => 3,
34
+ :varFour => 4,
35
+ "fiveHumpHumps" => 5,
36
+ :nested => {
37
+ "NestedOne" => "One",
38
+ :two => "two",
39
+ "nested_three" => "three"
40
+ },
41
+ "nestedTwo" => {
42
+ "nested_two" => 22,
43
+ :nestedThree => 23
44
+ }
45
+ }
46
+ @rash = Hashie::Rash.new(@original_hash)
47
+ end
48
+
49
+ it "should create a new rash where all the keys are underscored instead of camelcased" do
50
+ @rash.var_one.should == 1
51
+ @rash.two.should == 2
52
+ @rash.three.should == 3
53
+ @rash.var_four.should == 4
54
+ @rash.five_hump_humps.should == 5
55
+ @rash.nested.nested_one.should == "One"
56
+ @rash.nested.two.should == "two"
57
+ @rash.nested.nested_three.should == "three"
58
+ @rash.nested_two.nested_two.should == 22
59
+ @rash.nested_two.nested_three.should == 23
60
+ end
61
+ end
62
+
63
+ end
@@ -0,0 +1 @@
1
+ {"logosrc":"http:\/\/www.education.com\/i\/logo\/edu-logo-75x31.jpg","disclaimer":"&#169;Education.com, Inc. 2008. Use is subject to <a href=\"http:\/\/www.education.com\/webservice\/terms\" target=\"_blank\">Terms of Service.<\/a>","lsp":"http:\/\/www.education.com\/schoolfinder\/us\/south-carolina\/greenville\/greenville-senior-high-academy\/","lsc":"http:\/\/www.education.com\/schoolfinder\/us\/south-carolina\/greenville\/","lsrs":"http:\/\/www.education.com\/schoolfinder\/us\/south-carolina\/greenville\/greenville-senior-high-academy\/reviews\/","lsr":"http:\/\/www.education.com\/schoolfinder\/us\/south-carolina\/greenville\/greenville-senior-high-academy\/reviews\/","ld":null}
@@ -0,0 +1 @@
1
+ [{"district":{"districtid":"15076","districtname":"Anderson 1","state":"SC","districtleaid":"4500780","address":"P O BOX 99","city":"WILLIAMSTON","gradesserved":"PK-12","zip":"23219","phonenumber":"8648477344"}},{"district":{"districtid":"15031","districtname":"Greenville","state":"SC","districtleaid":"4502310","address":"BOX 2848","city":"GREENVILLE","gradesserved":"PK-12","zip":"23219","phonenumber":"8643553162"}},{"district":{"districtid":"15102","districtname":"Governor's Schools","state":"SC","districtleaid":null,"address":"","city":null,"gradesserved":null,"zip":null,"phonenumber":null}}]
@@ -0,0 +1 @@
1
+ {"faultCode":3,"faultString":"invalid api key","faultType":"error"}
@@ -0,0 +1 @@
1
+ [{"school":"All","total":129},{"gradelevel":"Elementary","total":44},{"gradelevel":"Middle","total":25},{"gradelevel":"High","total":21},{"gradelevel":"Preschool","total":61},{"schooltype":"Charter","total":5},{"schooltype":"Magnet","total":12},{"schooltype":"Preschool","total":49},{"schooltype":"Private","total":19},{"schooltype":"Private, Alternative","total":2},{"schooltype":"Private, Early Childhood Program\/Day Care Center","total":10},{"schooltype":"Private, Montessori","total":1},{"schooltype":"Public","total":27},{"schooltype":"Special Education","total":1},{"schooltype":"Vocational\/Technical","total":3},{"district":"All","total":4}]
@@ -0,0 +1 @@
1
+ {"rating":{"count":1,"total":5,"average":5},"review":[{"comment":"This is an outstanding school. The accademic standards are demanding and the teaching staff is super."}]}
@@ -0,0 +1 @@
1
+ [{"school":{"schoolid":"85302","schoolname":"Greenville Senior HI High School","zip":"29601","address":"1 Vardry Street","city":"Greenville","districtid":"15031","districtleaid":"4502310","AYPResult":"no","AYPResultYear":"2009","APIGrowth":{"total":""},"APIGrowthYear":"","MetSchoolwideGrowthTarget":null,"distance":0,"enrollment":{"total":1289},"gradelevel":"High","gradesserved":"9-12","latitude":34.840229,"longitude":-82.4064713,"phonenumber":"(864) 355-5500","schooldistrictname":"Greenville School District","schooltype":"Magnet","state":"SC","studentteacherratio":{"total":16},"website":"http:\/\/www.greenville.k12.sc.us\/gvilleh\/","nces_id":"450231000564","url":"http:\/\/www.education.com\/schoolfinder\/us\/south-carolina\/greenville\/greenville-senior-high-academy\/"}},{"school":{"schoolid":"85381","schoolname":"Fuller Normal Advanced Charter School","zip":"29601","address":"Box 102","city":"Greenville","districtid":"15031","districtleaid":"4502310","AYPResult":"yes","AYPResultYear":"2009","APIGrowth":{"total":""},"APIGrowthYear":"","MetSchoolwideGrowthTarget":null,"distance":0,"enrollment":{"total":161},"gradelevel":"Elementary","gradesserved":"K-6","latitude":34.852623,"longitude":-82.3981018,"phonenumber":"(864) 271-3698","schooldistrictname":"Greenville School District","schooltype":"Charter","state":"SC","studentteacherratio":{"total":12},"website":"http:\/\/www.fnatcs.org","nces_id":"450231000962","url":"http:\/\/www.education.com\/schoolfinder\/us\/south-carolina\/greenville\/fuller-normal-advanced-charter-school\/"}},{"school":{"schoolid":"85990","schoolname":"Governor's School - Arts & Humanities","zip":"29601","address":"15 University Street","city":"Greenville","districtid":"15102","districtleaid":null,"AYPResult":null,"AYPResultYear":null,"APIGrowth":{"total":""},"APIGrowthYear":"","MetSchoolwideGrowthTarget":null,"distance":0,"enrollment":{"total":0},"gradelevel":"High","gradesserved":"9-12","latitude":34.8540382,"longitude":-82.3976288,"phonenumber":"(864) 282-3777","schooldistrictname":"Governor's Schools School District","schooltype":"Public","state":"SC","studentteacherratio":{"total":0},"website":"http:\/\/www.scgsah.state.sc.us","nces_id":null,"url":"http:\/\/www.education.com\/schoolfinder\/us\/south-carolina\/greenville\/governors-school--arts-and-humanities\/"}},{"school":{"schoolid":"105063","schoolname":"St Marys School","zip":"29601","address":"101 Hampton Ave","city":"Greenville","districtid":"16587","districtleaid":null,"AYPResult":null,"AYPResultYear":null,"APIGrowth":{"total":""},"APIGrowthYear":"","MetSchoolwideGrowthTarget":null,"distance":0,"enrollment":{"total":293},"gradelevel":"Elementary,Middle","gradesserved":"PK, K-8","latitude":34.8535957,"longitude":-82.4024353,"phonenumber":"(864) 271-3870","schooldistrictname":"SC Private Schools","schooltype":"Private","state":"SC","studentteacherratio":{"total":18},"website":"www.stmarysgvl.org\/theschool","nces_id":"01262779","url":"http:\/\/www.education.com\/schoolfinder\/us\/south-carolina\/greenville\/st-marys-school\/"}},{"school":{"schoolid":"105113","schoolname":"Haynsworth School","zip":"29601","address":"228 E Park Ave","city":"Greenville","districtid":"16587","districtleaid":null,"AYPResult":null,"AYPResultYear":null,"APIGrowth":{"total":""},"APIGrowthYear":"","MetSchoolwideGrowthTarget":null,"distance":0,"enrollment":{"total":40},"gradelevel":"Elementary","gradesserved":"PK, K-2","latitude":34.8574028,"longitude":-82.3923035,"phonenumber":"(864) 235-3010","schooldistrictname":"SC Private Schools","schooltype":"Private","state":"SC","studentteacherratio":{"total":3},"website":null,"nces_id":"01264018","url":"http:\/\/www.education.com\/schoolfinder\/us\/south-carolina\/greenville\/haynsworth-school\/"}},{"school":{"schoolid":"125062","schoolname":"First Presbyterian Academy","zip":"29601","address":"200 W Washington St","city":"Greenville","districtid":"16587","districtleaid":null,"AYPResult":null,"AYPResultYear":null,"APIGrowth":{"total":""},"APIGrowthYear":"","MetSchoolwideGrowthTarget":null,"distance":0,"enrollment":{"total":209},"gradelevel":"Elementary","gradesserved":"PK, K-1","latitude":34.851284,"longitude":-82.4006958,"phonenumber":"(864) 235-0122","schooldistrictname":"SC Private Schools","schooltype":"Private","state":"SC","studentteacherratio":{"total":5},"website":null,"nces_id":"K9305758","url":"http:\/\/www.education.com\/schoolfinder\/us\/south-carolina\/greenville\/first-presbyterian-church-kind\/"}}]
@@ -0,0 +1 @@
1
+ {"school":{"gender":[{"name":"Female","percentage":50,"total":645,"year":2008},{"name":"Male","percentage":50,"total":642,"year":2008}],"ethnicity":[{"name":"White","percentage":49,"total":633,"year":2008},{"name":"Black","percentage":45,"total":573,"year":2008},{"name":"Hispanic","percentage":5,"total":70,"year":2008},{"name":"Asian\/Pacific Islander","percentage":1,"total":10,"year":2008},{"name":"American Indian\/Alaskan Native","percentage":0,"total":1,"year":2008}]},"city":{"gender":[{"name":"Female","percentage":48,"total":12685,"average":295,"year":2006},{"name":"Female","percentage":48,"total":13313,"average":303,"year":2008},{"name":"Male","percentage":51,"total":13282,"average":309,"year":2006},{"name":"Male","percentage":52,"total":14076,"average":320,"year":2008}],"ethnicity":[{"name":"American Indian\/Alaskan Native","percentage":0,"total":0,"average":0,"year":2004},{"name":"American Indian\/Alaskan Native","percentage":0,"total":69,"average":1,"year":2006},{"name":"American Indian\/Alaskan Native","percentage":0,"total":53,"average":1,"year":2008},{"name":"Asian","percentage":2,"total":133,"average":5,"year":2008},{"name":"Asian\/Pacific Islander","percentage":1,"total":33,"average":1,"year":2004},{"name":"Asian\/Pacific Islander","percentage":2,"total":542,"average":8,"year":2006},{"name":"Asian\/Pacific Islander","percentage":2,"total":628,"average":15,"year":2008},{"name":"Black","percentage":14,"total":288,"average":10,"year":2004},{"name":"Black","percentage":26,"total":10082,"average":146,"year":2006},{"name":"Black","percentage":26,"total":10271,"average":145,"year":2008},{"name":"Hispanic","percentage":1,"total":51,"average":2,"year":2004},{"name":"Hispanic","percentage":8,"total":2762,"average":40,"year":2006},{"name":"Hispanic","percentage":9,"total":3671,"average":52,"year":2008},{"name":"White","percentage":86,"total":4083,"average":146,"year":2004},{"name":"White","percentage":62,"total":16897,"average":241,"year":2006},{"name":"White","percentage":63,"total":17650,"average":249,"year":2008}]}}
@@ -0,0 +1 @@
1
+ {"school":[{"stat_type":"Student Gender","data":[{"stat_name":"Female","year":2008,"percentage":50,"total":645},{"stat_name":"Male","year":2008,"percentage":50,"total":642}]},{"stat_type":"Student Ethnicity","data":[{"stat_name":"White","year":2008,"percentage":49,"total":633},{"stat_name":"Black","year":2008,"percentage":45,"total":573},{"stat_name":"Hispanic","year":2008,"percentage":5,"total":70},{"stat_name":"Asian\/Pacific Islander","year":2008,"percentage":1,"total":10},{"stat_name":"American Indian\/Alaskan Native","year":2008,"percentage":0,"total":1}]},{"stat_type":"Student Economic Level","data":[{"stat_name":"Students Eligible for Free or Reduced-Price Lunch","year":2008,"percentage":18,"total":236}]},{"stat_type":"Student Enrollment","data":[{"stat_name":"Total Enrollment","year":2008,"percentage":0,"total":1289}]}],"city":[{"stat_type":"Student Ethnicity","data":[{"stat_name":"American Indian\/Alaskan Native","year":2004,"percentage":0,"total":0},{"stat_name":"American Indian\/Alaskan Native","year":2006,"percentage":0,"total":69},{"stat_name":"American Indian\/Alaskan Native","year":2008,"percentage":0,"total":53},{"stat_name":"Asian","year":2008,"percentage":2,"total":133},{"stat_name":"Asian\/Pacific Islander","year":2004,"percentage":1,"total":33},{"stat_name":"Asian\/Pacific Islander","year":2006,"percentage":2,"total":541},{"stat_name":"Asian\/Pacific Islander","year":2008,"percentage":2,"total":628},{"stat_name":"Black","year":2004,"percentage":12,"total":279},{"stat_name":"Black","year":2006,"percentage":27,"total":10078},{"stat_name":"Black","year":2008,"percentage":26,"total":10271},{"stat_name":"Hispanic","year":2004,"percentage":2,"total":51},{"stat_name":"Hispanic","year":2006,"percentage":8,"total":2759},{"stat_name":"Hispanic","year":2008,"percentage":9,"total":3671},{"stat_name":"White","year":2004,"percentage":89,"total":4013},{"stat_name":"White","year":2006,"percentage":61,"total":16833},{"stat_name":"White","year":2008,"percentage":63,"total":17650}]},{"stat_type":"Student Gender","data":[{"stat_name":"Female","year":2006,"percentage":48,"total":12685},{"stat_name":"Female","year":2008,"percentage":48,"total":13313},{"stat_name":"Male","year":2006,"percentage":51,"total":13282},{"stat_name":"Male","year":2008,"percentage":52,"total":14076}]},{"stat_type":"Student Completion","data":[{"stat_name":"Students Attending 4 Year Colleges","year":2008,"percentage":81,"total":0}]},{"stat_type":"Student Economic Level","data":[{"stat_name":"Students Eligible for Free or Reduced-Price Lunch","year":2006,"percentage":46,"total":12366},{"stat_name":"Students Eligible for Free or Reduced-Price Lunch","year":2008,"percentage":51,"total":13115}]},{"stat_type":"Student Enrollment","data":[{"stat_name":"Total Enrollment","year":2004,"percentage":0,"total":6950},{"stat_name":"Total Enrollment","year":2006,"percentage":0,"total":32719},{"stat_name":"Total Enrollment","year":2008,"percentage":0,"total":34436}]}]}
@@ -0,0 +1 @@
1
+ {"school":[{"stat_type":"Student-Teacher Ratio","stat_name":"Students per Full-Time Teacher","year":2008,"value":null,"total":16}]}
@@ -0,0 +1 @@
1
+ [{"school":{"schoolname":"Chester W. Nimitz Elementary School","testrating_text":"Education.com TestRating 6","testrating_image_large":"http:\/\/www.education.com\/themes\/sky\/i\/schoolfinder\/images\/school-rating6.png","testrating_image_small":"http:\/\/www.education.com\/themes\/sky\/i\/schoolfinder\/images\/small-school-rating6.png","testrating_year":2009,"lsp":"http:\/\/www.education.com\/schoolfinder\/us\/california\/sunnyvale\/chester-w-nimitz-elementary\/"}}]
@@ -0,0 +1 @@
1
+ {"school":[{"grade":"Grade 10","testname":"High School Assessment Program (HSAP) Results","subject":"Language Arts","score":{"percentage":84},"year":2009,"max_score":{"total":100},"description":"The High School Assessment Program (HSAP) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 10","testname":"High School Assessment Program (HSAP) Results","subject":"Math","score":{"percentage":80},"year":2009,"max_score":{"total":100},"description":"The High School Assessment Program (HSAP) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 12","testname":"ACT Results","subject":"Composite","score":{"total":22},"year":2009,"max_score":{"total":36},"description":"The ACT is a national college admissions test used to assess student performance in high school curriculum areas. "},{"grade":"Grade 12","testname":"ACT Results","subject":"English","score":{"total":22},"year":2009,"max_score":{"total":36},"description":"The ACT is a national college admissions test used to assess student performance in high school curriculum areas. "},{"grade":"Grade 12","testname":"ACT Results","subject":"Math","score":{"total":21},"year":2009,"max_score":{"total":36},"description":"The ACT is a national college admissions test used to assess student performance in high school curriculum areas. "},{"grade":"Grade 12","testname":"ACT Results","subject":"Reading","score":{"total":22},"year":2009,"max_score":{"total":36},"description":"The ACT is a national college admissions test used to assess student performance in high school curriculum areas. "},{"grade":"Grade 12","testname":"ACT Results","subject":"Science","score":{"total":21},"year":2009,"max_score":{"total":36},"description":"The ACT is a national college admissions test used to assess student performance in high school curriculum areas. "},{"grade":"Grade 12","testname":"SAT Results","subject":"Average Critical Reading Score","score":{"total":492},"year":2009,"max_score":{"total":800},"description":"The SAT Reasoning Test is a voluntary college admissions test used to assess critical thinking skills and student ability to analyze and solve problems."},{"grade":"Grade 12","testname":"SAT Results","subject":"Average Mathematics Score","score":{"total":493},"year":2009,"max_score":{"total":800},"description":"The SAT Reasoning Test is a voluntary college admissions test used to assess critical thinking skills and student ability to analyze and solve problems."},{"grade":"Grade 12","testname":"SAT Results","subject":"Average Writing Score","score":{"total":471},"year":2009,"max_score":{"total":800},"description":"The SAT Reasoning Test is a voluntary college admissions test used to assess critical thinking skills and student ability to analyze and solve problems."},{"grade":"Grade 12","testname":"SAT Results","subject":"Overall Score","score":{"total":1457},"year":2009,"max_score":{"total":800},"description":"The SAT Reasoning Test is a voluntary college admissions test used to assess critical thinking skills and student ability to analyze and solve problems."},{"grade":"Grade 12","testname":"SAT Results","subject":"SAT Mean Score","score":{"total":1482},"year":2008,"max_score":{"total":2400},"description":"The SAT Reasoning Test is a voluntary college admissions test used to assess critical thinking skills and student ability to analyze and solve problems."}],"state":[{"grade":"Grade 3","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"English Language Arts","score":{"percentage":78},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 3","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Mathematics","score":{"percentage":67},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 3","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Science","score":{"percentage":61.5},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 3","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Social Studies","score":{"percentage":74.4},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 3","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Writing","score":{"percentage":68.9},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 4","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"English Language Arts","score":{"percentage":75.7},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 4","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Mathematics","score":{"percentage":76.8},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 4","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Science","score":{"percentage":68.7},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 4","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Social Studies","score":{"percentage":79.8},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 4","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Writing","score":{"percentage":70.1},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 5","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"English Language Arts","score":{"percentage":80},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 5","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Mathematics","score":{"percentage":73.5},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 5","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Science","score":{"percentage":68.3},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 5","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Social Studies","score":{"percentage":70},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 5","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Writing","score":{"percentage":73.2},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 6","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"English Language Arts","score":{"percentage":71.7},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 6","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Mathematics","score":{"percentage":70.3},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 6","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Science","score":{"percentage":63.9},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 6","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Social Studies","score":{"percentage":79.6},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 6","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Writing","score":{"percentage":70.3},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 7","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"English Language Arts","score":{"percentage":68.7},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 7","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Mathematics","score":{"percentage":69.5},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 7","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Science","score":{"percentage":71.2},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 7","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Social Studies","score":{"percentage":60.3},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 7","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Writing","score":{"percentage":70.1},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 8","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"English Language Arts","score":{"percentage":67.5},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 8","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Mathematics","score":{"percentage":62.6},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 8","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Science","score":{"percentage":62.3},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 8","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Social Studies","score":{"percentage":69.6},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 8","testname":"Palmetto Assessment of State Standards (PASS) Results","subject":"Writing","score":{"percentage":68.1},"year":2009,"max_score":{"total":100},"description":"The Palmetto Assessment of State Standards (PASS) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 10","testname":"High School Assessment Program (HSAP) Results","subject":"Language Arts","score":{"percentage":84.9},"year":2009,"max_score":{"total":100},"description":"The High School Assessment Program (HSAP) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 10","testname":"High School Assessment Program (HSAP) Results","subject":"Math","score":{"percentage":80.2},"year":2009,"max_score":{"total":100},"description":"The High School Assessment Program (HSAP) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 12","testname":"ACT Results","subject":"Composite","score":{"total":19.8},"year":2009,"max_score":{"total":36},"description":"The ACT is a national college admissions test used to assess student performance in high school curriculum areas. "},{"grade":"Grade 12","testname":"ACT Results","subject":"English","score":{"total":19.2},"year":2009,"max_score":{"total":36},"description":"The ACT is a national college admissions test used to assess student performance in high school curriculum areas. "},{"grade":"Grade 12","testname":"ACT Results","subject":"Math","score":{"total":20},"year":2009,"max_score":{"total":36},"description":"The ACT is a national college admissions test used to assess student performance in high school curriculum areas. "},{"grade":"Grade 12","testname":"ACT Results","subject":"Reading","score":{"total":19.9},"year":2009,"max_score":{"total":36},"description":"The ACT is a national college admissions test used to assess student performance in high school curriculum areas. "},{"grade":"Grade 12","testname":"ACT Results","subject":"Science","score":{"total":19.8},"year":2009,"max_score":{"total":36},"description":"The ACT is a national college admissions test used to assess student performance in high school curriculum areas. "},{"grade":"Grade 12","testname":"SAT Results","subject":"Average Critical Reading Score","score":{"total":501},"year":2009,"max_score":{"total":800},"description":"The SAT Reasoning Test is a voluntary college admissions test used to assess critical thinking skills and student ability to analyze and solve problems."},{"grade":"Grade 12","testname":"SAT Results","subject":"Average Mathematics Score","score":{"total":515},"year":2009,"max_score":{"total":800},"description":"The SAT Reasoning Test is a voluntary college admissions test used to assess critical thinking skills and student ability to analyze and solve problems."},{"grade":"Grade 12","testname":"SAT Results","subject":"Average Writing Score","score":{"total":493},"year":2009,"max_score":{"total":800},"description":"The SAT Reasoning Test is a voluntary college admissions test used to assess critical thinking skills and student ability to analyze and solve problems."},{"grade":"Grade 12","testname":"SAT Results","subject":"Overall Score","score":{"total":1509},"year":2009,"max_score":{"total":800},"description":"The SAT Reasoning Test is a voluntary college admissions test used to assess critical thinking skills and student ability to analyze and solve problems."},{"grade":"Grade 3","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"English Language Arts","score":{"percentage":86.7},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 3","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Mathematics","score":{"percentage":77.2},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 3","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Science","score":{"percentage":71.1},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 3","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Social Studies","score":{"percentage":83.9},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 4","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"English Language Arts","score":{"percentage":80.8},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 4","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Mathematics","score":{"percentage":79},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 4","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Science","score":{"percentage":68.9},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 4","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Social Studies","score":{"percentage":76.3},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 5","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"English Language Arts","score":{"percentage":77.6},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 5","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Mathematics","score":{"percentage":78},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 5","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Science","score":{"percentage":61.4},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 5","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Social Studies","score":{"percentage":66.3},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 6","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"English Language Arts","score":{"percentage":74.8},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 6","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Mathematics","score":{"percentage":75.7},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 6","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Science","score":{"percentage":56.5},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 6","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Social Studies","score":{"percentage":77.8},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 7","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"English Language Arts","score":{"percentage":73},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 7","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Mathematics","score":{"percentage":77.8},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 7","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Science","score":{"percentage":69.8},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 7","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Social Studies","score":{"percentage":56.4},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 8","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"English Language Arts","score":{"percentage":71},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 8","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Mathematics","score":{"percentage":69.7},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 8","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Science","score":{"percentage":63.4},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 8","testname":"Palmetto Achievement Challenge Tests (PACT) Results","subject":"Social Studies","score":{"percentage":68.7},"year":2008,"max_score":{"total":100},"description":"The Palmetto Achievement Challenge Tests (PACT) are annual tests used to measure a student's mastery of the state's grade-level academic standards."},{"grade":"Grade 12","testname":"SAT Results","subject":"SAT Mean Score","score":{"total":1511},"year":2008,"max_score":{"total":2400},"description":"The SAT Reasoning Test is a voluntary college admissions test used to assess critical thinking skills and student ability to analyze and solve problems."}]}
@@ -0,0 +1,148 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Schoolfinder::Client" do
4
+ before(:each) do
5
+ @schoolfinder = new_schoolfinder
6
+ end
7
+
8
+ context "school_search" do
9
+ before do
10
+ mock_get({"f" => "schoolSearch", "zip" => "29601"}, 'school_search.json')
11
+ end
12
+
13
+ it { lambda {@schoolfinder.school_search(:zip => "29601")}.should_not raise_exception }
14
+
15
+ it "should return a response" do
16
+ @response = @schoolfinder.school_search(:zip => "29601")
17
+ @response.should_not be_nil
18
+ @response.body.should be_kind_of(Array)
19
+ end
20
+ end
21
+
22
+ context "test_rating" do
23
+ before do
24
+ mock_get({"f" => "getTestRating", "nces_id" => "061029001146"}, 'test_rating.json')
25
+ end
26
+
27
+ it { lambda {@schoolfinder.test_rating(:nces_id => "061029001146")}.should_not raise_exception }
28
+
29
+ it "should return a response" do
30
+ @response = @schoolfinder.test_rating(:nces_id => "061029001146")
31
+ @response.should_not be_nil
32
+ @response.body.should be_kind_of(Array)
33
+ end
34
+ end
35
+
36
+ context "student_diversity" do
37
+ before do
38
+ mock_get({"f" => "getStudentDiversity", "nces_id" => "450231000564"}, 'student_diversity.json')
39
+ end
40
+
41
+ it { lambda {@schoolfinder.student_diversity(:nces_id => "450231000564")}.should_not raise_exception }
42
+
43
+ it "should return a response" do
44
+ @response = @schoolfinder.student_diversity(:nces_id => "450231000564")
45
+ @response.should_not be_nil
46
+ @response.body.should be_kind_of(Hashie::Rash)
47
+ end
48
+ end
49
+
50
+ context "test_scores" do
51
+ before do
52
+ mock_get({"f" => "getTestScores", "nces_id" => "450231000564"}, 'test_scores.json')
53
+ end
54
+
55
+ it { lambda {@schoolfinder.test_scores(:nces_id => "450231000564")}.should_not raise_exception }
56
+
57
+ it "should return a response" do
58
+ @response = @schoolfinder.test_scores(:nces_id => "450231000564")
59
+ @response.should_not be_nil
60
+ @response.body.should be_kind_of(Hashie::Rash)
61
+ end
62
+ end
63
+
64
+ context "teacher_stats" do
65
+ before do
66
+ mock_get({"f" => "getTeacherStats", "nces_id" => "450231000564", "districtleaid" => "4502310"}, 'teacher_stats.json')
67
+ end
68
+
69
+ it { lambda {@schoolfinder.teacher_stats(:nces_id => "450231000564", :districtleaid => "4502310")}.should_not raise_exception }
70
+
71
+ it "should return a response" do
72
+ @response = @schoolfinder.teacher_stats(:nces_id => "450231000564", :districtleaid => "4502310")
73
+ @response.should_not be_nil
74
+ @response.body.should be_kind_of(Hashie::Rash)
75
+ end
76
+ end
77
+
78
+ context "student_stats" do
79
+ before do
80
+ mock_get({"f" => "getStudentStats", "nces_id" => "450231000564", "districtleaid" => "4502310", "city" => "Greenville", "state" => "SC"}, 'student_stats.json')
81
+ end
82
+
83
+ it { lambda {@response = @schoolfinder.student_stats(:nces_id => "450231000564", :districtleaid => "4502310", :city => "Greenville", :state => "SC")}.should_not raise_exception }
84
+
85
+ it "should return a response" do
86
+ @response = @schoolfinder.student_stats(:nces_id => "450231000564", :districtleaid => "4502310", :city => "Greenville", :state => "SC")
87
+ @response.should_not be_nil
88
+ @response.body.should be_kind_of(Hashie::Rash)
89
+ end
90
+ end
91
+
92
+ context "reviews" do
93
+ before do
94
+ mock_get({"f" => "getReviews", "schoolid" => "25381"}, 'reviews.json')
95
+ end
96
+
97
+ it { lambda {@schoolfinder.reviews(:schoolid => "25381")}.should_not raise_exception }
98
+
99
+ it "should return a response" do
100
+ @response = @schoolfinder.reviews(:schoolid => "25381")
101
+ @response.should_not be_nil
102
+ @response.body.should be_kind_of(Hashie::Rash)
103
+ end
104
+ end
105
+
106
+ context "number_of" do
107
+ before do
108
+ mock_get({"f" => "numberOf", "city" => "Greenville", "state" => "SC"}, 'number_of.json')
109
+ end
110
+
111
+ it { lambda {@schoolfinder.number_of("Greenville", "SC")}.should_not raise_exception }
112
+
113
+ it "should return a response" do
114
+ @response = @schoolfinder.number_of("Greenville", "SC")
115
+ @response.should_not be_nil
116
+ @response.body.should be_kind_of(Array)
117
+ end
118
+ end
119
+
120
+ context "district_search" do
121
+ before do
122
+ mock_get({"f" => "districtSearch", "city" => "Greenville", "state" => "SC"}, 'district_search.json')
123
+ end
124
+
125
+ it { lambda {@schoolfinder.district_search(:city => "Greenville", :state => "SC")}.should_not raise_exception }
126
+
127
+ it "should return a response" do
128
+ @response = @schoolfinder.district_search(:city => "Greenville", :state => "SC")
129
+ @response.should_not be_nil
130
+ @response.body.should be_kind_of(Array)
131
+ end
132
+ end
133
+
134
+ context "branding_data" do
135
+ before do
136
+ mock_get({"f" => "gbd", "nces_id" => "450231000564"}, 'branding_data.json')
137
+ end
138
+
139
+ it { lambda {@schoolfinder.branding_data(:nces_id => "450231000564")}.should_not raise_exception }
140
+
141
+ it "should return a response" do
142
+ @response = @schoolfinder.branding_data(:nces_id => "450231000564")
143
+ @response.should_not be_nil
144
+ @response.body.should be_kind_of(Hashie::Rash)
145
+ end
146
+ end
147
+
148
+ end
@@ -0,0 +1,16 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Schoolfinder::Error" do
4
+
5
+ before do
6
+ mock_get({"f" => "getTestScores", "nces_id" => "450231000564"}, 'failure.json')
7
+ @schoolfinder = new_schoolfinder
8
+ end
9
+
10
+ it "should return an error" do
11
+ lambda {
12
+ @response = @schoolfinder.test_scores(:nces_id => "450231000564")
13
+ }.should raise_exception(Schoolfinder::Error, "Schoolfinder Error: invalid api key (code: 3)")
14
+ end
15
+
16
+ end
@@ -0,0 +1 @@
1
+ api_key: put_your_key_kere
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,28 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'schoolfinder'
4
+ require 'spec'
5
+ require 'spec/autorun'
6
+ require 'webmock/rspec'
7
+
8
+ SCHOOLFINDER_API_KEY = YAML.load_file(File.join(File.dirname(__FILE__), 'schoolfinder_api_key.yml'))["api_key"]
9
+
10
+ Spec::Runner.configure do |config|
11
+ config.include WebMock
12
+ end
13
+
14
+ def new_schoolfinder
15
+ Schoolfinder::Client.new(SCHOOLFINDER_API_KEY)
16
+ end
17
+
18
+ def default_params
19
+ {"v" => "3", "key" => SCHOOLFINDER_API_KEY, "resf" => "json", "sn" => "sf"}
20
+ end
21
+
22
+ def mock_get(params, response_fixture)
23
+ stub_http_request(:get, "api.education.com/service/service.php").with(:query => default_params.merge(params)).to_return(:body => mocked_response(response_fixture))
24
+ end
25
+
26
+ def mocked_response(response_fixture)
27
+ File.read(File.join(File.dirname(__FILE__), 'responses', response_fixture))
28
+ end
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: schoolfinder
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - tcocca
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-08-25 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: httparty
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.6.1
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: hashie
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.3.1
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: rspec
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 1.2.9
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: webmock
47
+ type: :development
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 1.3.4
54
+ version:
55
+ description: api wrapper for the education.com schoolfinder
56
+ email: tom.cocca@gmail.com
57
+ executables: []
58
+
59
+ extensions: []
60
+
61
+ extra_rdoc_files:
62
+ - LICENSE
63
+ - README.rdoc
64
+ files:
65
+ - .document
66
+ - .gitignore
67
+ - LICENSE
68
+ - README.rdoc
69
+ - Rakefile
70
+ - VERSION
71
+ - lib/rash.rb
72
+ - lib/schoolfinder.rb
73
+ - lib/schoolfinder/client.rb
74
+ - lib/schoolfinder/error.rb
75
+ - lib/schoolfinder/response.rb
76
+ - spec/rash_spec.rb
77
+ - spec/responses/branding_data.json
78
+ - spec/responses/district_search.json
79
+ - spec/responses/failure.json
80
+ - spec/responses/number_of.json
81
+ - spec/responses/reviews.json
82
+ - spec/responses/school_search.json
83
+ - spec/responses/student_diversity.json
84
+ - spec/responses/student_stats.json
85
+ - spec/responses/teacher_stats.json
86
+ - spec/responses/test_rating.json
87
+ - spec/responses/test_scores.json
88
+ - spec/schoolfinder/client_spec.rb
89
+ - spec/schoolfinder/error_spec.rb
90
+ - spec/schoolfinder_api_key.example.yml
91
+ - spec/spec.opts
92
+ - spec/spec_helper.rb
93
+ has_rdoc: true
94
+ homepage: http://github.com/tcocca/schoolfinder
95
+ licenses: []
96
+
97
+ post_install_message:
98
+ rdoc_options:
99
+ - --charset=UTF-8
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: "0"
107
+ version:
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: "0"
113
+ version:
114
+ requirements: []
115
+
116
+ rubyforge_project:
117
+ rubygems_version: 1.3.5
118
+ signing_key:
119
+ specification_version: 3
120
+ summary: api wrapper for the education.com schoolfinder
121
+ test_files:
122
+ - spec/rash_spec.rb
123
+ - spec/schoolfinder/client_spec.rb
124
+ - spec/schoolfinder/error_spec.rb
125
+ - spec/spec_helper.rb