/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); MetaDataResult metaData = session.getMetaData(MetaDataRequest.of("WIKI/AAPL")); System.out.println(metaData.toPrettyPrintedString()); }
/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); MetaDataResult metaData = session.getMetaData(MultiMetaDataRequest.of("WIKI/AAPL", "DOE/RWTC", "WIKI/MSFT")); System.out.println(metaData.toPrettyPrintedString()); }
/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); Map<String, HeaderDefinition> headers = session.getMultipleHeaderDefinition(MultiMetaDataRequest.of("WIKI/AAPL", "DOE/RWTC", "WIKI/MSFT")); System.out.println(PrettyPrinter.toPrettyPrintedString(headers)); }
/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); TabularResult tabularResult = session.getDataSet( DataSetRequest.Builder.of("WIKI/AAPL").build()); System.out.println(tabularResult.toPrettyPrintedString()); }
private QuandlSession getTestSession(final String expectedURL) { return QuandlSession.create( SessionOptions.Builder.withoutAuthToken() .withRESTDataProvider( new TestRESTDataProvider(expectedURL)) .build()); }
/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); SearchResult searchResult = session.search(new SearchRequest.Builder().withQuery("Apple").withMaxPerPage(2).build()); System.out.println("Current page:" + searchResult.getCurrentPage()); System.out.println("Documents per page:" + searchResult.getDocumentsPerPage()); System.out.println("Total matching documents:" + searchResult.getTotalDocuments()); for (MetaDataResult document : searchResult.getMetaDataResultList()) { System.out.println("Quandl code " + document.getQuandlCode() + " matched"); System.out.println("Available columns are: " + document.getHeaderDefinition()); } }
/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); SearchResult searchResult = session.search(new SearchRequest.Builder().withQuery("Apple").withMaxPerPage(2).build()); System.out.println(searchResult.toPrettyPrintedString()); }
/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); TabularResult tabularResult = session.getDataSet( DataSetRequest.Builder .of("WIKI/AAPL") .withFrequency(Frequency.QUARTERLY) .withColumn(CLOSE_COLUMN) .withTransform(Transform.NORMALIZE) .build()); System.out.println(tabularResult.toPrettyPrintedString()); }
/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); TabularResult tabularResultMulti = session.getDataSets( MultiDataSetRequest.Builder .of( QuandlCodeRequest.singleColumn("WIKI/AAPL", CLOSE_COLUMN), QuandlCodeRequest.allColumns("DOE/RWTC") ) .withStartDate(RECENTISH_DATE) .withFrequency(Frequency.MONTHLY) .build()); System.out.println("Header definition: " + tabularResultMulti.getHeaderDefinition()); Iterator<Row> iter = tabularResultMulti.iterator(); while (iter.hasNext()) { Row row = iter.next(); LocalDate date = row.getLocalDate("Date"); Double value = row.getDouble("DOE/RWTC - Value"); System.out.println("Value on date " + date + " was " + value); } }
/** * The main body of the code. */ private void run() { QuandlSession session = QuandlSession.create(); TabularResult tabularResultMulti = session.getDataSets( MultiDataSetRequest.Builder .of( QuandlCodeRequest.singleColumn("WIKI/AAPL", CLOSE_COLUMN), QuandlCodeRequest.allColumns("DOE/RWTC") ) .withStartDate(RECENTISH_DATE) .withFrequency(Frequency.MONTHLY) .build()); System.out.println(tabularResultMulti.toPrettyPrintedString()); }
.build(); QuandlSession session = QuandlSession.create(options); Set<String> quandlCodes = sampleSearch(session, resultProcessor); fuzzDataSetRequests(session, resultProcessor, quandlCodes);
/** * The main body of the code. */ private void run() { QuandlSession quandl = QuandlSession.create(); SearchResult searchResult = quandl.search(SearchRequest.Builder.ofQuery("Apple").withMaxPerPage(2).build()); System.out.println(searchResult.toPrettyPrintedString()); for (MetaDataResult metaData : searchResult.getMetaDataResultList()) { System.out.println(PrettyPrinter.toPrettyPrintedString(metaData.getRawJSON())); } TabularResult tabularResult = null; tabularResult = quandl.getDataSet(DataSetRequest.Builder.of("WIKI/AAPL").withFrequency(Frequency.QUARTERLY) .withColumn(CLOSE_COLUMN).withTransform(Transform.NORMALIZE).build()); System.out.println(PrettyPrinter.toPrettyPrintedString(tabularResult)); TabularResult tabularResultMulti = quandl.getDataSets( MultiDataSetRequest.Builder.of( QuandlCodeRequest.allColumns("WIKI/AAPL"), QuandlCodeRequest.allColumns("DOE/RWTC") ).withStartDate(RECENTISH_DATE) .build()); System.out.println(PrettyPrinter.toPrettyPrintedString(tabularResultMulti)); MetaDataResult metaData = quandl.getMetaData(MetaDataRequest.of("WIKI/AAPL")); System.out.println(PrettyPrinter.toPrettyPrintedString(metaData.getRawJSON())); MetaDataResult metaData2 = quandl.getMetaData(MultiMetaDataRequest.of("WIKI/AAPL", "DOE/RWTC", "WIKI/MSFT")); System.out.println(PrettyPrinter.toPrettyPrintedString(metaData2.getRawJSON())); }