Simple Data Toolkit provides an API for retrieving trophies from PlayStation. (Release pending)
You will need to get an NPSSO token first:
Login via https://store.playstation.com
And then access https://ca.account.sony.com/api/v1/ssocookie
This will need to be set in an environment variable PSN_NPSSO
Or you can set it in Python with com_sdtk_api_PSNAPI.setNpsso
To retrieve all trophies for an account id in Python, using Simple Data Toolkit, we can do the following:
from sdtk import com_sdtk_api_PSNAPI
def printer(data, reader):
print(reader.toArrayOfNativeMaps(None))
com_sdtk_api_PSNAPI.trophyTitlesAPI().retrieveData({"accountId": None}, printer)
from sdtk import com_sdtk_api_PSNAPI
def printer(data, reader):
print(reader.toArrayOfNativeMaps(None))
com_sdtk_api_PSNAPI.trophiesForTitleAPI().retrieveData({"communicationId": "NPWR20188_00", "trophyGroupId": None}, printer)
from sdtk import com_sdtk_api_PSNAPI
def printer(data, reader):
print(reader.toArrayOfNativeMaps(None))
com_sdtk_api_PSNAPI.trophiesEarnedForATitleAPI().retrieveData({"accountId": None, "communicationId": "NPWR20188_00", "trophyGroupId": None}, printer)
from sdtk import com_sdtk_api_GitAPI def printer(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_GitAPI.reposAPI().retrieveData({"owner": "Vis-LLC"}, printer)To retrieve all branches a repo has using Simple Data Toolkit, we can do the following:
from sdtk import com_sdtk_api_GitAPI def printer(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_GitAPI.branchesAPI().retrieveData({"owner": "Vis-LLC", "repo": "Simple-Data-Toolkit"}, printer)To retrieve all the files in a branch using Simple Data Toolkit, we can do the following:
from sdtk import com_sdtk_api_GitAPI def printer(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_GitAPI.filesAPI().retrieveData({"owner": "Vis-LLC", "repo": "Simple-Data-Toolkit", "branch": "main"}, printer)To retrieve the data in a file using Simple Data Toolkit, we can do the following:
from sdtk import com_sdtk_api_GitAPI def printerData(data, reader): print(data) com_sdtk_api_GitAPI.retrieveAPI().retrieveData({"owner": "Vis-LLC", "repo": "Simple-Data-Toolkit-UI", "branch": "main", "path": "index.html"}, printerData)We can also login using a personal access token (https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
from sdtk import com_sdtk_api_GitAPI def printerData(data, reader): print(data) com_sdtk_api_GitAPI.instance().setKey("Personal Access Token Here").retrieveAPI().retrieveData({"owner": "Vis-LLC", "repo": "Simple-Data-Toolkit-UI", "branch": "main", "path": "index.html"}, printerData)Simple Data Toolkit - Tutorial - Ortingo API - PythonAt the time of this writing, Ortingo does not have an official API. Fortunately, Simple Data Toolkit provides an unofficial API for reading posts (at the time of this writing, the release of this is pending for complete support, but it is coming soon) To retrieve all posts for a given user in Python, using Simple Data Toolkit, we can do the following:
from sdtk import com_sdtk_api_OrtingoAPI def printer(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_OrtingoAPI.postsAPI().retrieveData({"owner": "60CQ59FN46SVQFXJ"}, printer)Let's suppose we want only a list of titles for a given user, we can do this instead:
from sdtk import com_sdtk_api_OrtingoAPI def printer(data, reader): print(reader.filterColumnsOnly(["title"]).toArrayOfNativeMaps(None)) com_sdtk_api_OrtingoAPI.postsAPI().retrieveData({"owner": "60CQ59FN46SVQFXJ"}, printer)We can also pull suggested content from Ortingo with the following, where the topics we are searching on are provided with the query parameter (in this case it's value is data):
from sdtk import com_sdtk_api_OrtingoAPI def printerUrls(data, reader): print(reader.filterColumnsOnly(["url"]).toArrayOfNativeMaps(None)) com_sdtk_api_OrtingoAPI.suggestionsAPI().retrieveData({"query": "data"}, printerUrls)And finally, we can also pull comments attached to a post in Ortingo with the following, where the user is myself and the post is a test post I created:
from sdtk import com_sdtk_api_OrtingoAPI def printerComments(data, reader): print(reader.filterColumnsOnly(["commentDate", "post"]).toArrayOfNativeMaps(None)) com_sdtk_api_OrtingoAPI.commentsAPI().retrieveData({"owner": "60CQ59FN46SVQFXJ", "id": "test"}, printerComments)The columns supported at the time of this writing are: - id - owner - title - subtitle - post - url For comments the following columns are supported: - id - owner - commentDate - replyTo - postAtotium News - Business Aggregate - 2024-11-18Title: 401(k) Managed Accounts Are an Underutilized Resource URL: https://www.aaii.com/journal/article/233462-401k-managed-accounts-are-an-underutilized-resource Summary: A study conducted by Cerulli Associates, sponsored by Edelman Financial Engines, reveals the benefits and underutilization of 401(k) managed accounts among retirement plan participants. The study found that participants in managed account programs are nearly three times more confident in their retirement investing strategy. Despite these benefits, only 8% of participants use managed accounts, with a majority unable to correctly define them. The researchers suggest that improved communication and framing these accounts as employee benefits, along with promoting human advisor interactions, could increase adoption rates and enhance the financial well-being of 401(k) participants. Title: Using Bond Ladders and Income Annuities for Retirement Income URL: https://www.aaii.com/journal/article/13928-using-bond-ladders-and-income-annuities-for-retirement-income Summary: The article by Aaron Brask discusses two financial tools—bond ladders and income annuities—that retirees can use to generate stable cash flows and manage risks associated with retirement. It critiques the conventional total-return investing strategy, emphasizing that fixed-income investments like bonds can offer less risky, stable cash flows when held to maturity. Bond ladders are recommended for their simplicity and passive income features, while income annuities are highlighted for their ability to pool longevity risks across individuals, thereby enabling more efficient retirement funding. The article also addresses misconceptions around annuities, detailing their competitiveness and benefits in securing guaranteed lifetime income. Overall, both tools provide retirees with options to structure effective retirement income strategies while minimizing market volatility and actuarial risks. Title: So You Have Decided to Buy Bonds. Here Are Six Charts Showing Your Options. URL: https://www.wsj.com/finance/investing/so-you-have-decided-to-buy-bonds-here-are-six-charts-showing-your-options-d55078fa Summary: The article explores various options for investors considering bonds in the current economic climate. With Treasury bonds becoming more expensive and offering limited potential for capital gains, shifting strategies is advised. Long-term Treasurys have historically delivered better returns during easing cycles, despite risks of price fluctuations. For those looking into corporate debt, although investment-grade bonds offer marginal spreads over Treasurys, opportunities exist, particularly in consumer noncyclical sectors with higher yields. CLOs, mortgage-backed securities, and emerging-market debt present additional options, each with unique risk profiles and benefits. Additionally, dividend-paying equities can serve as a bond proxy, blending income with a level of risk more akin to bonds, a strategy that has delivered competitive returns historically even amid market volatility post-pandemic. Title: IBM Releases AI Models for Businesses URL: https://finance.yahoo.com/news/ibm-releases-ai-models-businesses-040820671.html Summary: IBM unveiled its latest "Granite 3.0" AI models, designed for business use, aiming to tap into the growing market for generative AI technology. By offering these models as open-source, IBM stands apart from competitors like Microsoft which charge for model access. IBM provides a paid service called Watsonx to help businesses run customized models in their data centers. Some Granite models are available for commercial use on Watsonx and Nvidia's software tools. The models were developed using Nvidia's H100 GPUs. Title: Angel Investing Isn't What It Used to Be URL: https://www.wsj.com/articles/angel-investing-isnt-what-it-used-to-be-e643c862 Summary: This article discusses how the landscape of angel investing has changed over the years, primarily due to the increased involvement of venture capital firms at early stages of investments. Angel investing, once a domain for individual investors supporting nascent startups, is now less appealing as venture firms, tech giants, and new entrants like hedge funds compete heavily in this space. This competition has driven up valuations and round sizes, making it tough for angels to secure prime deals. The value of angel deals in the U.S. has sharply decreased over recent years. Many angels are becoming limited partners in venture funds to diversify, while those with strong credentials and network connections still find opportunities. The rise of accelerator programs has also shifted the dynamics, offering startups institutional capital that diminishes their reliance on angel investors. Title: Treasuries Plunge Like It's 1995 as Traders See Soft Landing URL: https://finance.yahoo.com/news/treasuries-plunge-1995-traders-see-154428389.html Summary: The US Treasury market is experiencing its biggest selloff since 1995, as two-year yields have increased by 34 basis points following the Federal Reserve's first rate cut since 2020. This trend reflects a reduced probability of recession and strong economic data, prompting speculation that the Fed might slow its pace of rate cuts. Rising yields are influenced by the resilient US economy and financial markets' impact on the Fed's rate-cutting options. Additionally, market volatility and political concerns about potential Republican control of the government further contribute to rising yields. The market activity mirrors a similar situation in 1995 when then-Fed Chair Alan Greenspan achieved an economic soft landing.Atotium News - Business Aggregate - 2024-11-22Title: Nvidia beats earnings expectations as investors eye demand for Blackwell AI chips URL: https://apnews.com/article/nvidia-ai-earnings-report-adc942aa0e0c5d1a550b7bad486b942a Summary: Nvidia has reported a significant increase in its third-quarter profit and sales, with revenue reaching $35.08 billion, driven by sustained demand for its AI-specific computer chips. Earnings were $19.31 billion, surpassing Wall Street expectations. However, Nvidia's stock dipped slightly despite a strong quarterly performance. The company anticipates fourth-quarter revenue to reach approximately $37.5 billion, reflecting continued growth expectations. Analysts are focused on Nvidia's Blackwell graphics processor, a next-generation AI chip expected to experience demand exceeding supply for several quarters. Nvidia is widely recognized as a leader in AI technology, with substantial market value and plans to meet surging Blackwell demand. The company's stock has seen significant appreciation, supporting its status as a prominent figure in the AI revolution. Title: 'I have no money': Thousands of Americans see their savings vanish in Synapse fintech crisis URL: https://www.cnbc.com/amp/2024/11/22/synapse-bankruptcy-thousands-of-americans-see-their-savings-vanish.html Summary: The article outlines a financial crisis involving Synapse, a company acting as an intermediary between fintech startups and small banks like Evolve Bank. Synapse's bankruptcy led to the disappearance of up to $96 million in customer funds, affecting thousands of Americans who trusted fintech solutions for their banking needs. Customers believed their funds were FDIC-insured through Synapse's bank partners but are now finding discrepancies in their accounts, with some unable to recover their savings. Efforts to locate the missing funds are stalled due to lack of coordination among the banks involved and insufficient resources to conduct a full reconciliation. Affected individuals, including members of a group called Fight For Our Funds, are advocating for regulatory action. However, financial regulators like the FDIC and Federal Reserve have yet to offer assistance, and the recovery process is mired in legal and organizational challenges Title: Your Junk Is Needed for the New Electric Era URL: https://www.wsj.com/finance/commodities-futures/your-junk-is-needed-for-the-new-electric-era-504a7e8f Summary: The demand for copper is soaring as the world shifts towards renewable energy and digital technologies. To meet this demand, mining companies like Glencore are increasingly turning to recycled sources, mining old electronics, vehicles, and other scrap. With copper being infinitely recyclable, scrap offers a crucial resource to balance supply and demand in the market. Glencore and other companies are investing heavily to expand North American recycling facilities, aiming to nearly double the proportion of recycled copper by 2050. The process involves collecting and processing scrap, ensuring it's fit for recycling into fresh copper slabs to fuel the electric and data age. Title: Why Robinhood is spending $300 million to buy a wealth management platform URL: https://finance.yahoo.com/news/why-robinhood-spending-300-million-154859907.html Summary: Robinhood, known for catering to millennial and Gen Z investors, is acquiring TradePMR, a wealth management platform for registered investment advisors, for $300 million. This move aims to address the evolving investment needs of its aging user base by providing fiduciary financial advice through a referral network with TradePMR's advisors. The acquisition is strategic in light of an expected $84 trillion wealth transfer over the coming decades, positioning Robinhood to compete with firms like Charles Schwab by offering comprehensive financial services. This deal is anticipated to close in the first half of 2025, pending regulatory approval. Title: Deficit Threat Drives Bond Yields Higher URL: https://www.wsj.com/finance/investing/deficit-threat-drives-bond-yields-higher-6a043d44 Summary: The expectation of a rising federal budget deficit is pushing bond yields higher as investors prepare for a worsening fiscal situation post-election. A recent $69 billion auction of 2-year Treasury notes saw weak demand, contributing to a broader bond market selloff. The situation is exacerbated by the prospect of increased deficits, particularly if Republicans control the White House and Congress, which could lead to tax cuts. Analysts predict that the fiscal year 2025 deficit could hit $2 trillion. The Treasury is expected to maintain large debt sales, with potential increases in 2025, amid ongoing debates about borrowing strategies and their market impact Title: Xcel Energy unveils $45B capital plan as data center pipeline nears 9 GW URL: https://finance.yahoo.com/news/xcel-energy-unveils-45b-capital-090000617.html Summary: Xcel Energy announced a $45 billion capital investment plan over the next five years, focusing on clean energy, customer electrification, load growth, and reliability. This investment includes significant upgrades to transmission and distribution systems, scheduled to claim 63% of the total funding. While data centers contribute to half of Xcel's expected sales growth, other growth areas include the electrification of oil and gas production and electric vehicle adoption. Xcel anticipates completing only 25% of its data center projects soon, reflecting a broader industry challenge to expand transmission and generation infrastructure rapidly. This plan does not cover an additional $10 billion in potential investments or the recently announced large-scale projects in the Upper Midwest and Colorado. Xcel aims to lower electricity costs for customers by efficiently integrating large energy consumers like data centers and EVs into its system. Title: Amazon reports boost in quarterly profits, exceeds revenue estimates as it invests in AI URL: https://financialpost.com/pmn/amazon-reports-boost-in-quarterly-profits-exceeds-revenue-estimates-as-it-invests-in-ai Summary: Amazon announced a significant increase in quarterly profits, surpassing revenue expectations with $158.9 billion in revenue, compared to the anticipated $157.28 billion. The company's net income for the quarter ending September 30 was $15.3 billion, above the $12.21 billion predicted by analysts. Boosted by robust sales from its Prime Day event, Amazonu2019s core online retail business contributed $61.41 billion in revenue. Additionally, Amazon Web Services grew by 19%, aligning with Amazonu2019s increased investment in AI and technological infrastructure. These outcomes follow Amazon's previous quarter where it missed revenue estimates. The tech giant is investing extensively in AI, nuclear energy, and partnerships, despite facing regulatory scrutiny. For the upcoming fourth quarter, Amazon forecasts revenues between $181.5 billion and $188.5 billion, preparing optimistically for the holiday shopping season. Title: Techstars revives Boulder accelerator, with a twist URL: https://www.bizjournals.com/denver/news/2024/10/29/techstars-boulder-accelerator-program-founders.html Summary: Techstars has announced the revival of its Boulder accelerator program under a new initiative called Techstars Colorado, eight months after moving its headquarters to New York City. CEO David Cohen, along with Techstars veterans Nicole Glaros and Natty Zola, aims to create a community-centric accelerator that combines local ownership with access to global resources. The program, expected to launch as early as this summer, will focus on strengthening Colorado's startup ecosystem, with a managing partner soon to be appointed and a search underway for a physical location to host the hub. This marks a return to Techstars' roots, which began in Boulder in 2007Simple Data Toolkit - Tutorial - Ethereum via Etherscan - PythonSimple Data Toolkit provides an unofficial API for reading Ethereum transactions from the Etherscan API. (At the time of this writing, the release of this is pending for complete support, but it is coming soon) To retrieve all Ethereum transactions for a particular address we can do the following:
from sdtk import com_sdtk_api_EtherscanAPI def printer(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_EtherscanAPI.transactionsAPI().retrieveData({"address": "0xAddress"}, printer)Replace 0xAddress with the address you wish to search on. Additionally, we can convert the transactions to our standard internal event interface like so:
from sdtk import com_sdtk_api_EtherscanAPI,com_sdtk_calendar_EtherscanFormat def printerEvents(data, reader): etherScan = com_sdtk_calendar_EtherscanFormat.instance() for event in reader.toArrayOfNativeMaps(None): ci = etherScan.read(event) print(ci.start.toString()) com_sdtk_api_EtherscanAPI.transactionsAPI().retrieveData({"address": "0xAddress"}, printerEvents)Replace 0xAddress with the address you wish to search on.Simple Data Toolkit - Tutorial - ACM Events - PythonSimple Data Toolkit provides an API for retrieving events from ACM (Association of Computing Machinery). (At the time of this writing, the release of this is pending for complete support, but it is coming soon) To retrieve all events in Python, using Simple Data Toolkit, we can do the following:
from sdtk import com_sdtk_api_ACMAPI def printer(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_ACMAPI.eventsAPI().retrieveData({}, printer)We can also convert the transactions, to SDTK's internal event/calendar format with the ACMEventFormat class like so:
from sdtk import com_sdtk_api_ACMAPI,com_sdtk_calendar_ACMEventFormat def printerEvents(data, reader): acm = com_sdtk_calendar_ACMEventFormat.instance() for event in reader.toArrayOfNativeMaps(None): ci = acm.read(event) print(ci) com_sdtk_api_ACMAPI.eventsAPI().retrieveData({}, printerEvents)Simple Data Toolkit - Tutorial - BitTorrent API - PythonSimple Data Toolkit provides an API for retrieving transactions from BitTorrent. To retrieve all transactions in Python, using Simple Data Toolkit, we can do the following:
from sdtk import com_sdtk_api_BitTorrentAPI def printer(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_BitTorrentAPI.transactionsAPI().retrieveData({}, printer)We can also convert the transactions, to SDTK's internal event/calendar format with the BitTorrentFormat class like so:
from sdtk import com_sdtk_api_BitTorrentAPI,com_sdtk_calendar_BitTorrentFormat def printerEvents(data, reader): etherScan = com_sdtk_calendar_BitTorrentFormat.instance() for event in reader.toArrayOfNativeMaps(None): ci = etherScan.read(event) print(ci) com_sdtk_api_BitTorrentAPI.transactionsAPI().retrieveData({}, printerEvents)We can also search by address, startTimestamp, and endTimestamp.Simple Data Toolkit - Tutorial - GUI - Batch ScriptLet's suppose you want to create a task that loads a TSV file into a CSV file on a daily basis. This task is meant to be part of a Batch script, but you are unfamiliar with Batch and are unsure of how to write the code. Good news, you can use the Sample Data Toolkit UI to figure out this code for you as follows: 1) Go to the app page for the Simple Data Toolkit UI, at the time of this writing it is here: https://www.vis-software.com/#sdtk 2) Click Choose Files. 3) Find the file you want to convert. 4) Click Open. 5) Select the output type you want, for this tutorial we will select CSV. 6) Then for script, select Batch. 7) Then click Download Script. You will now have a simple Batch script that uses STC (Simple Table Converter - A commandline utility that is part of the SDTK) to convert the file you selected to CSV. You can now either run this script or integrate it with another one. If you need to install STC, you can install it via Chocolatey (https://chocolatey.org/) with the following command: choco install stc The script will look something like this: stc "ga_sample.csv" textonly "ga_sample.csv"Atotium News - Business Aggregate - 2024-12-10Federal Reserve to cut rates by 25 bps on Dec. 18, pause in January- Reuters poll https://finance.yahoo.com/news/federal-cut-rates-25-bps-135054884.html The U.S. Federal Reserve is expected to cut interest rates by 25 basis points on December 18, with 90% of economists polled by Reuters predicting this move. Following this, a pause in rate changes is anticipated in late January amidst concerns over rising inflation risks. Economists attribute potential inflationary pressures to President-elect Donald Trump's proposed policies, including import tariffs and tax cuts. The job market's resilience has reinforced expectations for a rate cut, with most economists forecasting the federal funds rate to be reduced to 4.25%-4.50%. However, a majority expect the Fed to hold rates steady at its January meeting. While nearly 60% of economists predict at least three more rate cuts next year, there is no consensus on future actions. The Fed aims to reach a neutral rate that neither stimulates nor restricts the economy, recently assessed at around 2.9%. Inflation forecasts have been elevated, with concerns about inflation risks due to increased tariffs and potential trade disruptions from the incoming administration. The Fed will update its economic forecasts at the December meeting. GM exits robotaxi market, will bring Cruise operations in house https://www.cnbc.com/2024/12/10/gm-halts-funding-of-robotaxi-development-by-cruise.html General Motors (GM) has decided to end its funding for the development of robotaxis by its subsidiary Cruise. Instead, GM plans to integrate Cruise into its larger technical team to focus on developing autonomous systems for personal vehicles. This decision, announced after an investment of over $10 billion in Cruise, is attributed to the competitive robotaxi market, capital allocation priorities, and the extensive time and resources required to scale up. GM bought Cruise in 2016 and plans to increase its ownership to over 97% by early 2025. This move will also reduce Cruise's annual expenditure from about $2 billion by more than half. Cruise, which halted its driverless operations in October 2023, faced regulatory issues including a crash involving a pedestrian and internal problems that contributed to the decision. GM's departure from the robotaxi market occurs as competitors like Waymo, Tesla, and others advance their own autonomous vehicle services. Microsoft Unveils Zero-Water Data Centers to Reduce AI Climate Impact https://finance.yahoo.com/news/microsoft-unveils-zero-water-data-170002064.html Microsoft has introduced a new data center design that requires zero water for cooling its chips and servers, aimed at reducing the climate impact of its expanding data center operations. This new system employs a "closed loop" method, recycling water that is initially introduced during construction without needing fresh supplies afterward. This initiative, launched in August, is expected to save over 125 million liters of water per year per data center. While the data centers will still need fresh water for facilities like bathrooms and kitchens, this new design is part of Microsoft s effort to address the environmental demands of its growing AI services, particularly in hot and dry regions such as Arizona and Texas. Existing data centers will maintain older technologies, but new facilities in Phoenix and Mount Pleasant, Wisconsin, will adopt this zero-water design starting in 2026. Crypto Trading Frenzy Leads Analyst to Hike Price Targets for Coinbase, Robinhood Stock https://www.barrons.com/articles/crypto-coinbase-robinhood-stock-price-target-71f031b2 The article discusses a recent surge in crypto trading activity, prompting an analyst from Needham & Co., John Todaro, to raise price targets for Coinbase and Robinhood. Despite previous muted trading volumes, both platforms are experiencing increased activity. Todaro increased his target for Coinbase to $420 and for Robinhood to $52, while maintaining a Buy rating. The appointment of Donald Trump and his regulatory policy changes favoring the crypto industry are seen as beneficial for these companies. SEC leadership changes and Trump's pro-crypto stance are expected to promote new products and trading on these platforms, with Robinhood aiming to be a leader in crypto and options trading by 2027 and equities by 2029. Bitcoin has reached record highs, motivating a resurgence in trading activity after a period of relative quiet.Simple Data Toolkit - Python - Loading Data and Text Through ChatGPTSimple Data Toolkit provides an API for passing data and text to ChatGPT and extracting related data or text. (At the time of this writing, the release of this is pending for complete support, but it is coming soon) Below is an example which uses an embedded data of users and orders, plus text loaded in from a file.
from sdtk import com_sdtk_api_ChatGPTAPI, com_sdtk_table_ArrayOfMapsReader #Set def callbackData(reader): print(reader.toArrayOfNativeMaps(None)) def callbackText(data): print(data) users = [ {"user_id": 1, "first_name": "Sally", "last_name": "Franklin"}, {"user_id": 2, "first_name": "Lucas", "last_name": "Franklin"}, {"user_id": 3, "first_name": "Joe", "last_name": "Romeo"}, {"user_id": 4, "first_name": "Julie", "last_name": "Romeo"}, {"user_id": 5, "first_name": "Lucia", "last_name": "Templeton"}, ] orders = [ {"order_id": 1, "user_id": 3, "item_desc": "Book 1", "item_quantity": 2, "date": "2024-01-01"}, {"order_id": 2, "user_id": 3, "item_desc": "Book 2", "item_quantity": 1, "date": "2024-02-01"}, {"order_id": 3, "user_id": 3, "item_desc": "Book 3", "item_quantity": 3, "date": "2024-03-01"}, {"order_id": 4, "user_id": 3, "item_desc": "Book 4", "item_quantity": 0, "date": "2024-04-01"}, {"order_id": 5, "user_id": 3, "item_desc": "Book 5", "item_quantity": 4, "date": "2024-05-01"} ] com_sdtk_api_ChatGPTAPI.queryAsReaderWithDataAPI().execute("What can we determine about the buying habits of all of our users?", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackData) com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("What can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText) content = "" with open('sample.html', 'r') as content_file: content = content_file.read() com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("We also have this document in HTML format on recent trends.\n" + content + "\n\nWhat can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText)Below is an example which queries data from ChatGPT in a table format using a DataTableReader from SDTK.
from sdtk import com_sdtk_api_ChatGPTAPI def callback(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_ChatGPTAPI.queryAsReaderAPI().retrieveData({ "query": "List all cities in the USA with known population." }, callback)Simple Data Toolkit - Python - Loading Data and Text Through ChatGPTSimple Data Toolkit provides an API for passing data and text to ChatGPT and extracting related data or text. (At the time of this writing, the release of this is pending for complete support, but it is coming soon) Below is an example which uses an embedded data of users and orders, plus text loaded in from a file.
from sdtk import com_sdtk_api_ChatGPTAPI, com_sdtk_table_ArrayOfMapsReader #Set def callbackData(reader): print(reader.toArrayOfNativeMaps(None)) def callbackText(data): print(data) users = [ {"user_id": 1, "first_name": "Sally", "last_name": "Franklin"}, {"user_id": 2, "first_name": "Lucas", "last_name": "Franklin"}, {"user_id": 3, "first_name": "Joe", "last_name": "Romeo"}, {"user_id": 4, "first_name": "Julie", "last_name": "Romeo"}, {"user_id": 5, "first_name": "Lucia", "last_name": "Templeton"}, ] orders = [ {"order_id": 1, "user_id": 3, "item_desc": "Book 1", "item_quantity": 2, "date": "2024-01-01"}, {"order_id": 2, "user_id": 3, "item_desc": "Book 2", "item_quantity": 1, "date": "2024-02-01"}, {"order_id": 3, "user_id": 3, "item_desc": "Book 3", "item_quantity": 3, "date": "2024-03-01"}, {"order_id": 4, "user_id": 3, "item_desc": "Book 4", "item_quantity": 0, "date": "2024-04-01"}, {"order_id": 5, "user_id": 3, "item_desc": "Book 5", "item_quantity": 4, "date": "2024-05-01"} ] com_sdtk_api_ChatGPTAPI.queryAsReaderWithDataAPI().execute("What can we determine about the buying habits of all of our users?", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackData) com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("What can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText) content = "" with open('sample.html', 'r') as content_file: content = content_file.read() com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("We also have this document in HTML format on recent trends.\n" + content + "\n\nWhat can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText)Below is an example which queries data from ChatGPT in a table format using a DataTableReader from SDTK.
from sdtk import com_sdtk_api_ChatGPTAPI def callback(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_ChatGPTAPI.queryAsReaderAPI().retrieveData({ "query": "List all cities in the USA with known population." }, callback)Simple Data Toolkit - Python - Loading Data and Text Through ChatGPTSimple Data Toolkit provides an API for passing data and text to ChatGPT and extracting related data or text. (At the time of this writing, the release of this is pending for complete support, but it is coming soon) Below is an example which uses an embedded data of users and orders, plus text loaded in from a file.
from sdtk import com_sdtk_api_ChatGPTAPI, com_sdtk_table_ArrayOfMapsReader #Set def callbackData(reader): print(reader.toArrayOfNativeMaps(None)) def callbackText(data): print(data) users = [ {"user_id": 1, "first_name": "Sally", "last_name": "Franklin"}, {"user_id": 2, "first_name": "Lucas", "last_name": "Franklin"}, {"user_id": 3, "first_name": "Joe", "last_name": "Romeo"}, {"user_id": 4, "first_name": "Julie", "last_name": "Romeo"}, {"user_id": 5, "first_name": "Lucia", "last_name": "Templeton"}, ] orders = [ {"order_id": 1, "user_id": 3, "item_desc": "Book 1", "item_quantity": 2, "date": "2024-01-01"}, {"order_id": 2, "user_id": 3, "item_desc": "Book 2", "item_quantity": 1, "date": "2024-02-01"}, {"order_id": 3, "user_id": 3, "item_desc": "Book 3", "item_quantity": 3, "date": "2024-03-01"}, {"order_id": 4, "user_id": 3, "item_desc": "Book 4", "item_quantity": 0, "date": "2024-04-01"}, {"order_id": 5, "user_id": 3, "item_desc": "Book 5", "item_quantity": 4, "date": "2024-05-01"} ] com_sdtk_api_ChatGPTAPI.queryAsReaderWithDataAPI().execute("What can we determine about the buying habits of all of our users?", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackData) com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("What can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText) content = "" with open('sample.html', 'r') as content_file: content = content_file.read() com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("We also have this document in HTML format on recent trends.\n" + content + "\n\nWhat can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText)Below is an example which queries data from ChatGPT in a table format using a DataTableReader from SDTK.
from sdtk import com_sdtk_api_ChatGPTAPI def callback(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_ChatGPTAPI.queryAsReaderAPI().retrieveData({ "query": "List all cities in the USA with known population." }, callback)
Write the right way.
Ortingo is a platform that makes publishing easier and information more accessible. Publish from a wide spectrum of various topics and connect with your audience with new ways of writing articles. Be part of a wealth of new information, through Ortingo.
Ready to write the right way?
Learn more about Ortingo
Any thoughts on Franklin's post?
To comment or reply, you need an Ortingo account.
Sign in or sign upHere's what Ortingoers think of Franklin's post.
There are no comments on this post.