Skip to content

Commit

Permalink
Merge pull request #292 from tshrestha/master
Browse files Browse the repository at this point in the history
Modularized SDK
  • Loading branch information
RonDeSena authored Jun 30, 2016
2 parents 8840414 + cff1bd3 commit dabc64e
Show file tree
Hide file tree
Showing 143 changed files with 57,754 additions and 28,032 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [ "es2015-rollup" ]
}
271 changes: 6 additions & 265 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,269 +1,10 @@
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
### VisualStudioCode template
.settings

### Xcode template
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata

## Other
*.xccheckout
*.moved-aside
*.xcuserstate
### SublimeText template
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# workspace files are user-specific
*.sublime-workspace

# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project

# sftp configuration file
sftp-config.json
### Linux template
*~

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*
### NotepadPP template
# Notepad++ backups #
*.bak
### Vim template
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist

### TortoiseGit template
# Project-level settings
/.tgitconfig

### TextMate template
*.tmproj
*.tmproject
tmtags

### SVN template
.svn/

### Vagrant template
.vagrant/

### NetBeans template
nbproject/private/
nbbuild/
nbdist/
nbactions.xml
nb-configuration.xml
.nb-gradle/

### LibreOffice template
# LibreOffice locks
.~lock.*#

### Eclipse template
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.swp
*~.nib
local.properties
.settings/
.loadpath

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# JDT-specific (Eclipse Java Development Tools)
.classpath

# Java annotation processor (APT)
.factorypath

# PDT-specific
.buildpath

# sbteclipse plugin
.target

# TeXlipse plugin
.texlipse

### Dreamweaver template
# DW Dreamweaver added files
_notes
dwsync.xml

### Emacs template
# -*- mode: gitignore; -*-
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/

### CodeKit template
# General CodeKit files to ignore
config.codekit
/min
_site
node_modules
.idea

### OSX template
# For macOs
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Windows template
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk
### Mercurial template
/.hg/*
*/.hg/*
.hgignore

node_modules
bower_components
/_site
# Exclude source maps
*.js.map

42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ Source code can be found in the js directory.

## Intro

Through our City SDK, we are aiming to provide a user-friendly "toolbox" for civic hackers to connect local and national public data. The creation of the SDK came out of the desire to make it easier to use the Census API for common tasks that our developer community asked for. We have been engaging developers around the country for the past two years and have observed how they use the API and have built the most commonly needed functionalities built on top of our API right into the SDK, saving the developer from having to do it herself.
Through our City SDK, we are aiming to provide a user-friendly "toolbox" for civic hackers to connect local and national
public data. The creation of the SDK came out of the desire to make it easier to use the Census API for common tasks
that our developer community asked for. We have been engaging developers around the country for the past two years and
have observed how they use the API and have built the most commonly needed functionalities built on top of our API right
into the SDK, saving the developer from having to do it herself.

## Features
- Never have to figure out what your FIPS code is again! Just pass in lat/longs, we handle the translation. Only have ZIP codes? No problem, we translate those too.
Expand All @@ -22,10 +26,46 @@ Through our City SDK, we are aiming to provide a user-friendly "toolbox" for civ
- We’ve provided a starting list of aliases for some of our most popular variables (most aliases are in the American Community Survey [ACS5])
- More coming soon! (you may also add to our issues using the [#user stories](https://github.com/uscensusbureau/citysdk/issues?q=is%3Aopen+is%3Aissue+label%3A%22user+stories%22) label to make feature requests)

## Getting Started

CitySdk is available as an API _and_ SDK. If you want to use the API, then read the [API documentation](src/api/README.md).

To use the JavaScript SDK, you'll need to add four dependencies:

1. JQuery
2. ES6 Promise Polyfill
3. Terraformer
4. Terraformer ArcGIS Parser

Make sure the `script` tag for CitySdk is the last one.

```
<script src="https://www.promisejs.org/polyfills/promise-6.1.0.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdn-geoweb.s3.amazonaws.com/terraformer/1.0.5/terraformer.min.js"></script>
<script src="https://cdn-geoweb.s3.amazonaws.com/terraformer-arcgis-parser/1.0.4/terraformer-arcgis-parser.min.js"></script>
<script src="https://raw.githubusercontent.com/uscensusbureau/citysdk/0.2.0/citysdk.js"></script>
```

Once you have all that in place you can start using CitySdk:

```
<script>
let request = {
"zip": "21701",
"variables": ["income", "population"],
"level": "county",
"sublevel": true,
"state": "MD",
"container": "state"
};
let data;
CitySdk.request(request).then((response) => doSomethingWithData(response));
function doSomethingWithData(data) {
// Do something
}
</script>
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit dabc64e

Please sign in to comment.