frapi | API Open Source framework , run it within your hosting | Runtime Evironment library
kandi X-RAY | frapi Summary
Support
Quality
Security
License
Reuse
- Calculates date parts
- Retrieves a list of values
- Updates the segments .
- Returns a date formatted according to the specified format .
- Convert a color to a named color .
- Parse a date
- Load a xref table
- Defines default markups
- Hash in Markdown text blocks .
- Parse the OS2 table
frapi Key Features
frapi Examples and Code Snippets
Trending Discussions on frapi
Trending Discussions on frapi
QUESTION
My code is as follows,
sid = ["592009","478299","621403","112501","250217","1000060","1002776"]
sids = pd.DataFrame()
for i in sid:
r = requests.get(f"https://frapi.marketsmojo.com/stocks_quality/cardinfo?sid={i}")
js = r.json()["data"]["quality_tbl"]["list"]
ratios = pd.DataFrame.from_dict(js)
#ratios.columns = ratios.columns[1]
sids= sids.append(ratios)
Here I am looping through list of company with number of sid_id, I need to create a dataframe, from the list of sid_ID present.
Sample of the output is as follows,
name value Net Interest Income Growth (5y) 18.80% Net Profit Growth (5y) 20.55% Advance to Deposit 86.55% Capital Adequacy Ratio (Tier 1) 15.58% Gross NPA (latest) 0.81% Gross NPA (avg) 1.19% Coverage Ratio (avg) 72.27% Cost to Income (avg) 40.16% Net Interest Margin (avg) 4.54% Operating Profit to Assets (avg) 5.98% ROA (avg) 1.75%This output is from 1 iteration of loop. How to get the output for all iteration as.
name C1 C2 C3 Net Interest Income Growth (5y) 18.80% 19.80% 18.80% Net Profit Growth (5y) 20.55% 20.1% 23.8% Advance to Deposit 86.55% 20.1% 23.8% Capital Adequacy Ratio (Tier 1) 15.58% 20.1% 23.8% Gross NPA (latest) 0.81% 20.1% 23.8% Gross NPA (avg) 1.19% 20.1% 23.8% Coverage Ratio (avg) 72.27% 20.1% 23.8% Cost to Income (avg) 40.16% 20.1% 23.8% Net Interest Margin (avg) 4.54% 20.1% 23.8% Operating Profit to Assets (avg) 5.98% 20.1% 23.8% ROA (avg) 1.75% 20.1% 23.8%how to change the for loop to get the desired output. Or use list and get it is as dataframe?
Any suggestions?
ANSWER
Answered 2021-Mar-30 at 07:46Create list of Series
first and then pass to concat
with axis=1
and keys
for columns names by sid
s:
sid = ["592009","478299","621403","112501","250217","1000060","1002776"]
dfs = []
for i in sid:
r = requests.get(f"https://frapi.marketsmojo.com/stocks_quality/cardinfo?sid={i}")
js = r.json()["data"]["quality_tbl"]["list"]
#create Series with index by name column
ratios = pd.DataFrame.from_dict(js).set_index('name')['value']
dfs.append(ratios)
df = pd.concat(dfs, axis=1, keys=sid).reset_index()
print (df)
QUESTION
I am working on an app with many pages and a lot of interconnectivity between tables. And I want a custom message to display(or change text of error message) when a user attempts to delete a record with a child. Basically, when a user gets the following error: 'Ajax call returned server error ORA-20987: APEX - ORA-02292: integrity constraint (FRAPIS.AZK_KPN_FK) violated - child record found - Contact your application administrator.' I want them to see something else, that tells them they cannot delete this record untill they delete all child records. I know the error already basically says this, but this is for end users, and some might not even know english(the app is translated).
I have tried setting a dynamic translation, but it did nothing(only translates my plsql values). I have tried searching for a full list of text messages so I could add a translation, but no luck so far. Best I got was on http://translate-apex.com/ which I had already used to translate the rest of the app, but it didnt contain any translations for the server errors
I did find some people talking about capturing the error and something, but its from 2008, for APEX 5 and I have no idea what exactly they mean: https://community.oracle.com/thread/681328
I know I could get this done with custom validations, but that would require a LOT of code to do this one thing. And I dont want to go that route(this isnt essential, users can probably understand what the error means). I am looking for a method that translates this for the entire application, or at least a method that works on one page and just needs to be copied over to other pages with minimal or perhaps even no modifications.
ANSWER
Answered 2019-Apr-01 at 10:16I have looked into it and found a solution.
In Shared Components- Application Definition Attributes you can set an Error handling function. Which can do many things, amongst them is to change the message into whatever you want.
http://dgielis.blogspot.com/2018/06/automatically-capture-all-errors-and.html
This link has some instructions on how to do it and I managed to get it working.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install frapi
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesExplore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits
Save this library and start creating your kit
Share this Page